2023-05-03 09:19:31 +00:00
|
|
|
hub:
|
|
|
|
config:
|
|
|
|
Authenticator:
|
|
|
|
auto_login: true
|
|
|
|
enable_auth_state: true
|
|
|
|
JupyterHub:
|
|
|
|
tornado_settings:
|
|
|
|
headers: { 'Content-Security-Policy': "frame-ancestors *;" }
|
2023-09-28 06:36:09 +00:00
|
|
|
db:
|
|
|
|
pvc:
|
|
|
|
storageClassName: csi-sc-cinderplugin
|
2023-05-03 09:19:31 +00:00
|
|
|
extraConfig:
|
|
|
|
oauthCode: |
|
2024-01-11 08:27:05 +00:00
|
|
|
c.JupyterHub.authenticator_class = "generic-oauth"
|
2024-01-10 12:45:44 +00:00
|
|
|
c.GenericOAuthenticator.client_id = os.environ['NEXTCLOUD_CLIENT_ID']
|
|
|
|
c.GenericOAuthenticator.client_secret = os.environ['NEXTCLOUD_CLIENT_ID']
|
|
|
|
c.GenericOAuthenticator.login_service = 'Sunet Drive'
|
2024-01-11 08:27:05 +00:00
|
|
|
c.GenericOAuthenticator.username_claim = lambda r: r.get('ocs', {}).get('data', {}).get('id')
|
2024-01-11 09:07:32 +00:00
|
|
|
c.GenericOAuthenticator.username_key = lambda r: r.get('ocs', {}).get('data', {}).get('id')
|
2024-01-11 08:27:05 +00:00
|
|
|
|
2024-01-10 12:45:44 +00:00
|
|
|
c.GenericOAuthenticator.authorize_url = 'https://' + os.environ['NEXTCLOUD_HOST'] + '/index.php/apps/oauth2/authorize'
|
|
|
|
c.GenericOAuthenticator.token_url = 'https://' + os.environ['NEXTCLOUD_HOST'] + '/index.php/apps/oauth2/api/v1/token'
|
2024-01-11 08:27:05 +00:00
|
|
|
c.GenericOAuthenticator.userdata_url = 'https://' + os.environ['NEXTCLOUD_HOST'] + '/ocs/v2.php/cloud/user?format=json'
|
|
|
|
# c.GenericOAuthenticator.oauth_callback_url = 'https://' + os.environ['JUPYTER_HOST'] + '/hub/oauth_callback'
|
2024-01-10 13:55:16 +00:00
|
|
|
|
2023-05-03 09:19:31 +00:00
|
|
|
extraEnv:
|
|
|
|
NEXTCLOUD_HOST: sunet.drive.test.sunet.se
|
|
|
|
JUPYTER_HOST: jupyter.drive.test.sunet.se
|
|
|
|
NEXTCLOUD_CLIENT_ID:
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: nextcloud-oauth-secrets
|
|
|
|
key: client-id
|
|
|
|
NEXTCLOUD_CLIENT_SECRET:
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: nextcloud-oauth-secrets
|
|
|
|
key: client-secret
|
2024-01-11 08:27:05 +00:00
|
|
|
networkPolicy:
|
|
|
|
enabled: false
|
2024-01-10 12:45:44 +00:00
|
|
|
|
2023-05-03 09:19:31 +00:00
|
|
|
singleuser:
|
|
|
|
image:
|
|
|
|
name: docker.sunet.se/drive/jupyter-custom
|
|
|
|
tag: 2023-02-28-2
|
|
|
|
storage:
|
|
|
|
type: none
|
|
|
|
extraEnv:
|
|
|
|
JUPYTER_ENABLE_LAB: "yes"
|
|
|
|
extraFiles:
|
|
|
|
jupyter_notebook_config:
|
|
|
|
mountPath: /home/jovyan/.jupyter/jupyter_server_config.py
|
|
|
|
stringData: |
|
|
|
|
import os
|
|
|
|
c = get_config()
|
|
|
|
c.NotebookApp.allow_origin = '*'
|
|
|
|
c.NotebookApp.tornado_settings = {
|
|
|
|
'headers': { 'Content-Security-Policy': "frame-ancestors *;" }
|
|
|
|
}
|
|
|
|
os.system('/usr/local/bin/nc-sync')
|
|
|
|
mode: 0644
|