diff --git a/docs/topic/index.md b/docs/topic/index.md index 9b9e8e8..7ec4b88 100644 --- a/docs/topic/index.md +++ b/docs/topic/index.md @@ -15,5 +15,4 @@ tljh-config authenticator-configuration escape-hatch idle-culler -jupyterhub-configurator ``` diff --git a/docs/topic/jupyterhub-configurator.md b/docs/topic/jupyterhub-configurator.md deleted file mode 100644 index 9adf524..0000000 --- a/docs/topic/jupyterhub-configurator.md +++ /dev/null @@ -1,21 +0,0 @@ -(topic-jupyterhub-configurator)= - -# JupyterHub Configurator - -The [JupyterHub configurator](https://github.com/yuvipanda/jupyterhub-configurator) allows admins to change a subset of hub settings via a GUI. - -## Enabling the configurator - -Because the configurator is under continue development and it might change over time, it is disabled by default in TLJH. -If you want to experiment with it, it can be enabled using `tljh-config`: - -```bash -sudo tljh-config set services.configurator.enabled True -sudo tljh-config reload -``` - -## Accessing the Configurator - -After enabling the configurator using `tljh-config`, the service will only be available to hub admins, from within the control panel. -The configurator can be accessed from under `Services` in the top navigation bar. It will ask to authenticate, so it knows the user is an admin. -Once done, the configurator interface will be available. diff --git a/tljh/configurer.py b/tljh/configurer.py index 1fb60f6..bf15354 100644 --- a/tljh/configurer.py +++ b/tljh/configurer.py @@ -64,7 +64,6 @@ default = { "max_age": 0, "remove_named_servers": False, }, - "configurator": {"enabled": False}, }, } @@ -277,33 +276,11 @@ def set_cull_idle_service(config): return cull_service -def set_configurator(config): - """ - Set the JupyterHub Configurator service - """ - HERE = os.path.abspath(os.path.dirname(__file__)) - configurator_cmd = [ - sys.executable, - "-m", - "jupyterhub_configurator.app", - f"--Configurator.config_file={HERE}/jupyterhub_configurator_config.py", - ] - configurator_service = { - "name": "configurator", - "url": "http://127.0.0.1:10101", - "command": configurator_cmd, - } - - return configurator_service - - def update_services(c, config): c.JupyterHub.services = [] if config["services"]["cull"]["enabled"]: c.JupyterHub.services.append(set_cull_idle_service(config)) - if config["services"]["configurator"]["enabled"]: - c.JupyterHub.services.append(set_configurator(config)) def _merge_dictionaries(a, b, path=None, update=True): diff --git a/tljh/jupyterhub_configurator_config.py b/tljh/jupyterhub_configurator_config.py deleted file mode 100644 index a6aace4..0000000 --- a/tljh/jupyterhub_configurator_config.py +++ /dev/null @@ -1 +0,0 @@ -c.Configurator.selected_fields = ["tljh.default_interface"] diff --git a/tljh/requirements-hub-env.txt b/tljh/requirements-hub-env.txt index b4e2569..81d694a 100644 --- a/tljh/requirements-hub-env.txt +++ b/tljh/requirements-hub-env.txt @@ -16,7 +16,6 @@ jupyterhub-ldapauthenticator>=1.3.2,<2 jupyterhub-tmpauthenticator>=1.0.0,<2 oauthenticator>=15.1.0,<16 jupyterhub-idle-culler>=1.2.1,<2 -git+https://github.com/yuvipanda/jupyterhub-configurator@996405d2a7017153d5abe592b8028fed7a1801bb # pycurl is installed to improve reliability and performance for when JupyterHub # makes web requests. JupyterHub will use tornado's CurlAsyncHTTPClient when diff --git a/tljh/user_creating_spawner.py b/tljh/user_creating_spawner.py index aa455e3..a08f24c 100644 --- a/tljh/user_creating_spawner.py +++ b/tljh/user_creating_spawner.py @@ -1,12 +1,11 @@ -from jupyterhub_configurator.mixins import ConfiguratorSpawnerMixin from systemdspawner import SystemdSpawner from traitlets import Dict, List, Unicode -from tljh import configurer, user +from tljh import user from tljh.normalize import generate_system_username -class CustomSpawner(SystemdSpawner): +class UserCreatingSpawner(SystemdSpawner): """ SystemdSpawner with user creation on spawn. @@ -35,16 +34,3 @@ class CustomSpawner(SystemdSpawner): if self.user.name in users: user.ensure_user_group(system_username, group) return super().start() - - -cfg = configurer.load_config() -# Use the jupyterhub-configurator mixin only if configurator is enabled -# otherwise, any bugs in the configurator backend will stop new user spawns! -if cfg["services"]["configurator"]["enabled"]: - # Dynamically create the Spawner class using `type`(https://docs.python.org/3/library/functions.html?#type), - # based on whether or not it should inherit from ConfiguratorSpawnerMixin - UserCreatingSpawner = type( - "UserCreatingSpawner", (ConfiguratorSpawnerMixin, CustomSpawner), {} - ) -else: - UserCreatingSpawner = type("UserCreatingSpawner", (CustomSpawner,), {})