add allow_implicit_spawn setting

- warn that there are known issues associated with enabling it
- it is inherently incompatible with named servers
This commit is contained in:
Min RK
2020-02-20 12:12:55 +01:00
parent 3e17b47ec3
commit a0b6d8ec6f
2 changed files with 35 additions and 1 deletions

View File

@@ -1426,11 +1426,17 @@ class UserUrlHandler(BaseHandler):
# serve a page prompting for spawn and 503 error
# visiting /user/:name no longer triggers implicit spawn
# without explicit user action
self.set_status(503)
spawn_url = url_concat(
url_path_join(self.hub.base_url, "spawn", user.escaped_name, server_name),
{"next": self.request.uri},
)
if self.settings["allow_implicit_spawn"]:
self.log.warning("Allowing implicit spawn for %s", self.request.path)
self.redirect(spawn_url)
return
else:
self.set_status(503)
auth_state = await user.get_auth_state()
html = self.render_template(
"not_running.html",