mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
Move all config files inside INSTALL_PREFIX
Makes cleanup easier!
This commit is contained in:
@@ -31,8 +31,10 @@ def ensure_jupyterhub_service(prefix):
|
|||||||
systemd.install_unit('jupyterhub.service', hub_unit_template.format(**unit_params))
|
systemd.install_unit('jupyterhub.service', hub_unit_template.format(**unit_params))
|
||||||
|
|
||||||
# Set up proxy / hub secret oken if it is not already setup
|
# Set up proxy / hub secret oken if it is not already setup
|
||||||
if not os.path.exists('/etc/jupyterhub/configurable-http-proxy.secret'):
|
# FIXME: Check umask here properly
|
||||||
with open('/etc/jupyterhub/configurable-http-proxy.secret', 'w') as f:
|
proxy_secret_path = os.path.join(INSTALL_PREFIX, 'configurable-http-proxy.secret')
|
||||||
|
if not os.path.exists(proxy_secret_path):
|
||||||
|
with open(proxy_secret_path, 'w') as f:
|
||||||
f.write('CONFIGPROXY_AUTH_TOKEN=' + secrets.token_hex(32))
|
f.write('CONFIGPROXY_AUTH_TOKEN=' + secrets.token_hex(32))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,4 +29,4 @@ c.JupyterHub.port = 80
|
|||||||
|
|
||||||
c.SystemdSpawner.extra_paths = [os.path.join(USER_ENV_PREFIX, 'bin')]
|
c.SystemdSpawner.extra_paths = [os.path.join(USER_ENV_PREFIX, 'bin')]
|
||||||
|
|
||||||
configurer.apply_yaml_config('/etc/jupyterhub/jupyterhub.yaml', c)
|
configurer.apply_yaml_config(os.path.join(INSTALL_PREFIX, 'jupyterhub.yaml'), c)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ PrivateTmp=yes
|
|||||||
PrivateDevices=yes
|
PrivateDevices=yes
|
||||||
ProtectKernelTunables=yes
|
ProtectKernelTunables=yes
|
||||||
ProtectKernelModules=yes
|
ProtectKernelModules=yes
|
||||||
EnvironmentFile=/etc/jupyterhub/configurable-http-proxy.secret
|
EnvironmentFile={install_prefix}/configurable-http-proxy.secret
|
||||||
ExecStart={install_prefix}/hub/bin/configurable-http-proxy \
|
ExecStart={install_prefix}/hub/bin/configurable-http-proxy \
|
||||||
--ip 0.0.0.0 \
|
--ip 0.0.0.0 \
|
||||||
--port 80 \
|
--port 80 \
|
||||||
|
|||||||
@@ -17,6 +17,6 @@ PrivateDevices=yes
|
|||||||
ProtectKernelTunables=yes
|
ProtectKernelTunables=yes
|
||||||
ProtectKernelModules=yes
|
ProtectKernelModules=yes
|
||||||
# Source CONFIGPROXY_AUTH_TOKEN from here!
|
# Source CONFIGPROXY_AUTH_TOKEN from here!
|
||||||
EnvironmentFile=/etc/jupyterhub/configurable-http-proxy.secret
|
EnvironmentFile={install_prefix}/configurable-http-proxy.secret
|
||||||
Environment=TLJH_INSTALL_PREFIX={install_prefix}
|
Environment=TLJH_INSTALL_PREFIX={install_prefix}
|
||||||
ExecStart={python_interpreter_path} -m jupyterhub.app -f {jupyterhub_config_path}
|
ExecStart={python_interpreter_path} -m jupyterhub.app -f {jupyterhub_config_path}
|
||||||
|
|||||||
Reference in New Issue
Block a user