Skip to content
This repository has been archived by the owner on Mar 17, 2023. It is now read-only.

Commit

Permalink
Add config option to define behaviour when no groups are set
Browse files Browse the repository at this point in the history
  • Loading branch information
vpavlin authored and Chad Roberts committed Aug 12, 2021
1 parent 1366504 commit 337eb6f
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions .jupyter/jupyterhub_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
c.KubeSpawner.start_timeout = 60 * 10 #Images are big, take time to pull, make it 10 mins for now because of storage issue

import os
import sys

import json
import requests
import distutils

#c.JupyterHub.log_level = 'DEBUG'
#c.Spawner.debug = True
Expand Down Expand Up @@ -101,11 +98,12 @@ def set_culler_secret():

c.OpenShiftOAuthenticator.client_secret = client_secret

allowed_groups = os.environ.get('JUPYTERHUB_ALLOWED_GROUPS')
admin_groups = os.environ.get('JUPYTERHUB_ADMIN_GROUPS')
if allowed_groups:
groups_default_denied = bool(distutils.util.strtobool(os.environ.get('JUPYTERHUB_GROUPS_DEFAULT_DENIED', "false")))
allowed_groups = os.environ.get('JUPYTERHUB_ALLOWED_GROUPS', "")
admin_groups = os.environ.get('JUPYTERHUB_ADMIN_GROUPS', "")
if allowed_groups or groups_default_denied:
c.OpenShiftOAuthenticator.allowed_groups = set(allowed_groups.split(','))
if admin_groups:
if admin_groups or groups_default_denied:
c.OpenShiftOAuthenticator.admin_groups = set(admin_groups.split(','))

# Work out hostname for the exposed route of the JupyterHub server. This
Expand Down

0 comments on commit 337eb6f

Please sign in to comment.