From 71c55486a7e73a24658c28f5d22682d908ed8e2d Mon Sep 17 00:00:00 2001 From: Wido den Hollander Date: Tue, 5 Jun 2018 09:32:58 +0200 Subject: [PATCH] mgr/dashboard: Listen on port 8443 by default and not 8080 Port 8080 is a common alternative HTTP port used for web traffic. The dashboard however uses SSL (which can not be turned off) and for that purpose we should use 8443. Signed-off-by: Wido den Hollander (cherry picked from commit b7cc66e809e9f15b211adef5bac369c32a4bacaa) Signed-off-by: Wido den Hollander --- doc/mgr/dashboard.rst | 2 +- src/pybind/mgr/dashboard/HACKING.rst | 6 +++--- src/pybind/mgr/dashboard/controllers/__init__.py | 6 +++--- src/pybind/mgr/dashboard/frontend/proxy.conf.json.sample | 2 +- src/pybind/mgr/dashboard/module.py | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/mgr/dashboard.rst b/doc/mgr/dashboard.rst index 1b3a1252798..858444dca79 100644 --- a/doc/mgr/dashboard.rst +++ b/doc/mgr/dashboard.rst @@ -150,7 +150,7 @@ Host name and port Like most web applications, dashboard binds to a TCP/IP address and TCP port. By default, the ``ceph-mgr`` daemon hosting the dashboard (i.e., the currently -active manager) will bind to TCP port 8080. If no specific address has been +active manager) will bind to TCP port 8443. If no specific address has been configured, the web app will bind to ``::``, which corresponds to all available IPv4 and IPv6 addresses. diff --git a/src/pybind/mgr/dashboard/HACKING.rst b/src/pybind/mgr/dashboard/HACKING.rst index a5084f2dd2e..f20eb2d911f 100644 --- a/src/pybind/mgr/dashboard/HACKING.rst +++ b/src/pybind/mgr/dashboard/HACKING.rst @@ -61,7 +61,7 @@ Build the Project Run ``npm run build`` to build the project. The build artifacts will be stored in the ``dist/`` directory. Use the ``-prod`` flag for a -production build. Navigate to ``http://localhost:8080``. +production build. Navigate to ``https://localhost:8443``. Running Unit Tests ~~~~~~~~~~~~~~~~~~ @@ -265,11 +265,11 @@ following code:: Every path given in the ``ApiController`` decorator will automatically be prefixed with ``api``. After reloading the Dashboard module you can access the above mentioned controller by pointing your browser to -http://mgr_hostname:8080/api/ping2. +https://mgr_hostname:8443/api/ping2. It is also possible to have nested controllers. The ``RgwController`` uses this technique to make the daemons available through the URL -http://mgr_hostname:8080/api/rgw/daemon:: +https://mgr_hostname:8443/api/rgw/daemon:: @ApiController('rgw') @AuthRequired() diff --git a/src/pybind/mgr/dashboard/controllers/__init__.py b/src/pybind/mgr/dashboard/controllers/__init__.py index 0ba43099cc6..854856a06a6 100644 --- a/src/pybind/mgr/dashboard/controllers/__init__.py +++ b/src/pybind/mgr/dashboard/controllers/__init__.py @@ -415,9 +415,9 @@ class RESTController(BaseController): Test with curl: curl -H "Content-Type: application/json" -X POST \ - -d '{"username":"xyz","password":"xyz"}' http://127.0.0.1:8080/foo - curl http://127.0.0.1:8080/foo - curl http://127.0.0.1:8080/foo/0 + -d '{"username":"xyz","password":"xyz"}' https://127.0.0.1:8443/foo + curl https://127.0.0.1:8443/foo + curl https://127.0.0.1:8443/foo/0 """ diff --git a/src/pybind/mgr/dashboard/frontend/proxy.conf.json.sample b/src/pybind/mgr/dashboard/frontend/proxy.conf.json.sample index e654419c9cf..72f3004ba3d 100644 --- a/src/pybind/mgr/dashboard/frontend/proxy.conf.json.sample +++ b/src/pybind/mgr/dashboard/frontend/proxy.conf.json.sample @@ -1,6 +1,6 @@ { "/api/": { - "target": "http://localhost:8080", + "target": "https://localhost:8443", "secure": false, "logLevel": "debug" } diff --git a/src/pybind/mgr/dashboard/module.py b/src/pybind/mgr/dashboard/module.py index 9bcdca97a4d..87ecdcb672d 100644 --- a/src/pybind/mgr/dashboard/module.py +++ b/src/pybind/mgr/dashboard/module.py @@ -112,7 +112,7 @@ class SSLCherryPyConfig(object): :returns our URI """ server_addr = self.get_localized_config('server_addr', '::') - server_port = self.get_localized_config('server_port', '8080') + server_port = self.get_localized_config('server_port', '8443') if server_addr is None: raise ServerConfigException( 'no server_addr configured; ' -- 2.47.3