Merge pull request #3927 from meeseeksmachine/auto-backport-of-pr-3918-on-2.x

Backport PR #3918 on branch 2.x (set default_url via config)
This commit is contained in:
Yuvi Panda
2022-06-06 18:40:06 +05:30
committed by GitHub

View File

@@ -633,6 +633,12 @@ class SingleUserNotebookAppMixin(Configurable):
# disable trash by default
# this can be re-enabled by config
self.config.FileContentsManager.delete_to_trash = False
# load default-url env at higher priority than `@default`,
# which may have their own _defaults_ which should not override explicit default_url config
# via e.g. c.Spawner.default_url. Seen in jupyterlab's SingleUserLabApp.
default_url = os.environ.get("JUPYTERHUB_DEFAULT_URL")
if default_url:
self.config[self.__class__.__name__].default_url = default_url
self._log_app_versions()
return super().initialize(argv)