Merge pull request 'neoloc/jupyterhub' (#174) from neoloc/jupyterhub into develop

Reviewed-on: https://git.query.consul/unkinben/puppet-prod/pulls/174
This commit was merged in pull request #174.
This commit is contained in:
2024-11-16 20:20:16 +11:00
5 changed files with 69 additions and 20 deletions
@@ -9,6 +9,7 @@ c = get_config()
c.JupyterHub.bind_url = 'http://:8000'
c.JupyterHub.hub_ip = '0.0.0.0'
c.JupyterHub.hub_port = 8081
c.NotebookApp.enable_terminals = True
# Configure the DockerSpawner
c.JupyterHub.spawner_class = DockerSpawner
@@ -16,28 +17,37 @@ c.DockerSpawner.image = '<%= @docker_image %>'
c.DockerSpawner.network_name = '<%= @docker_network %>'
# Notebook directory and mount location
notebook_dir = '/home/jupyter/work'
c.DockerSpawner.notebook_dir = notebook_dir
c.DockerSpawner.notebook_dir = '<%= @notebook_path %>'
# Optional: Volume mapping for user data persistence
c.DockerSpawner.volumes = {
'jupyterhub-user-{username}': notebook_dir
'jupyterhub-user-{username}': '<%= @notebook_path %>'
}
# DockerSpawner options
c.DockerSpawner.remove = True
c.DockerSpawner.debug = True
c.DockerSpawner.pull_policy = "always"
# LDAP Authentication
c.JupyterHub.authenticator_class = 'ldapauthenticator.LDAPAuthenticator'
# LDAP Server settings
c.LDAPAuthenticator.server_address = '<%= @ldap_server_address %>'
c.LDAPAuthenticator.bind_dn_template = '<%= @ldap_bind_dn_template %>'
c.LDAPAuthenticator.use_ssl = <%= @ldap_use_ssl ? 'True' : 'False' %>
c.LDAPAuthenticator.tls_strategy = '<%= @ldap_tls_strategy %>'
# Restrict access to a specific LDAP group
c.LDAPAuthenticator.allowed_groups = <%= @ldap_allowed_groups.to_s %>
# Set an LDAP group as admins
c.LDAPAuthenticator.admin_groups = <%= @ldap_admin_groups.to_s %>
# List LDAP users as admins
c.LDAPAuthenticator.admin_users = <%= @ldap_admin_users.to_s %>
# Lookup settings
c.LDAPAuthenticator.lookup_dn = True
c.LDAPAuthenticator.lookup_dn_search_filter = '<%= @ldap_user_search_filter %>'
c.LDAPAuthenticator.lookup_dn_search_user = '<%= @ldap_bind_user %>'
c.LDAPAuthenticator.lookup_dn_search_password = '<%= @ldap_bind_pass %>'
c.LDAPAuthenticator.user_search_base = '<%= @ldap_user_search_base %>'
c.LDAPAuthenticator.user_attribute = '<%= @ldap_user_attribute %>'
c.LDAPAuthenticator.lookup_dn_user_dn_attribute = '<%= @ldap_user_dn_attribute %>'
c.LDAPAuthenticator.group_search_filter = '<%= @ldap_group_search_filter %>'