Files
smart-city-digital-twin-mar…/vre/jupyterhub/jupyterhub_config.py

38 lines
1.1 KiB
Python

# JupyterHub configuration for Smart City VRE
# Uses NativeAuthenticator with LocalProcessSpawner
# Build: 2026-06-01-0915
import sys as _sys
c.JupyterHub.ip = '0.0.0.0'
c.JupyterHub.port = 8000
c.JupyterHub.hub_ip = '0.0.0.0'
# Authenticator: Native (username/password signup + login)
c.JupyterHub.authenticator_class = 'nativeauthenticator.NativeAuthenticator'
c.Authenticator.admin_users = {'admin'}
c.Authenticator.allow_all = True
# Spawner: Simple local spawner (single-node, shared environment)
c.JupyterHub.spawner_class = 'simple'
c.Spawner.cmd = ['jupyterhub-singleuser']
c.Spawner.default_url = '/lab'
c.Spawner.start_timeout = 300
c.Spawner.http_timeout = 120
# Database and cookies - use absolute path (4 slashes!)
c.JupyterHub.cookie_secret_file = '/srv/jupyterhub/jupyterhub_cookie_secret'
c.JupyterHub.db_url = 'sqlite:////srv/jupyterhub/jupyterhub.sqlite'
# Base URL
c.JupyterHub.base_url = '/'
# Trust forwarded headers from Traefik
c.JupyterHub.tornado_settings = {
'headers': {
'Content-Security-Policy': "frame-ancestors 'self'"
}
}
c.JupyterHub.shutdown_on_logout = False