mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-18 07:23:00 +00:00
expose proxy SSL arguments
public server can now be HTTPS still no SSL behind the proxy
This commit is contained in:
@@ -42,6 +42,18 @@ class JupyterHubApp(Application):
|
|||||||
help="The location of jupyter data files (e.g. /usr/local/share/jupyter)"
|
help="The location of jupyter data files (e.g. /usr/local/share/jupyter)"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
ssl_key = Unicode('', config=True,
|
||||||
|
help="""Path to SSL key file for the public facing interface of the proxy
|
||||||
|
|
||||||
|
Use with ssl_cert
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
ssl_cert = Unicode('', config=True,
|
||||||
|
help="""Path to SSL certificate file for the public facing interface of the proxy
|
||||||
|
|
||||||
|
Use with ssl_key
|
||||||
|
"""
|
||||||
|
)
|
||||||
ip = Unicode('localhost', config=True,
|
ip = Unicode('localhost', config=True,
|
||||||
help="The public facing ip of the proxy"
|
help="The public facing ip of the proxy"
|
||||||
)
|
)
|
||||||
@@ -222,14 +234,20 @@ class JupyterHubApp(Application):
|
|||||||
"""Actually start the configurable-http-proxy"""
|
"""Actually start the configurable-http-proxy"""
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
env['CONFIGPROXY_AUTH_TOKEN'] = self.proxy.auth_token
|
env['CONFIGPROXY_AUTH_TOKEN'] = self.proxy.auth_token
|
||||||
self.proxy = Popen([self.proxy_cmd,
|
cmd = [self.proxy_cmd,
|
||||||
'--ip', self.proxy.public_server.ip,
|
'--ip', self.proxy.public_server.ip,
|
||||||
'--port', str(self.proxy.public_server.port),
|
'--port', str(self.proxy.public_server.port),
|
||||||
'--api-ip', self.proxy.api_server.ip,
|
'--api-ip', self.proxy.api_server.ip,
|
||||||
'--api-port', str(self.proxy.api_server.port),
|
'--api-port', str(self.proxy.api_server.port),
|
||||||
'--upstream-ip', self.hub.server.ip,
|
'--upstream-ip', self.hub.server.ip,
|
||||||
'--upstream-port', str(self.hub.server.port),
|
'--upstream-port', str(self.hub.server.port),
|
||||||
], env=env)
|
]
|
||||||
|
if self.ssl_key:
|
||||||
|
cmd.extend(['--ssl-key', self.ssl_key])
|
||||||
|
if self.ssl_cert:
|
||||||
|
cmd.extend(['--ssl-cert', self.ssl_cert])
|
||||||
|
|
||||||
|
self.proxy = Popen(cmd, env=env)
|
||||||
|
|
||||||
def init_tornado_settings(self):
|
def init_tornado_settings(self):
|
||||||
"""Set up the tornado settings dict."""
|
"""Set up the tornado settings dict."""
|
||||||
|
Reference in New Issue
Block a user