Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
Jupyter
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Docker
Deployments
Jupyter
Commits
bfa7fc59
Verified
Commit
bfa7fc59
authored
2 years ago
by
Olivier Benz
Browse files
Options
Downloads
Patches
Plain Diff
Add option for custom subdomain
- Pass environment variables to jupyterhub
parent
8874dc7e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+4
-3
4 additions, 3 deletions
README.md
sample..env
+3
-0
3 additions, 0 deletions
sample..env
sample.config/jupyterhub_config.py
+3
-2
3 additions, 2 deletions
sample.config/jupyterhub_config.py
sample.docker-compose.yml
+4
-2
4 additions, 2 deletions
sample.docker-compose.yml
with
14 additions
and
7 deletions
README.md
+
4
−
3
View file @
bfa7fc59
...
...
@@ -30,7 +30,8 @@ in docker containers using docker compose.
easy-to-maintain LaTeX distribution based on TeX Live.
*
**Zsh**
: A shell designed for interactive use, although it is also a
powerful scripting language.
*
Pre-configured to run at a
**subdomain**
(jupyter) of your
**own domain**
.
*
Pre-configured to run at a
**subdomain**
(default: jupyter) of your
**own domain**
.
*
Use of environment files for variable substitution in the Compose file.
The following extensions are pre-installed for
**code-server**
:
...
...
@@ -95,7 +96,7 @@ The following extensions are pre-installed for **code-server**:
The following is required:
*
A DNS record for
**subdomain**
jupyter pointing to this host.
*
A DNS record for
**subdomain**
(default:
jupyter
)
pointing to this host.
## Install
...
...
@@ -134,7 +135,7 @@ This project depends on the following
Redirect URL: https://jupyter.mydomain.com/hub/oauth_callback
```
→ Replace
`mydomain.com`
with your
**own domain**
that serves the
**subdomain
s
**
.
**subdomain**
.
*
Tick "Trusted"
*
Scopes:
*
Tick "api"
...
...
This diff is collapsed.
Click to expand it.
sample..env
+
3
−
0
View file @
bfa7fc59
...
...
@@ -12,6 +12,9 @@ JH_VERSION=3.1
## Domain
JH_DOMAIN=mydomain.com
## Subdomain (default: jupyter)
JH_SUBDOMAIN=
## Traefik certificates resolver name
JH_CERTRESOLVER_NAME=mydomain-com
...
...
This diff is collapsed.
Click to expand it.
sample.config/jupyterhub_config.py
+
3
−
2
View file @
bfa7fc59
...
...
@@ -64,8 +64,9 @@ import sys
# Default: 'jupyterhub.auth.PAMAuthenticator'
from
oauthenticator.gitlab
import
GitLabOAuthenticator
c
.
JupyterHub
.
authenticator_class
=
GitLabOAuthenticator
c
.
GitLabOAuthenticator
.
oauth_callback_url
=
'
https://jupyter.{domain}/hub/oauth_callback
'
.
format
(
domain
=
os
.
environ
[
'
JH_DOMAIN
'
]
c
.
GitLabOAuthenticator
.
oauth_callback_url
=
'
https://{subdomain}.{domain}/hub/oauth_callback
'
.
format
(
subdomain
=
os
.
environ
[
'
JUPYTERHUB_SUBDOMAIN
'
],
domain
=
os
.
environ
[
'
JUPYTERHUB_DOMAIN
'
]
)
## url for the database. e.g. `sqlite:///jupyterhub.sqlite`
...
...
This diff is collapsed.
Click to expand it.
sample.docker-compose.yml
+
4
−
2
View file @
bfa7fc59
...
...
@@ -17,6 +17,8 @@ services:
-
GITLAB_CLIENT_ID=${JH_GITLAB_APPLICATION_ID}
-
GITLAB_CLIENT_SECRET=${JH_GITLAB_SECRET}
-
JPY_COOKIE_SECRET=${JH_COOKIE_SECRET}
-
JUPYTERHUB_DOMAIN=${JH_DOMAIN}
-
JUPYTERHUB_SUBDOMAIN=${JH_SUBDOMAIN:-jupyter}
-
POSTGRES_HOST=jupyterhub-postgres
env_file
:
-
db.env
...
...
@@ -27,10 +29,10 @@ services:
-
traefik.docker.network=webproxy
-
traefik.http.services.jupyterhub.loadbalancer.server.port=8000
-
traefik.http.routers.jupyterhub.entrypoints=web
-
traefik.http.routers.jupyterhub.rule=Host(`
jupyter
.${JH_DOMAIN}`)
-
traefik.http.routers.jupyterhub.rule=Host(`
${JH_SUBDOMAIN}
.${JH_DOMAIN}`)
-
traefik.http.routers.jupyterhub.middlewares=http2https@file
-
traefik.http.routers.jupyterhub-sec.entrypoints=websecure
-
traefik.http.routers.jupyterhub-sec.rule=Host(`
jupyter
.${JH_DOMAIN}`)
-
traefik.http.routers.jupyterhub-sec.rule=Host(`
${JH_SUBDOMAIN}
.${JH_DOMAIN}`)
-
traefik.http.routers.jupyterhub-sec.tls.certresolver=${JH_CERTRESOLVER_NAME}
-
traefik.http.routers.jupyterhub-sec.middlewares=sts@file
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment