[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot]
2023-05-18 14:08:34 +00:00
parent 8d7b9b5f92
commit eeb76c0894

View File

@@ -82,7 +82,7 @@ In this section we'll use the `tljh-config` tool to configure your JupyterHub's
For more information on `tljh-config`, see [](/topic/tljh-config). For more information on `tljh-config`, see [](/topic/tljh-config).
:::{important} :::{important}
By default, the following allows *anyone* with a Google account to login. By default, the following allows _anyone_ with a Google account to login.
You can set specific allowed users and admins using [](#tljh-set-user-lists). You can set specific allowed users and admins using [](#tljh-set-user-lists).
::: :::
@@ -124,7 +124,7 @@ You can set specific allowed users and admins using [](#tljh-set-user-lists).
Administrative and regular users of your TLJH can also be easily managed with Google Groups. Administrative and regular users of your TLJH can also be easily managed with Google Groups.
This requires a service account and a Workspace admin account that can be impersonated by the This requires a service account and a Workspace admin account that can be impersonated by the
service account to read groups in your domain. You may need to contact your Google Workspace service account to read groups in your domain. You may need to contact your Google Workspace
administrator for help performing these steps. administrator for help performing these steps.
1. [Create a service account](https://cloud.google.com/iam/docs/service-accounts-create). 1. [Create a service account](https://cloud.google.com/iam/docs/service-accounts-create).
@@ -150,16 +150,16 @@ administrator for help performing these steps.
``` ```
1. Install the extra requirements within the hub environment. 1. Install the extra requirements within the hub environment.
``` ```
source /opt/tljh/hub/bin/activate source /opt/tljh/hub/bin/activate
pip3 install oauthenticator[googlegroups] pip3 install oauthenticator[googlegroups]
deactivate deactivate
``` ```
1. Create a configuration directory `jupyterhub_config.d` within `/opt/tljh/config/`. 1. Create a configuration directory `jupyterhub_config.d` within `/opt/tljh/config/`.
Any `.py` files within this directory will be sourced for configuration. Any `.py` files within this directory will be sourced for configuration.
``` ```
sudo mkdir /opt/tljh/config/jupyterhub_config.d sudo mkdir /opt/tljh/config/jupyterhub_config.d
``` ```
@@ -170,9 +170,9 @@ administrator for help performing these steps.
from oauthenticator.google import GoogleOAuthenticator from oauthenticator.google import GoogleOAuthenticator
c.JupyterHub.authenticator_class = GoogleOAuthenticator c.JupyterHub.authenticator_class = GoogleOAuthenticator
c.GoogleOAuthenticator.google_service_account_keys = {'<my-domain.com>': '</path/to/your/service_account_key.json>'} c.GoogleOAuthenticator.google_service_account_keys = {'<my-domain.com>': '</path/to/your/service_account_key.json>'}
c.GoogleOAuthenticator.gsuite_administrator = {'<my-domain.com>': '<my-gsuite-admin>'} c.GoogleOAuthenticator.gsuite_administrator = {'<my-domain.com>': '<my-gsuite-admin>'}
c.GoogleOAuthenticator.allowed_google_groups = {'<my-domain.com>': ['example-group', 'another-example-group']} c.GoogleOAuthenticator.allowed_google_groups = {'<my-domain.com>': ['example-group', 'another-example-group']}
c.GoogleOAuthenticator.admin_google_groups = {'<my-domain.com>': ['example-admin-group', 'another-example-admin-group']} c.GoogleOAuthenticator.admin_google_groups = {'<my-domain.com>': ['example-admin-group', 'another-example-admin-group']}
c.GoogleOAuthenticator.client_id = '<my-tljh-client-id>' c.GoogleOAuthenticator.client_id = '<my-tljh-client-id>'
c.GoogleOAuthenticator.client_secret = '<my-tljh-client-secret>' c.GoogleOAuthenticator.client_secret = '<my-tljh-client-secret>'
@@ -181,10 +181,9 @@ administrator for help performing these steps.
c.GoogleOAuthenticator.oauth_callback_url = 'http(s)://<my-tljh-ip-address>/hub/oauth_callback' c.GoogleOAuthenticator.oauth_callback_url = 'http(s)://<my-tljh-ip-address>/hub/oauth_callback'
``` ```
See the [Google OAuthenticator documentation](https://oauthenticator.readthedocs.io/en/latest/reference/api/gen/oauthenticator.google.html) See the [Google OAuthenticator documentation](https://oauthenticator.readthedocs.io/en/latest/reference/api/gen/oauthenticator.google.html)
for more information on these and other configuration options. for more information on these and other configuration options.
1. Reload your configuration for the changes to take effect: 1. Reload your configuration for the changes to take effect:
``` ```
sudo tljh-config reload sudo tljh-config reload