From 80c74125aaaa0df6ba104c4de696b117ea229449 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 28 Aug 2020 19:03:15 +0200 Subject: [PATCH] Fix the data dir. Add the trusted alt names. --- defaults/main.yml | 6 ++++++ templates/jupyterhub_config.py.j2 | 6 +++--- vars/main.yml | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 3a88f3e..3ea215a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -4,12 +4,18 @@ jupyter_lab: True jupyter_notebook: True jupyter_hub_ssl_enabled: True jupyter_hub_letsencrypt_ssl: False +jupyter_hub_recreate_internal_certs: False +jupyter_hub_upgrade_db: True jupyter_hub_logrotate_maxfilesize: '1G' jupyter_hub_logrotate_retention: '7' jupyter_hub_external_proxy: False jupyter_hub_external_proxy_ips: - '127.0.0.1' +jupyter_hub_trusted_alt_names: + - '127.0.0.1' + - 'localhost' + jupyter_hub_ip: '127.0.0.1' jupyter_hub_bind_ip: '127.0.0.1' diff --git a/templates/jupyterhub_config.py.j2 b/templates/jupyterhub_config.py.j2 index 2aca9e2..f80d576 100644 --- a/templates/jupyterhub_config.py.j2 +++ b/templates/jupyterhub_config.py.j2 @@ -359,7 +359,7 @@ c.JupyterHub.named_server_limit_per_user = {{ jupyter_hub_concurred_named_server # Note: enabling this feature requires restarting all notebook servers. # # Use with internal_ssl -#c.JupyterHub.recreate_internal_certs = False +c.JupyterHub.recreate_internal_certs = {{ jupyter_hub_recreate_internal_certs }} ## Redirect user to server (if running), instead of control panel. #c.JupyterHub.redirect_to_server = True @@ -488,7 +488,7 @@ c.JupyterHub.ssl_key = '{{ letsencrypt_acme_sh_certificates_install_path }}/priv # different hosts. # # Use with internal_ssl -#c.JupyterHub.trusted_alt_names = [] +c.JupyterHub.trusted_alt_names = [ {% for h in jupyter_hub_trusted_alt_names %}'{{ h }}'{% if not loop.last %},{% endif %} {% endfor %} ] ## Downstream proxy IP addresses to trust. # @@ -504,7 +504,7 @@ c.JupyterHub.trusted_downstream_ips = [ {% for ip in jupyter_hub_external_proxy_ # # Only safe if database is regularly backed up. Only SQLite databases will be # backed up to a local file automatically. -#c.JupyterHub.upgrade_db = False +c.JupyterHub.upgrade_db = {{ jupyter_hub_upgrade_db }} ## Callable to affect behavior of /user-redirect/ # diff --git a/vars/main.yml b/vars/main.yml index 927a528..1258cfe 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -8,7 +8,8 @@ jupyter_hub_user_home: /srv/jupyterhub jupyter_hub_venv: jupyterhub_env jupyter_hub_base_dir: '/opt/jupyterhub' jupyter_hub_conf_dir: '{{ jupyter_hub_base_dir }}/etc' -jupyter_hub_data_dir: '{{ jupyter_hub_base_dir }}/data' +#jupyter_hub_data_dir: '{{ jupyter_hub_base_dir }}/data' +jupyter_hub_data_dir: '/usr/local/share/jupyterhub' jupyter_hub_conf: '{{ jupyter_hub_conf_dir }}/jupyterhub_config.py' jupyter_hub_venv_dir: '/opt/{{ jupyter_hub_venv }}' jupyter_hub_logdir: /var/log/jupyter