mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-15 05:53:00 +00:00
disable hub_prefix config
it shouldn't be configurable
This commit is contained in:
@@ -356,20 +356,18 @@ class JupyterHub(Application):
|
|||||||
help="The ip for this process"
|
help="The ip for this process"
|
||||||
).tag(config=True)
|
).tag(config=True)
|
||||||
hub_prefix = URLPrefix('/hub/',
|
hub_prefix = URLPrefix('/hub/',
|
||||||
help="The prefix for the hub server. Must not be '/'"
|
help="The prefix for the hub server. Always /base_url/hub/"
|
||||||
).tag(config=True)
|
)
|
||||||
|
|
||||||
@default('hub_prefix')
|
@default('hub_prefix')
|
||||||
def _hub_prefix_default(self):
|
def _hub_prefix_default(self):
|
||||||
return url_path_join(self.base_url, '/hub/')
|
return url_path_join(self.base_url, '/hub/')
|
||||||
|
|
||||||
@observe('hub_prefix')
|
@observe('base_url')
|
||||||
def _hub_prefix_changed(self, change):
|
def _update_hub_prefix(self, change):
|
||||||
new = change['new']
|
"""add base URL to hub prefix"""
|
||||||
if new == '/':
|
base_url = change['new']
|
||||||
raise TraitError("'/' is not a valid hub prefix")
|
self.hub_prefix = self._hub_prefix_default()
|
||||||
if not new.startswith(self.base_url):
|
|
||||||
self.hub_prefix = url_path_join(self.base_url, new)
|
|
||||||
|
|
||||||
cookie_secret = Bytes(
|
cookie_secret = Bytes(
|
||||||
help="""The cookie secret to use to encrypt cookies.
|
help="""The cookie secret to use to encrypt cookies.
|
||||||
|
Reference in New Issue
Block a user