---
proxy:
  service:
    type: NodePort

ingress:
  enabled: true
  annotations:
    kubernetes.io/ingress.class: "nginx"
    kubernetes.io/tls-acme: "true"
  hosts:
    - eosc.zcu.cz
  tls:
    - hosts:
        - eosc.zcu.cz
      secretName: acme-tls-central

singleuser:
  # storage:
  #   capacity: 20Gi
  #   dynamic:
  #     pvcNameTemplate: claim-{userid}{servername}
  #     volumeNameTemplate: vol-{userid}{servername}
  #     storageAccessModes: ["ReadWriteMany"]
  lifecycleHooks:
    postStart:
      exec: { "command": ["/bin/sh", "-c", "mkdir -p /home/jovyan/.notebookCheckpoints"] }
  memory:
    limit: 6G
    guarantee: 128M
  cpu:
    limit: 2
    guarantee: .02
  defaultUrl: "/lab"
  image:
    name: elyra/nb2kg
    tag: dev
  extraEnv:
    # KERNEL_USERNAME: jovyan
    KG_AUTH_TOKEN: "{{ gateways_token['cesnet-mcc'] }}"
    KG_URL: "https://gateway-cesnet.eosc.zcu.cz"
    # KG_HTTP_USER: jovyan
    KG_REQUEST_TIMEOUT: 60

hub:
  # services:
  #   status:
  #     url: "http://status-web/"
  #     admin: true
  image:
    name: valtri/hub
    tag: "sha-0800b46" # jupyter-3.x
  config:
    Authenticator:
      enable_auth_state: true
      admin_users:
        - 529a87e5ce04cd5ddd7161734d02df0e2199a11452430803e714cb1309cc3907@egi.eu
        - 025166931789a0f57793a6092726c2ad89387a4cc167e7c63c5d85fc91021d18@egi.eu
        - 7ce47695f1e7fc91a1156e672f4a47576559938cdbe840355e2429e3a05b4ff8@egi.eu
        # fdvorak2 @ aai.egi.eu
        - 52cc7599bd1553c9d63e34e4c90b7e84d44967490c28bb4c53fe97b0c881d677@egi.eu
        # fdvorak2 @ aai-dev.egi.eu
        - c481e0a85e1ae0a5a1480a63e62295ca2f9ac652244947995bd4a0210fbcb77c@egi.eu
        # jhradil3 @ aai-dev.egi.eu
        - 240c0594fe34ac26cffd82fd0ad85f29d9ad9dfbb46febb05ed42db0bff594d1@egi.eu
      # keep in sync with:
      # - cesnet/playbooks/templates/binder.yaml
      # - documentation/content/en/users/dev-env/notebooks/_index.md
      allowed_groups:
        - urn:mace:egi.eu:group:vo.access.egi.eu:role=member#aai.egi.eu
        - urn:mace:egi.eu:group:vo.notebooks.egi.eu:role=member#aai.egi.eu
        - urn:mace:egi.eu:www.egi.eu:fedcloud-users:member@egi.eu
        - urn:mace:egi.eu:www.egi.eu:techsolutions:member@egi.eu
          # changed 2022-10
        - urn:mace:egi.eu:group:fedcloud-users#sso.egi.eu
        - urn:mace:egi.eu:group:supplier-notebooks#sso.egi.eu
        - urn:mace:egi.eu:group:techsolutions#sso.egi.eu
        - urn:mace:egi.eu:group:notebooks-support#sso.egi.eu
      auto_login: true
      claim_groups_key: "eduperson_entitlement"
    EGICheckinAuthenticator:
      checkin_host: "{{ secret['checkin_host'] }}"
      authorize_url: "https://{{ secret['checkin_host'] }}/auth/realms/egi/protocol/openid-connect/auth"
      token_url: "https://{{ secret['checkin_host'] }}/auth/realms/egi/protocol/openid-connect/token"
      userdata_url: "https://{{ secret['checkin_host'] }}/auth/realms/egi/protocol/openid-connect/userinfo"
      client_id: "{{ secret['client_id'] }}"
      client_secret: "{{ secret['client_secret'] }}"
      oauth_callback_url: "https://eosc.zcu.cz/hub/oauth_callback"
      scope: ["openid", "profile", "email", "offline_access", "eduperson_scoped_affiliation", "eduperson_entitlement"]
      username_key: "preferred_username" # 'sub' too long for persistent volumes
    JupyterHub:
      admin_access: true
      authenticate_prometheus: false
      authenticator_class: egi_notebooks_hub.egiauthenticator.EGICheckinAuthenticator
      # spawner_class
      # c.B2DropSpawner.args = ["--FileCheckpoints.checkpoint_dir='/home/jovyan/.notebookCheckpoints'"]
  extraConfig:
    nb2kg: |-
      config = '/etc/jupyter/jupyter_notebook_config.py'
      c.Spawner.cmd = ['jupyter-labhub']
  templatePaths:
    - /egi-notebooks-hub/templates
