Compare commits

...

591 Commits
3.1.0 ... 4.1.0

Author SHA1 Message Date
Min RK
984a67932f Bump to 4.1.0 2024-03-20 13:38:27 +01:00
Min RK
133dda26cc sync publish workflow with main 2024-03-20 13:26:14 +01:00
Min RK
e797e31ef9 fix check links for unpublished advisories 2024-03-20 13:23:54 +01:00
Min RK
e2798a088f Merge pull request from GHSA-7r3h-4ph8-w38g
4.1.0
2024-03-20 13:19:29 +01:00
Min RK
3fa60e6849 4.1.0 2024-03-19 13:33:35 +01:00
Min RK
aeeabbee07 Merge pull request #4735 from meeseeksmachine/auto-backport-of-pr-4628-on-4.x
Backport PR #4628 on branch 4.x (Include LDAP groups in local spawner gids)
2024-03-19 12:48:49 +01:00
Min RK
999c58f584 Backport PR #4628: Include LDAP groups in local spawner gids 2024-03-19 09:34:16 +00:00
Min RK
513c61321f Merge pull request #4734 from meeseeksmachine/auto-backport-of-pr-4733-on-4.x
Backport PR #4733 on branch 4.x (Catch ValueError while waiting for server to be reachable)
2024-03-19 10:03:27 +01:00
Min RK
715c8599b3 Backport PR #4733: Catch ValueError while waiting for server to be reachable 2024-03-19 08:38:04 +00:00
Min RK
63e118f144 Merge pull request #4714 from meeseeksmachine/auto-backport-of-pr-4561-on-4.x
Backport PR #4561 on branch 4.x (Improve debugging when waiting for servers)
2024-02-29 15:13:16 +01:00
Erik Sundell
05e569cb42 Backport PR #4561: Improve debugging when waiting for servers 2024-02-28 13:49:35 +00:00
Min RK
d4c7d9748a Merge pull request #4707 from meeseeksmachine/auto-backport-of-pr-4563-on-4.x
Backport PR #4563 on branch 4.x (only set 'domain' field on session-id cookie)
2024-02-26 11:29:43 +01:00
Min RK
d8f404d25e Backport PR #4563: only set 'domain' field on session-id cookie 2024-02-13 14:08:01 +00:00
Min RK
4492b508a1 Merge pull request #4705 from minrk/backport-4679
Backport PR #4679 on branch 4.x (Unescape jinja username)
2024-02-12 15:41:50 +01:00
Min RK
6221f27c19 add missing init for jupyterhub.tests.browser 2024-02-12 14:24:11 +01:00
Min RK
77ae4401a1 Backport PR #4679 on branch 4.x (Unescape jinja username) 2024-02-12 14:03:17 +01:00
Min RK
df7ae422f6 Merge pull request #4687 from meeseeksmachine/auto-backport-of-pr-4560-on-4.x
Backport PR #4560 on branch 4.x (singleuser extension: persist token from ?token=... url in cookie)
2024-02-06 10:39:10 +01:00
Min RK
a0dd715bf7 Merge pull request #4689 from meeseeksmachine/auto-backport-of-pr-4542-on-4.x
Backport PR #4542 on branch 4.x (Fix include_stopped_servers in paginated next_url)
2024-02-06 10:16:59 +01:00
Min RK
bfccb9af73 Merge pull request #4698 from minrk/backport-quay
Backport quay.io publishing
2024-02-06 10:01:00 +01:00
Min RK
fd14165da3 Merge pull request #4692 from meeseeksmachine/auto-backport-of-pr-4677-on-4.x
Backport PR #4677 on branch 4.x (Improve validation, docs for token.expires_in)
2024-02-06 10:00:49 +01:00
Min RK
5778d8fa48 Merge pull request #4696 from minrk/backport-4632
Backport PR #4632: simplify, avoid errors in parsing accept headers
2024-02-06 10:00:40 +01:00
Min RK
cd51660eff IS_JUPYVERSE hasn't been backported
make it always False
2024-02-06 09:18:06 +01:00
Erik Sundell
6af20e79cf Backport PR #4560: singleuser extension: persist token from ?token=... url in cookie 2024-02-06 09:18:06 +01:00
Min RK
262557579f Merge pull request #4697 from minrk/backport-4630
Backport PR #4630: avoid setting unused oauth state cookies on API requests
2024-02-06 09:14:06 +01:00
Min RK
77a6d75d70 Bump to 4.1.0.dev 2024-02-06 09:13:05 +01:00
Min RK
6f3be4b697 Backport PR #4641: Publish to Docker Hub alongside Quay.io
Publish to Docker Hub alongside Quay.io

(cherry picked from commit 7613ba170f)
2024-02-06 09:09:14 +01:00
Min RK
d4bfbdfde2 Backport PR #4612: Move from dockerhub to quay.io
Move from dockerhub to quay.io

(cherry picked from commit 60802b2b76)
2024-02-06 09:08:07 +01:00
Min RK
10f507e83b Backport PR #4632: simplify, avoid errors in parsing accept headers 2024-02-06 09:02:39 +01:00
Min RK
0bbda9a45e Merge pull request #4691 from meeseeksmachine/auto-backport-of-pr-4570-on-4.x
Backport PR #4570 on branch 4.x (fix mutation of frozenset in scope intersection)
2024-02-06 09:00:38 +01:00
Min RK
c8bb3a3679 Merge pull request #4690 from meeseeksmachine/auto-backport-of-pr-4562-on-4.x
Backport PR #4562 on branch 4.x (Use `user.stop` to cleanup spawners that stopped while Hub was down)
2024-02-06 08:59:21 +01:00
Min RK
1a65858968 Merge pull request #4688 from meeseeksmachine/auto-backport-of-pr-4651-on-4.x
Backport PR #4651 on branch 4.x (avoid attempting to patch removed IPythonHandler with notebook v7)
2024-02-06 08:59:08 +01:00
Min RK
2aa28e1a1f Backport PR #4630: avoid setting unused oauth state cookies on API requests 2024-02-06 08:51:25 +01:00
Min RK
dbd90b1bfe Merge pull request #4695 from minrk/backport-pr-4617
Backport PR #4617: try to improve reliability of test_external_proxy
2024-02-06 08:49:34 +01:00
Min RK
7a3ff4028a Merge pull request #4694 from meeseeksmachine/auto-backport-of-pr-4618-on-4.x
Backport PR #4618 on branch 4.x (browser test: wait for token request to finish before reloading)
2024-02-06 08:42:06 +01:00
Erik Sundell
44518d00c2 Backport PR #4617: try to improve reliability of test_external_proxy 2024-02-06 08:35:57 +01:00
Erik Sundell
051848d1ef Backport PR #4618: browser test: wait for token request to finish before reloading 2024-02-06 07:24:50 +00:00
Erik Sundell
5e57e0141a Backport PR #4677: Improve validation, docs for token.expires_in 2024-02-05 14:30:06 +00:00
Min RK
6cfa789d6a Backport PR #4570: fix mutation of frozenset in scope intersection 2024-02-05 14:28:09 +00:00
Erik Sundell
55c3211ec2 Backport PR #4562: Use user.stop to cleanup spawners that stopped while Hub was down 2024-02-05 14:27:04 +00:00
Min RK
603ba309f5 Backport PR #4542: Fix include_stopped_servers in paginated next_url 2024-02-05 14:26:15 +00:00
Simon Li
6337b695bb Backport PR #4651: avoid attempting to patch removed IPythonHandler with notebook v7 2024-02-05 14:25:25 +00:00
Min RK
ee9e509ab5 Merge pull request #4685 from minrk/4.x
preparing 4.x branch
2024-01-31 11:01:51 +01:00
Min RK
f0e049226d BIDS Teaching video appears to be gone 2024-01-31 09:18:00 +01:00
Min RK
7ffb0b0719 skip linkcheck for linux.die.net
links work, but site seems to block linkcheck requests from CI with 403
2024-01-31 09:17:10 +01:00
YuviPanda
825e8aacea Remove links to okpy from docs
These were removed in
https://github.com/jupyterhub/oauthenticator/pull/691,
and now the link checker is not happy.
2024-01-31 09:16:24 +01:00
Min RK
55213f6f53 run pre-commit
black adds some blank lines
2024-01-30 14:32:25 +01:00
Min RK
32dfe70a01 update pre-commit 2024-01-30 14:30:51 +01:00
Min RK
9db326fb7a pin some test dependencies 2024-01-30 14:30:14 +01:00
Min RK
0e7689f277 Bump to 4.0.2 2023-08-10 11:27:56 +02:00
Min RK
b677655572 Merge pull request #4535 from meeseeksmachine/auto-backport-of-pr-4534-on-4.x
Backport PR #4534 on branch 4.x (Changelog for 4.0.2)
2023-08-10 11:26:50 +02:00
Min RK
9adc871448 Backport PR #4534: Changelog for 4.0.2 2023-08-10 09:19:16 +00:00
Min RK
29d6540333 Merge pull request #4533 from meeseeksmachine/auto-backport-of-pr-4489-on-4.x
Backport PR #4489 on branch 4.x (improve permission-denied errors for various cases)
2023-08-10 11:01:08 +02:00
Erik Sundell
5a4949faa5 Backport PR #4489: improve permission-denied errors for various cases 2023-08-10 08:13:44 +00:00
Min RK
f2ab23b376 Merge pull request #4531 from meeseeksmachine/auto-backport-of-pr-4475-on-4.x
Backport PR #4475 on branch 4.x (Allow setting custom log_function in tornado_settings in SingleUserServer)
2023-08-09 15:24:45 +02:00
Min RK
b61582420a Merge pull request #4532 from meeseeksmachine/auto-backport-of-pr-4522-on-4.x
Backport PR #4522 on branch 4.x (document how to use notebook v7 with jupyterhub)
2023-08-09 15:24:34 +02:00
Simon Li
f11ae34b73 Backport PR #4522: document how to use notebook v7 with jupyterhub 2023-08-09 11:12:50 +00:00
Min RK
e91ab50d1b Backport PR #4475: Allow setting custom log_function in tornado_settings in SingleUserServer 2023-08-09 11:03:55 +00:00
Min RK
4cb3a45ce4 Merge pull request #4529 from meeseeksmachine/auto-backport-of-pr-4523-on-4.x
Backport PR #4523 on branch 4.x (doc: update notebook config URL)
2023-08-09 12:40:11 +02:00
Min RK
4e8f9b4334 Merge pull request #4528 from meeseeksmachine/auto-backport-of-pr-4503-on-4.x
Backport PR #4503 on branch 4.x (set root_dir when using singleuser extension)
2023-08-09 12:31:33 +02:00
Min RK
6131f2dbaa Merge pull request #4530 from meeseeksmachine/auto-backport-of-pr-4491-on-4.x
Backport PR #4491 on branch 4.x (avoid counting failed requests to not-running servers as 'activity')
2023-08-09 12:31:07 +02:00
Min RK
a9dc588454 can't use f"{name=}" in Python 3.7 2023-08-09 11:56:03 +02:00
Erik Sundell
537b2eaff6 Backport PR #4491: avoid counting failed requests to not-running servers as 'activity' 2023-08-09 09:53:20 +00:00
Simon Li
7f8a981aed Backport PR #4523: doc: update notebook config URL 2023-08-09 09:52:41 +00:00
Erik Sundell
bc86e4c8f5 Backport PR #4503: set root_dir when using singleuser extension 2023-08-09 09:50:48 +00:00
Min RK
20f75c0018 Bump to 4.1.0.dev 2023-06-12 15:29:13 +02:00
Min RK
689dc5ba24 Bump to 4.0.1 2023-06-08 10:38:00 +02:00
Min RK
d42a7261a4 Merge pull request #4472 from minrk/401-cl
changelog for 4.0.1
2023-06-08 10:37:12 +02:00
Min RK
bcbf136de2 set date for 4.0.1
Co-authored-by: Erik Sundell <erik.i.sundell@gmail.com>
2023-06-08 09:58:21 +02:00
Min RK
55e9a0f5b5 changelog for 4.0.1 2023-06-07 15:41:22 +02:00
Min RK
d64d916abc Merge pull request #4470 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2023-06-06 09:05:29 +02:00
pre-commit-ci[bot]
da668b5e9a [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.3.2 → v3.4.0](https://github.com/asottile/pyupgrade/compare/v3.3.2...v3.4.0)
2023-06-06 04:12:25 +00:00
Erik Sundell
d54442ecbf Merge pull request #4467 from minrk/main
Abort informatively on unrecognized CLI options
2023-06-05 10:30:31 +02:00
Min RK
c930d6bf6a Abort informatively on unrecognized CLI options
rather than ignoring them, leading to unexpected behavior
2023-06-02 13:26:31 +02:00
Min RK
2ce263d45f Merge pull request #4463 from minrk/prefer-runtime-token
Reorder token request docs
2023-06-02 11:48:23 +02:00
Min RK
68f81fdc30 Merge pull request #4457 from diocas/fix_4174
Delete server button on admin page
2023-06-02 11:46:24 +02:00
Min RK
e7ab18a720 Merge pull request #4464 from opoplawski/xsrf
Add xsrf to custom_html template context
2023-06-02 11:30:53 +02:00
Orion Poplawski
582467642c Add xsrf to custom_html template context 2023-06-01 10:00:57 -06:00
Min RK
d65e2daa15 Apply suggestions from code review
Co-authored-by: Simon Li <orpheus+devel@gmail.com>
2023-06-01 12:55:07 +02:00
Min RK
4eaa7c5eb3 Reorder token request docs
- suggest token page first
- remove caveat about JupyterHub 0.8, which can be assumed now
- undocument `jupyterhub token`
- refresh token page screenshots, and remove duplicate screenshot of the token page
- minor improvements to language in token page
2023-05-31 14:25:03 +02:00
Min RK
02de44e551 Merge pull request #4458 from tfmark/rest-api-docs-servers-as-dict
'servers' should be a dict of dicts, not a list of dicts in rest-api.yml
2023-05-25 13:37:01 +02:00
tfmark
4cdf0a65cd 'servers' should be a dict of dicts, not a list of dicts in rest-api.yml 2023-05-24 16:09:26 +01:00
pre-commit-ci[bot]
b0367c21f3 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-05-23 15:33:08 +00:00
Diogo Castro
9d68107722 Add test case for named servers
Adapt all tests
2023-05-23 17:30:23 +02:00
Diogo Castro
ad61c23873 Allow deletion of named servers 2023-05-23 17:30:23 +02:00
Min RK
c359221ef3 Merge pull request #4454 from goseind/gallery_cern
Add CERN to Gallery of JupyterHub Deployments
2023-05-22 13:45:48 +02:00
Min RK
cc94d290ab Merge pull request #4456 from manics/doc-config-ref
Config reference: link to nicer(?) API docs first
2023-05-22 13:45:33 +02:00
Min RK
da0a58cb9c Merge pull request #4451 from minrk/preserve-cli-port
preserve CLI > env priority config in jupyterhub-singleuser extension
2023-05-22 13:16:08 +02:00
Simon Li
7ddd3b0589 Config reference: link to nicer(?) API docs first
`Configuration Reference` sounds like it's the place to go to see the full list of JupyterHub config options.
However it's not very readable as it's a plain-text dump of the output of `jupyterhub --generate-config`.

This links to some of the API doc pages instead, which present most of the information in an easier to read format. Unfortunately it also includes a lot of non-traitlets documentation.
2023-05-18 16:23:21 +01:00
Domenic Gosein
ff71d09fd1 Add CERN to Gallery of JupyterHub Deployments 2023-05-16 16:57:40 +00:00
Min RK
1eb0b1b073 preserve CLI > env priority in jupyterhub-singleuser extension 2023-05-12 17:21:12 +02:00
Min RK
9ea9902c76 Merge pull request #4448 from minrk/collab-link
Fix link to collaboration accounts doc in example
2023-05-11 21:35:35 +02:00
Min RK
6494017ce2 Fix link to collaboration accounts doc in example 2023-05-11 15:08:14 +02:00
Simon Li
b0cd9eebe9 Merge pull request #4443 from manics/node18
Update jsx dependencies as much as possible
2023-05-11 00:35:43 +01:00
Min RK
c3d4885521 Merge pull request #4428 from minrk/faq-share
update sharing faq for 2023
2023-05-10 17:08:32 +02:00
Min RK
2919aaae79 Merge pull request #4444 from manics/remove-alpine
Remove Dockerfile.alpine
2023-05-08 14:24:20 +02:00
Simon Li
1986ba71c1 Remove Dockerfile.alpine 2023-05-06 12:49:02 +01:00
Simon Li
a2c39a4dbc Remove multi-arch cross-compilation debugging 2023-05-06 12:33:32 +01:00
Simon Li
1e847c8710 Reduce container build time to 20 2023-05-06 12:22:25 +01:00
Simon Li
83a8552a63 Clean-up FROM --platform leftover from debugging 2023-05-06 12:09:43 +01:00
Simon Li
f60c633320 Replace apt -q with apt-get -qq 2023-05-06 11:58:05 +01:00
Simon Li
a5c7384228 Completely seperate jupyterhub and other wheel stages 2023-05-06 11:44:42 +01:00
Simon Li
27de930978 More debugging 2023-05-06 10:40:07 +01:00
Simon Li
98e76d52bc Debugging BUILDPLATFORM TARGETPLATFORM 2023-05-06 00:51:53 +01:00
Simon Li
729aac9bd1 Why is BUILDPLATFORM linux/arm64 when buliding arm64 on a gh amd64 runner? 2023-05-06 00:38:05 +01:00
Simon Li
bc85c445ab Attempt to reduce container build time
JupyterHub is pure Python, so can be built in a native platform image and copied into the target platform image
2023-05-06 00:03:32 +01:00
Simon Li
9f708fa10c lodash per method packages are deprecated
https://lodash.com/per-method-packages
2023-05-05 23:36:53 +01:00
Simon Li
d26c7cd6fc Try increasing release container build time to 45 2023-05-05 22:54:20 +01:00
Simon Li
0174083439 regenerate yarn.lock 2023-05-05 21:04:03 +01:00
Simon Li
e6fc2aee4a Update package.json as much as possible without tests failing 2023-05-05 21:04:03 +01:00
Simon Li
47513cfbd0 npx npm-check-updates -u 2023-05-05 21:04:03 +01:00
Simon Li
4e7147a495 Update nodejs from 12 to 18 2023-05-05 21:04:00 +01:00
Min RK
5cfc0db0d5 Merge pull request #4441 from ryanlovett/support-bot-typo 2023-05-04 08:37:24 +02:00
ryanlovett
eb862e2cbb Fix "Thanks" typo. 2023-05-03 17:35:10 -07:00
Min RK
98799e4227 Merge pull request #4432 from huntdatacenter/add-research-institution
add HUNT into research institutions
2023-05-03 14:07:04 +02:00
Min RK
ea6a0e53cc Merge pull request #4440 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2023-05-02 09:14:20 +02:00
Min RK
f2b42a50c8 Merge pull request #4438 from yuvipanda/no-mo-admin
Remove old admin JS code
2023-05-02 09:13:33 +02:00
pre-commit-ci[bot]
43336f5b07 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-05-02 04:27:03 +00:00
pre-commit-ci[bot]
bf2d948366 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.3.1 → v3.3.2](https://github.com/asottile/pyupgrade/compare/v3.3.1...v3.3.2)
- [github.com/PyCQA/autoflake: v2.0.2 → v2.1.1](https://github.com/PyCQA/autoflake/compare/v2.0.2...v2.1.1)
- [github.com/pre-commit/mirrors-prettier: v3.0.0-alpha.6 → v3.0.0-alpha.9-for-vscode](https://github.com/pre-commit/mirrors-prettier/compare/v3.0.0-alpha.6...v3.0.0-alpha.9-for-vscode)
2023-05-02 04:26:36 +00:00
YuviPanda
271fd35bce Remove old admin JS code
We have a new react based admin, and this JS was just loading
and doing nothing.
2023-05-01 11:35:22 -07:00
Min RK
1d70986c25 Merge pull request #4435 from mouse1203/playwright_more
Finish migrating browser tests from selenium to playwright
2023-04-28 12:50:52 +02:00
mouse1203
ec017d1f1d Update test_browser.py
added to test_start_stop_server_on_admin_page waiting to load page
2023-04-27 15:16:29 +02:00
mouse1203
a8c804de5b Finish to migrate tests from selenium to playwright
Removed selenium tests and configuration
Added the rest of playwright tests
2023-04-27 14:43:59 +02:00
Min RK
3578001fab Merge pull request #4431 from mouse1203/playwright_more
Migrate some tests from selenium to playwright
2023-04-27 12:59:53 +02:00
Matúš Košút
b199110276 add HUNT into research institutions 2023-04-26 16:13:13 +02:00
mouse1203
b69bba5a7d Adding new playwright tests and removing a part of Selenium tests
Added Playwright tests which are covered Login, Spawning, Home and Token pages
Removed Selenium cases which are covered Login, Spawning, Home and Token pages
2023-04-25 10:42:05 +02:00
Min RK
efdad701df Merge pull request #4420 from mouse1203/playwright_more 2023-04-24 08:49:13 +02:00
Min RK
8a074b12b5 Merge pull request #4429 from consideRatio/pr/fix-missing-redirects 2023-04-24 08:46:06 +02:00
Erik Sundell
b5e5fe630d docs: fix missing redirects for api to reference/api 2023-04-23 08:02:52 +02:00
mouse1203
5d23bf6da3 Update test.yml
remove stage:
- name: Install playwright module
2023-04-21 15:35:12 +02:00
mouse1203
e5a8939481 Update setup.py
Update setup.py
2023-04-20 14:42:37 +02:00
mouse1203
0eca901c65 Added playwright in setup.py
Added "playwright" in setup.py under test section
2023-04-20 14:37:40 +02:00
mouse1203
4a1964f881 Updated configuration for selenium/playwright
Renamed selenium/playwright to browser in markers and configuration
2023-04-20 14:19:46 +02:00
Min RK
131094b5ff Merge pull request #4426 from minrk/upgrade-note
add upgrade note for 4.0 to changelog
2023-04-20 14:16:04 +02:00
Min RK
4544a98fb9 put upgrade note to note heading
Co-authored-by: Erik Sundell <erik.i.sundell@gmail.com>
2023-04-20 14:11:38 +02:00
Min RK
cbacdecb1e update sharing faq for 2023 2023-04-20 13:52:01 +02:00
Erik Sundell
64d8b2adc9 Merge pull request #4427 from minrk/rtd-internal-links
Fix some public URL links within the docs
2023-04-20 13:48:55 +02:00
Min RK
9c83c15f67 Fix some public URL links within the docs
there shouldn't be any links to jupyterhub.readthedocs.io
2023-04-20 13:36:16 +02:00
Min RK
d2a545a01e add upgrade note for 4.0 to changelog 2023-04-20 12:59:42 +02:00
Min RK
10e7ab96e5 Bump to 4.0.0 2023-04-20 12:18:26 +02:00
Min RK
40f519544f Merge pull request #4424 from minrk/changelog-4f
final changelog for 4.0.0
2023-04-20 12:17:56 +02:00
Min RK
076c14dce6 final changelog for 4.0.0 2023-04-20 11:17:52 +02:00
Erik Sundell
e223ce59e1 Merge pull request #4423 from minrk/diataxis-redirects
add remaining redirects for docs reorg
2023-04-20 10:59:36 +02:00
Min RK
ad833755e1 update comment for rediraffe check conditions 2023-04-20 09:14:57 +02:00
Min RK
142978b4d8 Merge pull request #4417 from manics/server-admin-list-as-table
Server admin: word-wrap lists
2023-04-20 09:11:21 +02:00
Min RK
e3cab48039 github.ref is always branch name on origin in PRs 2023-04-19 16:02:43 +02:00
Min RK
203f4a5855 test PRs against base ref
rather than making assumptions about checkouts and origins
2023-04-19 15:56:09 +02:00
Erik Sundell
cfc27db43d ci: fix failure getting latest tag for make rediraffecheckdiff 2023-04-19 15:48:23 +02:00
Erik Sundell
e2a8557083 ci: don't run make rediraffecheckdiff in forks 2023-04-19 15:41:24 +02:00
Erik Sundell
d5478b1f21 maint: let rediraffecheckdiff compare with origin/main, not main 2023-04-19 15:08:00 +02:00
Erik Sundell
cf19af6f1c ci: provide git history for make rediraffecheckdiff 2023-04-19 14:52:36 +02:00
Min RK
1342f00d8e move redirect line for 4.0 to bottom so rediraffewritediff adds in the right place 2023-04-19 13:40:17 +02:00
Min RK
1e49b4379b set rediraffe auto redirect percentage to 80% 2023-04-19 13:37:17 +02:00
Min RK
a5d563217c check redirects in test-docs
check all for:

- this PR
- latest tag
- longer term (3.0)
2023-04-19 13:27:51 +02:00
Min RK
b1ac3b82dc complete redirects for diataxis reorg
ran rediraffecheckdiff with rediraffe_branch=3.1.1

add a marker indicating that redirects are up-to-date for 4.0
2023-04-19 13:26:04 +02:00
mouse1203
a376f33af1 Update test.yml
Update test.yml
2023-04-17 10:25:26 +02:00
mouse1203
6f8a49569b Update test.yml
Update test.yml - added "if matrix.playwright"
2023-04-17 10:16:34 +02:00
mouse1203
a4c553a5c5 Merge remote-tracking branch 'upstream/main' into playwright_more 2023-04-17 10:07:20 +02:00
Erik Sundell
75ebe40f86 Merge pull request #4419 from manics/disable-dev-traitlets
Disable dev traitlets
2023-04-16 15:33:41 +02:00
Simon Li
69d711929a Disable dev traitlets
JupyterHub CI is currently broken with dev traitlets: https://github.com/jupyterhub/jupyterhub/issues/4418

This temporarily disables it
2023-04-16 14:00:04 +01:00
Simon Li
4c12872dbf Dockerfile uses nodejs 12- undo upgrade of packages in yarn.lock 2023-04-15 23:07:33 +01:00
Simon Li
21cee1be31 Render tabel cells with multiple data items as RowListItem 2023-04-14 23:41:36 +01:00
Simon Li
00c782fd40 Update yarn.lock 2023-04-14 23:40:54 +01:00
Simon Li
b3f9635ecc ReactObjectTableViewer can handle components 2023-04-14 23:29:53 +01:00
Simon Li
8c10fb285e Convert ReactObjectTableViewer to tsx, remove horizontal option 2023-04-14 19:39:20 +01:00
Simon Li
8a3f5d8f2e Copy f29827028f/src/ReactObjectTableViewer.tsx 2023-04-14 19:30:48 +01:00
Simon Li
7b496a5b4a Server admin: lists are displayed as word-wrapped CSV 2023-04-14 18:02:05 +01:00
mouse1203
41445cffb4 Update pytest.ini
Update pytest.ini
Adding "and not playwright"
2023-04-14 16:29:59 +02:00
Simon Li
64e7705053 Server admin: lists are displayed as tables not csv joined 2023-04-14 15:22:51 +01:00
mouse1203
dafd2d67f6 Update test.yml
Update test.yml
2023-04-14 16:09:57 +02:00
mouse1203
823ab58f3a update test.yml
update test.yml
2023-04-14 15:54:23 +02:00
mouse1203
ab7883e5c3 Update test.yml
Update test.yml: added install playwright
2023-04-14 15:45:14 +02:00
mouse1203
8fd1fb3234 added playwright with settings
added one case with settings
2023-04-14 15:22:16 +02:00
Min RK
6502b50576 Merge pull request #4416 from crazytan/patch-1
Remove bracket around link text without address
2023-04-14 07:15:03 +02:00
Jia Tan
861347cce0 Remove bracket around link text without address. 2023-04-13 15:35:11 -07:00
Erik Sundell
43d4b65250 Merge pull request #4409 from consideRatio/pr/dependabot-rename
dependabot: rename to .yaml
2023-04-07 16:00:22 +02:00
Erik Sundell
e53ce19fcc dependabot: rename to .yaml 2023-04-05 10:31:52 +02:00
Erik Sundell
e603ff8274 Merge pull request #4408 from consideRatio/pr/dependabot-syntax-fix
dependabot: fix syntax error of not using quotes for ##:##
2023-04-04 22:37:50 +02:00
Erik Sundell
22b15f0ecf dependabot: fix syntax error of not using quotes for ##:## 2023-04-04 22:36:43 +02:00
Erik Sundell
c48c5bce99 Merge pull request #4403 from consideRatio/pr/dependabot-monthly
dependabot: monthly updates of github actions
2023-04-04 22:35:15 +02:00
Erik Sundell
fa11d7e3c6 Add ci label to dependabot updates of github actions 2023-04-04 22:34:56 +02:00
Erik Sundell
7e3f29d033 Merge pull request #4404 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2023-04-04 08:47:53 +02:00
pre-commit-ci[bot]
b7827687a8 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/PyCQA/autoflake: v2.0.1 → v2.0.2](https://github.com/PyCQA/autoflake/compare/v2.0.1...v2.0.2)
- [github.com/psf/black: 23.1.0 → 23.3.0](https://github.com/psf/black/compare/23.1.0...23.3.0)
2023-04-04 06:21:53 +00:00
Erik Sundell
0beb4639a3 dependabot: monthly updates of github actions 2023-04-01 11:44:00 +02:00
Simon Li
b010c9501e Merge pull request #4402 from minrk/named-server-trailing-slash
make sure named server URLs include trailing slash
2023-03-30 20:07:55 +01:00
Min RK
295e92270b make sure named server URLs include trailing slash 2023-03-30 12:29:56 +02:00
Min RK
e42066f1c9 Merge pull request #4394 from alekseyolg/patch-1
Reduce size of jupyterhub image
2023-03-30 09:38:55 +02:00
Aleksey Karpov
1d29fcbfb2 Update Dockerfile
The same apt command in the entire file.
2023-03-29 14:46:28 +03:00
Aleksey Karpov
bdbfbb7e32 Update Dockerfile
Silently updating the list of available apt packages.
2023-03-29 14:44:00 +03:00
Aleksey Karpov
42314ed75b Apply suggestions from code review
Co-authored-by: Min RK <benjaminrk@gmail.com>
2023-03-29 14:15:20 +03:00
Aleksey Karpov
d8141692ab Update Dockerfile
Co-authored-by: Min RK <benjaminrk@gmail.com>
2023-03-29 14:12:12 +03:00
Aleksey Karpov
025db2f9f3 Update Dockerfile
removed the installation of apt packages from the cache due to the fact that the tests did not pass.
2023-03-24 15:22:01 +03:00
Aleksey Karpov
3985140377 Update test.yml
Add env DOCKER_BUILDKIT
2023-03-24 15:06:24 +03:00
Aleksey Karpov
6886384ca3 Update Dockerfile
Add mount cache
2023-03-24 14:49:11 +03:00
Erik Sundell
4a7fe8648a Merge pull request #4400 from minrk/intersect-server-scopes
add Spawner.server_token_scopes config
2023-03-23 11:48:52 +01:00
Min RK
7383c0cf60 esnure activity permissions are present in server tokens
with a warning

avoids case where custom server token permissions remove necessary permissions for posting activity updates
2023-03-23 10:58:19 +01:00
Min RK
83186e02a2 Do not give JUPYTERHUB_API_TOKEN access to other user servers
never intended, but limiting to server wasn't possible before

No change, except when one user has multiple servers running simultaneously.
2023-03-23 10:23:53 +01:00
Erik Sundell
c6b4577c0a Merge pull request #4399 from minrk/more-db-doc
add some more detail and examples to database doc
2023-03-22 14:19:59 +01:00
Min RK
73b1922c17 add Spawner.server_token_scopes config
consistent behavior with oauth_client_allowed_scopes,
where the _intersection_ of requested and owner-held permissions is granted,
instead of failing

Enables different users to have different permissions in $JUPTYERHUB_API_TOKEN,
either via callables or via requesting as much as you may want and only granting the subset.

Additionally, the !server filter can now be correctly applied to the server token

default behavior is unchanged
2023-03-22 13:56:58 +01:00
Min RK
1430e02fa8 fix db url for mysqlclient 2023-03-22 13:56:14 +01:00
Min RK
9ef09a288a add some more detail and examples to database doc
include actual configuration samples for postgres/mysql
2023-03-22 11:31:33 +01:00
Min RK
4a093be938 test with mysqlclient
as recommended by sqlalchemy
2023-03-22 10:33:51 +01:00
Simon Li
64a253dbef Merge pull request #4398 from ryanlovett/docs-managed-groups
Fix variable spelling.
2023-03-18 15:42:04 +00:00
ryanlovett
54877025ca Fix variable spelling.
The variable is `manage_groups`, although some method and function names use "managed".
2023-03-17 10:13:52 -07:00
Min RK
7793176b65 Bump to 4.0.0b2 2023-03-15 11:58:54 +01:00
Min RK
bf32599d5d Merge pull request #4396 from minrk/beta-2
Refresh 4.0 changelog
2023-03-15 11:57:46 +01:00
Min RK
01a31c894c CURC removed parallel tutorial 2023-03-15 11:51:44 +01:00
Min RK
1e9cf23302 Refresh 4.0 changelog 2023-03-15 10:21:07 +01:00
Aleksey Karpov
555969141e Update Dockerfile
Add env PYTHONDONTWRITEBYTECODE=1
2023-03-15 12:16:00 +03:00
Aleksey Karpov
a938982bdc Update Dockerfile
Divided the assembly image into parts
2023-03-15 12:10:28 +03:00
Min RK
17b54fee6a Merge pull request #4395 from jupyterhub/dependabot/npm_and_yarn/jsx/webpack-5.76.0
Bump webpack from 5.74.0 to 5.76.0 in /jsx
2023-03-15 09:26:08 +01:00
Aleksey Karpov
60a153718d Update Dockerfile
Add python-is-python3 
https://github.com/jupyterhub/jupyterhub/pull/4199
2023-03-15 08:20:46 +03:00
dependabot[bot]
9e1e382c37 Bump webpack from 5.74.0 to 5.76.0 in /jsx
Bumps [webpack](https://github.com/webpack/webpack) from 5.74.0 to 5.76.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.74.0...v5.76.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-15 04:12:11 +00:00
Aleksey Karpov
d72a96ec17 Update Dockerfile
Reduced the number of layers, optimized the assembly, reduced the size of the final image, removed the logs, removed unnecessary commands.
2023-03-14 21:43:48 +03:00
Min RK
5f845e78f1 Merge pull request #4393 from mouse1203/more_selenium
Selenium: updating test_oauth_page
2023-03-14 13:53:44 +01:00
mouse1203
0d7e608a64 Rewrite using parse_qs
Using parse_qs and urlparse instead of unquote for assertions
2023-03-14 12:10:53 +01:00
mouse1203
15c5f152f8 updating the assertion for client_id
updating the assertion for client_id: urllib.parse instead  of replace
2023-03-13 19:58:17 +01:00
mouse1203
6d13893f16 Changing in test_oauth_page
rewrote rows with assertions for client_id and redirect_url
2023-03-13 14:52:34 +01:00
Min RK
7e35de2577 Merge pull request #4390 from ryanlovett/ryanlovett-tutorial-collab-1
Add emphasis about role loading and hub restarts.
2023-03-10 15:22:15 +01:00
Erik Sundell
ec78503d1e Merge pull request #4392 from minrk/suppress-sqla-warning
avoid warning on engine_connect listener
2023-03-09 10:53:11 +01:00
Min RK
7d0bc1a112 avoid warning on engine_connect listener 2023-03-09 09:16:15 +01:00
Simon Li
98e4531b44 Merge pull request #4386 from minrk/get_users_link
Re-enable links to REST API
2023-03-08 21:09:54 +00:00
Ryan Lovett
bb92058fbf Add emphasis about role loading and hub restarts.
It may not be obvious that the load_roles code acts on existing groups, and one must have the hub re-run it to load_roles for new groups.
2023-03-08 11:12:46 -08:00
Min RK
a5c59d6550 Re-enable links to REST API
- fix path to oauth spec
- enable attrs_inline for external link handling to internal targets
2023-03-08 07:51:03 +01:00
Min RK
f14be3df65 Merge pull request #4387 from consideRatio/pr/fix-template-inclusion-in-wheel
fix inclusion of singleuser/templates/page.html in wheel
2023-03-07 16:20:31 +01:00
Erik Sundell
3f7a32c990 Merge pull request #4388 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2023-03-07 11:31:57 +01:00
pre-commit-ci[bot]
a8d8fc02e7 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-prettier: v3.0.0-alpha.4 → v3.0.0-alpha.6](https://github.com/pre-commit/mirrors-prettier/compare/v3.0.0-alpha.4...v3.0.0-alpha.6)
2023-03-07 03:44:16 +00:00
Erik Sundell
0713fa209e fix inclusion of singleuser/templates/page.html in wheel 2023-03-06 22:32:17 +01:00
Simon Li
850f430ad6 Merge pull request #4383 from minrk/exponential-max-wait
exponential_backoff: preserve jitter when max_wait is reached
2023-03-02 17:55:58 +00:00
Min RK
4026ed87e8 exponential_backoff: preserve jitter when max_wait is reached 2023-03-02 13:57:13 +01:00
Erik Sundell
f57d196e33 Merge pull request #4379 from minrk/unpin-singleuser
remove pin from singleuser
2023-03-01 14:16:12 +01:00
Min RK
ca9dc3a179 remove pin from singleuser
mysterious upstream image problem has been fixed just as mysteriously
2023-03-01 13:38:16 +01:00
Min RK
a348ba6536 Bump to 4.0.0b1 2023-03-01 11:09:39 +01:00
Min RK
c9e194f187 Merge pull request #4357 from minrk/singleuser-doc
add singleuser explanation doc
2023-03-01 11:06:30 +01:00
Min RK
5c6825f298 myst 0.19 changed intersphinx link syntax 2023-03-01 11:02:33 +01:00
Min RK
6bd0bb4b4a feedback from review in singleuser doc 2023-03-01 10:10:30 +01:00
Min RK
9422d2778f Merge pull request #4373 from minrk/collaboration-user-tutorial
add collaboration accounts tutorial
2023-03-01 09:46:29 +01:00
Min RK
ca760fc0df add singleuser explanation doc 2023-02-28 16:21:49 +01:00
Min RK
901904ecb8 Merge pull request #4375 from minrk/changelog-4
changelog for 4.0 beta
2023-02-28 16:15:38 +01:00
Min RK
33e173766f changelog: move breaking changes to the top 2023-02-28 15:54:49 +01:00
Min RK
6df40cd94b add changelog redirect 2023-02-28 15:53:52 +01:00
Min RK
6cc6be6c1c changelog for 4.0 beta 2023-02-28 15:02:55 +01:00
Min RK
44c7fe0fa6 Merge pull request #4377 from alwasega/updates
reduce nested hierarchy in docs organization
2023-02-28 15:00:24 +01:00
pre-commit-ci[bot]
533e97eaa9 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-02-28 13:33:00 +00:00
alwasega
e4dece9f24 Added redirect and modified api reference section 2023-02-28 16:34:52 +03:00
Min RK
08f9396017 add rtc screenshots 2023-02-28 11:47:50 +01:00
Min RK
c6598c797b Add collaboration-users example and tutorial 2023-02-28 11:35:03 +01:00
Min RK
6378592db9 Merge pull request #4363 from minrk/jupyterhub-sphinx-theme
JupyterHub sphinx theme
2023-02-28 11:01:55 +01:00
pre-commit-ci[bot]
fd598a0b97 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-02-28 08:58:18 +00:00
alwasega
bc3ef4403f Resolved items as guided by @minrk comments 2023-02-28 11:58:45 +03:00
Min RK
786196527b Merge pull request #4374 from 3coins/patch-1
Getting started link broken
2023-02-27 10:29:22 +01:00
Piyush Jain
93c488f840 Corrected Getting Started Link
Current getting started link in README is broken.
2023-02-24 16:15:42 -08:00
Min RK
23516e93f9 Merge pull request #4365 from minrk/admin-panel-button-condition
admin panel: fix condition for start/stop buttons on user servers
2023-02-24 15:59:29 +01:00
Min RK
112a79d7c6 try to simplify admin start/stop test
remove unused parameterization, excess variables
2023-02-24 15:32:50 +01:00
Sarah Gibson
ce7085b720 Merge pull request #4368 from alwasega/index 2023-02-22 14:06:18 +00:00
alwasega
e31e4f8cfc Incorporated heading suggestion 2023-02-22 15:34:55 +03:00
pre-commit-ci[bot]
177c6ea0ee [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-02-22 11:00:50 +00:00
alwasega
b0dbb055f4 Updated the top-level index file 2023-02-22 14:01:24 +03:00
Sarah Gibson
f245e933ee Merge pull request #4355 from alwasega/contributing 2023-02-21 13:00:11 +00:00
Min RK
e0cd07a9bb wait for admin page to load after clicking access-server button 2023-02-21 12:31:04 +01:00
Min RK
46052387bc admin panel: fix condition for start/stop buttons on user servers
`.ready` is the right switch for the links, not `.started` which can be defined even after they stop
2023-02-21 09:07:22 +01:00
Min RK
0b5a992605 update nav links for new theme 2023-02-20 15:08:47 +01:00
Min RK
3e9cd8acf8 use jupyterhub sphinx theme 2023-02-20 15:06:41 +01:00
Simon Li
bed466018c Merge pull request #4358 from pnasrat/remove-pdf-link
Remove PDF links from README.md
2023-02-17 17:39:39 +00:00
Pris Nasrat
6de12313e1 Remove PDF links from README.md
Fixes #4320
2023-02-17 08:25:46 -05:00
alwasega
ecc2108710 Reverted to previous toctree 2023-02-17 08:25:03 +03:00
Allan Wasega
b64ff64cc0 Merge branch 'jupyterhub:main' into contributing 2023-02-16 21:15:10 -08:00
Erik Sundell
63dcebadbe Merge pull request #4354 from minrk/server-extension-default
Make singleuser server-extension default
2023-02-16 19:28:13 +01:00
Simon Li
015dc03986 Merge pull request #4356 from minrk/cookie-error
avoid logging error when browsers send invalid cookies
2023-02-16 15:06:22 +00:00
Min RK
f1075b5a21 avoid error when browsers send invalid cookies 2023-02-16 15:07:35 +01:00
Min RK
403b5f1ffe subset tests for singleuser cases
saves some time for some matrix entries
2023-02-16 14:45:10 +01:00
Min RK
e9fd6e1c32 make sure ssl/subdomain are covered both for both mixin and serverextension 2023-02-16 14:45:10 +01:00
Min RK
18adfbbf30 add internal-ssl config for singleuser extension 2023-02-16 14:16:46 +01:00
Min RK
4c1df3f3fe fix hub_host links with subdomains
- fixes missing hub_host in singleuser mixins
- fixes test to match extension behavior, which is correct
2023-02-16 14:16:46 +01:00
Min RK
0ea813e6ad enable allow_remote access in singleuser extension
otherwise Host header validation prevents remote access
2023-02-16 14:16:45 +01:00
Min RK
09a595851e add test matrix entry for jupyter-server 1.x 2023-02-16 14:16:45 +01:00
Min RK
6ad6cf01c5 default to auth extensions with Jupyter Server 2 2023-02-16 14:16:45 +01:00
pre-commit-ci[bot]
bdfde0a256 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-02-16 10:12:40 +00:00
alwasega
ee2e830e03 Updates to the documentation Contribution section 2023-02-16 13:11:52 +03:00
Erik Sundell
c9d52ce6ff Merge pull request #3888 from minrk/server-extension
singleuser auth as server extension
2023-02-15 20:46:33 +01:00
Min RK
3b04f0872b extension: use jupyterhub log_request function
matches subclass log behavior
2023-02-15 11:30:18 +01:00
Min RK
61ac37500b Merge pull request #4341 from Sheila-nk/asyncio-doc
Document use of pytest-asyncio in JupyterHub test suite
2023-02-15 10:51:24 +01:00
Min RK
a43757bc1a fix hub api url in extension check_hub_version 2023-02-14 16:56:08 +01:00
Min RK
5f9283c7c0 Address review in singleuser extension
- more thorough docstrings, comments
- add missing `check_hub_version` call
- remove duplicate HubAuth instance on authorizer
2023-02-14 16:04:34 +01:00
Yuvi Panda
5d9e8b47c2 Merge pull request #4352 from shaneknapp/fix-spawn-timer-4351
add a few more buckets for server_spawn_duration_seconds
2023-02-13 12:51:48 -08:00
shane knapp
475548a3e2 add a few more buckets 2023-02-13 12:23:59 -08:00
Sheila Kahwai
f21743b751 add pytest-asyncio info under test organization 2023-02-13 10:48:37 +03:00
Sheila
b2a9a6d1c0 Merge branch 'jupyterhub:main' into asyncio-doc 2023-02-13 10:35:20 +03:00
Min RK
c93832cb33 Merge pull request #4343 from alwasega/references
Restructured references section of the docs
2023-02-10 13:42:26 +01:00
Min RK
46508a31d3 Merge pull request #4348 from minrk/build-push-temp
temporary fix: pin base-notebook tag
2023-02-10 12:00:51 +01:00
pre-commit-ci[bot]
b171608e26 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-02-10 10:05:54 +00:00
Min RK
d65064af74 set timeout on docker workflow
avoids six hour runaway jobs
2023-02-10 11:04:29 +01:00
Sheila Kahwai
493d856872 add pytest-asycnio doc to toctree 2023-02-10 13:01:21 +03:00
Sheila Kahwai
2adb341769 add pytest-asyncio document 2023-02-10 12:09:08 +03:00
pre-commit-ci[bot]
ac9682a4a7 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-02-10 09:02:12 +00:00
Sheila
057d32c166 Merge branch 'jupyterhub:main' into asyncio-doc 2023-02-10 12:01:42 +03:00
Min RK
037c3bc184 debug: try pinning singleuser base image 2023-02-10 08:53:03 +01:00
Min RK
9a49d06b21 consolidate disable_user_config implementation
found some fixes required to run on ServerApp to affect extensions,
which were not affected before
2023-02-10 08:21:02 +01:00
pre-commit-ci[bot]
dff1b0aca6 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-02-09 10:10:40 +00:00
alwasega
9535fa3af1 Re-pushed files after merging main into references 2023-02-09 13:12:42 +03:00
pre-commit-ci[bot]
fed4cd5e40 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-02-09 09:49:53 +00:00
Allan Wasega
587e5ebfff Merge branch 'jupyterhub:main' into references 2023-02-09 12:49:03 +03:00
alwasega
46be2c21e0 Pulled upstream changes and re-pushed files 2023-02-09 12:47:12 +03:00
alwasega
1837c33a56 Restructured references section of the docs 2023-02-09 12:25:07 +03:00
Min RK
40164e685f pre-commit; updated black 2023-02-08 16:40:41 +01:00
Min RK
3ad81f3bce sync with main 2023-02-08 16:39:59 +01:00
Min RK
155c8f664a singleuser: add some clarifying comments 2023-02-08 16:13:14 +01:00
Min RK
969084df98 Apply suggestions from code review
Co-authored-by: Erik Sundell <erik.i.sundell@gmail.com>
2023-02-08 16:12:49 +01:00
Min RK
39d4d38b8b Merge pull request #4319 from minrk/require-sqla-14
require sqlalchemy 1.4
2023-02-08 15:31:14 +01:00
Sheila Kahwai
759c4c5ebc move information to tests.md 2023-02-08 17:24:15 +03:00
Min RK
2bc452a617 Merge pull request #4328 from mouse1203/more_selenium
Selenium: adding new cases that covered Admin UI page
2023-02-08 13:38:36 +01:00
Sarah Gibson
8ef43941e8 Merge pull request #4340 from alwasega/explanation 2023-02-08 10:23:51 +00:00
pre-commit-ci[bot]
defde67746 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-02-08 08:22:43 +00:00
alwasega
3abce3581c Added signpost comments in explanation/index and rbac/index files 2023-02-08 11:24:46 +03:00
pre-commit-ci[bot]
ec9e9c3b04 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-02-07 12:56:24 +00:00
alwasega
c766f5866e incorporated changes after review 2023-02-07 15:58:05 +03:00
Erik Sundell
27c44e44c3 Merge pull request #4342 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2023-02-07 08:59:56 +01:00
mouse1203
af1dd54470 selenium:updating cases are related to Admin UI
According to the review updated cases covered the Admin UI:
- rename the function,
- add docstring,
- add parametrization,
- use the fixture admin_user instead of the function
2023-02-07 08:55:11 +01:00
pre-commit-ci[bot]
be07c7ef31 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-02-07 04:40:23 +00:00
pre-commit-ci[bot]
637cafcf6e [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/PyCQA/autoflake: v2.0.0 → v2.0.1](https://github.com/PyCQA/autoflake/compare/v2.0.0...v2.0.1)
- [github.com/psf/black: 22.12.0 → 23.1.0](https://github.com/psf/black/compare/22.12.0...23.1.0)
2023-02-07 04:37:54 +00:00
Sheila Kahwai
977c5b7f0b add README on use of pytest-asyncio 2023-02-06 17:11:44 +03:00
pre-commit-ci[bot]
a084d23107 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-02-06 08:32:25 +00:00
alwasega
c4d5762608 Moved Explanation/Background files 2023-02-06 11:31:37 +03:00
Erik Sundell
270b619921 Merge pull request #4339 from jupyterhub/dependabot/github_actions/docker/build-push-action-4.0.0
build(deps): bump docker/build-push-action from 3.3.0 to 4.0.0
2023-02-06 06:09:47 +01:00
dependabot[bot]
f2ac996bc6 build(deps): bump docker/build-push-action from 3.3.0 to 4.0.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3.3.0 to 4.0.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](37abcedcc1...3b5e8027fc)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-06 05:06:42 +00:00
Sarah Gibson
8cb1e347da Merge pull request #4338 from alwasega/tutorials_2 2023-02-03 14:58:19 +00:00
alwasega
d1fba40f9a Added suggestion in tutorials/index.md 2023-02-03 16:54:24 +03:00
pre-commit-ci[bot]
195ec4c359 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-02-03 13:02:03 +00:00
alwasega
f857b17022 Moved last set of Tutorials 2023-02-03 15:57:35 +03:00
Min RK
58dccdb59b jupyterhub-singleuser as a Jupyter Server 2.0 extension
mostly a copy (fork) of singleuser app
using public APIs instead of lots of patching.

opt-in via `JUPYTERHUB_SINGLEUSER_EXTENSION=1`

related changes:

- stop running a test single-user server in a thread. It's complicated and fragile.
  Instead, run it normally, and get the info we need from a custom handler registered via an extension
  via the `full_spawn` fixture
2023-02-02 16:14:06 +01:00
Erik Sundell
63f164ca53 Merge pull request #4334 from minrk/fix-ref
fix a couple ref links in changelog
2023-02-02 11:30:03 +01:00
Min RK
39f1faa1df fix a couple ref links in changelog
maybe mangled in an rst2md migration
2023-02-02 11:11:35 +01:00
Georgiana
9de3757caa Merge pull request #4332 from minrk/simplify-async-app
simplify some async fixtures
2023-02-02 11:20:17 +02:00
Sarah Gibson
75e49ebdd3 Merge pull request #4331 from alwasega/rediraffe 2023-02-01 12:55:55 +00:00
alwasega
150b22aab9 fixed comments syntax 2023-02-01 14:15:24 +03:00
alwasega
842712171e Added comments in redirects.text file 2023-02-01 14:06:15 +03:00
alwasega
ce1264cd18 fixed typos in conf.py 2023-01-31 21:06:56 +03:00
pre-commit-ci[bot]
2755966adf [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-01-31 14:00:04 +00:00
alwasega
bea35a60df Added missed redirects manually and updated comments on conf.py 2023-01-31 17:01:38 +03:00
Min RK
bf560707b6 Merge pull request #4326 from bl-aire/a11y
Improve contrast on muted text
2023-01-31 14:42:59 +01:00
Ogoh Blessing
194ff5ee57 Increase contrast of muted text 2023-01-31 14:42:23 +01:00
mouse1203
bc751b0740 Selenium: add wait element into open_admin_page
adding a waiting for loading of element
2023-01-31 13:18:47 +01:00
Min RK
44cb302de0 simplify some async fixtures
use async fixtures for simpler event-loop integration

several of these fixtures were written before fixtures themselves could be async,
but now they can, which means we can use async/await instead of run_sync.
2023-01-31 11:17:40 +01:00
pre-commit-ci[bot]
da5183a6f8 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-01-31 08:01:26 +00:00
alwasega
dd0b49c8f4 Added rediraffe using auto redirect builder 2023-01-31 10:58:21 +03:00
Min RK
d5bc135d9b fix xsrfToken in react
caught now that we have browser tests
2023-01-30 15:42:07 +01:00
mouse1203
9884fa7127 selenium: update spawn_pending_server_ready
adding await wait_for_ready(browser)
replacing await in_thread(browser.get, home_page)

adding waiting start all/stop all buttons in case start_stop_all_servers_on_admin_page
2023-01-30 14:50:57 +01:00
Erik Sundell
e85b91cd9b Merge pull request #4322 from jupyterhub/dependabot/github_actions/docker/setup-buildx-action-2.3.0
build(deps): bump docker/setup-buildx-action from 2.2.1 to 2.3.0 (now v2)
2023-01-30 14:48:08 +01:00
Erik Sundell
1666342fc3 Merge pull request #4327 from minrk/gitignore-backups
also ignore sqlite backups
2023-01-30 14:17:53 +01:00
Min RK
2a13929e63 also ignore sqlite backups
not just the rename (in case of `jupyterhub upgrade-db`)
2023-01-30 14:11:01 +01:00
mouse1203
11cd8674c2 selenium:add cases that covered Admin page
Adding cases: search, paging, start all/stop all, start/stop user´s server
2023-01-30 12:54:54 +01:00
Erik Sundell
df3be4c770 Merge pull request #4325 from minrk/pcau
pre-commit: bump isort
2023-01-30 10:57:27 +01:00
Min RK
ceb1154e61 pre-commit: bump isort 2023-01-30 10:54:22 +01:00
Min RK
56e603bf0f Merge pull request #4324 from consideRatio/pr/remove-readme-notice
Remove no longer relevant notice in readme
2023-01-30 10:53:21 +01:00
Erik Sundell
7366fddb0c ci: reference actions with v2 over git commit hash 2023-01-30 08:09:49 +01:00
Erik Sundell
124ae60133 Remove no longer relevant notice in readme 2023-01-30 07:48:18 +01:00
dependabot[bot]
d2231cb683 build(deps): bump docker/setup-buildx-action from 2.2.1 to 2.3.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.2.1 to 2.3.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](8c0edbc76e...5e716dcfd6)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-30 05:07:12 +00:00
Min RK
51b6376634 require sqlalchemy 1.4
removes some workarounds needed for sqlalchemy 1.1 + 2.0 support

1.4 backports most 2.0 behavior, keeping it off-by-default for an easier opt-in transition

opt-in with `session.future = True` flag
2023-01-27 14:15:02 +01:00
Sarah Gibson
95cf06a46e Merge pull request #4314 from alwasega/howto_2 2023-01-27 11:58:16 +00:00
Min RK
f658113b8c Merge pull request #4316 from minrk/cl-311
changelog for 3.1.1
2023-01-27 12:48:58 +01:00
Min RK
6911e2b052 changelog for 3.1.1 2023-01-27 11:56:04 +01:00
Min RK
3cf2ef7757 Merge pull request #4302 from minrk/sqla2
sqlalchemy 2 compatibility
2023-01-27 11:00:29 +01:00
Min RK
2db7c47fbf sqlalchemy 2 compatibility
- avoid backref warnings by adding objects to session explicitly before creating any relationships
- remove unnecessary `[]` around scalar query
- use `text()` wrapper on connection.execute
- engine.execute is removed
- update import of declarative_base
- ensure RemovedIn20Warning is available for warnings filters on sqlalchemy < 1.4 (needs editable install to avoid pytest path mismatch)
- explicitly relay password in engine.url to alembic
2023-01-27 10:42:03 +01:00
alwasega
680309e35d fixed MyST references 2023-01-27 11:58:03 +03:00
pre-commit-ci[bot]
62ceb9cc3d [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-01-27 08:43:30 +00:00
alwasega
f825973588 Moved second half of HowTo documentation 2023-01-27 11:32:41 +03:00
Sarah Gibson
0a84738fe9 Merge pull request #4311 from alwasega/howto_1 2023-01-26 18:02:00 +00:00
Min RK
a24608d445 Merge pull request #4309 from TaofeeqatDev/Jupyterhub1
Update authenticators-users-basics.md
2023-01-26 11:34:26 +01:00
Taofeeq Taofeeqat Olawumi
7f818a04ae Update authenticators-users-basics.md 2023-01-26 10:14:12 +01:00
alwasega
6340b1564e fixed outstanding MyST reference error in api/index.md file 2023-01-26 00:33:34 +03:00
alwasega
d2814c9c11 renamed MyST references in API docs to avoid duplication error 2023-01-26 00:29:23 +03:00
alwasega
49169dab2f fixed broken MyST references 2023-01-26 00:05:17 +03:00
pre-commit-ci[bot]
3f2d55474c [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-01-25 20:54:03 +00:00
alwasega
ee43ebeab5 Moved first half of HowTo documentation 2023-01-25 23:51:36 +03:00
Erik Sundell
e255ada169 Merge pull request #4032 from minrk/rm-referer-check
Use XSRF tokens for cross-site checks
2023-01-25 16:21:31 +01:00
Min RK
a336a30cf8 remove outdated xsrf todo 2023-01-25 15:47:13 +01:00
Taofeeq Taofeeqat Olawumi
7b39790a86 Update authenticators-users-basics.md
1. Fix some typo errors
2. Fix some grammar issues.
2023-01-24 16:02:03 +01:00
Sarah Gibson
38ba275367 Merge pull request #4307 from alwasega/faqs 2023-01-24 13:17:12 +00:00
alwasega
c65779db56 fixed broken MyST reference 2023-01-24 12:53:39 +03:00
alwasega
d8a5034b16 transferred docs to FAQ folder 2023-01-24 12:13:18 +03:00
Sarah Gibson
cb0073e9b8 Merge pull request #4305 from alwasega/tutorials 2023-01-23 16:01:26 +00:00
alwasega
dd95201b90 corrected MyST anchors location and minor error 2023-01-23 18:19:49 +03:00
alwasega
f88695084b fixed more than one myst target found error 2023-01-23 16:24:49 +03:00
pre-commit-ci[bot]
61ad3812ce [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-01-23 12:59:56 +00:00
alwasega
7c8800c724 added myst references in files 2023-01-23 16:01:13 +03:00
alwasega
b691480e5f Added docs to the folder 2023-01-20 13:36:16 +03:00
Sarah Gibson
36f74689c4 Merge pull request #4301 from alwasega/create-folders 2023-01-19 14:54:31 +00:00
Min RK
043390afe1 Merge pull request #4304 from GeorgianaElena/fix-oauthenticator-links
Fix the oauthenticator docs api links
2023-01-19 15:34:31 +01:00
Georgiana Dolocan
c5cceb789a Fix the oauthenticator docs api links 2023-01-19 16:02:58 +02:00
alwasega
f434b7ea33 Edited source/index.md file 2023-01-19 14:04:52 +03:00
Erik Sundell
8b0258c4f5 Merge pull request #4303 from minrk/install-events
make sure event-schemas are installed
2023-01-19 10:16:46 +01:00
Min RK
5b5069af99 make sure event-schemas are installed 2023-01-19 09:59:53 +01:00
pre-commit-ci[bot]
08c14a03d7 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-01-18 14:15:09 +00:00
alwasega
70196a4721 Edited files and folders per comments 2023-01-18 17:16:25 +03:00
pre-commit-ci[bot]
1114736ae7 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-01-17 21:21:35 +00:00
alwasega
0873902a18 Created folders to house the restructured documentation 2023-01-18 00:10:36 +03:00
Erik Sundell
a245708eaf Merge pull request #4294 from minrk/form-color-scope
Move some common form CSS to page.less
2023-01-17 09:47:31 +01:00
Min RK
21ad59dc3c Merge pull request #4292 from minrk/doc-db
expand database docs
2023-01-16 10:56:35 +01:00
Min RK
c7f8895a95 Merge pull request #4300 from jupyterhub/dependabot/github_actions/docker/build-push-action-3.3.0
build(deps): bump docker/build-push-action from 3.2.0 to 3.3.0
2023-01-16 10:49:22 +01:00
Min RK
abe1136cba Use XSRF tokens for cross-site protections
Removes all Referer checks, which have proven unreliable and have never been particularly strong

We can use XSRF on paths for more robust inter-path protections.

- `_xsrf` is added for forms via hidden input
- xsrf check is additionally applied to GET requests on API endpoints
2023-01-16 09:35:33 +01:00
dependabot[bot]
d0f719b0e1 build(deps): bump docker/build-push-action from 3.2.0 to 3.3.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](c56af95754...37abcedcc1)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-16 05:04:20 +00:00
Simon Li
c565835773 Merge pull request #4299 from minrk/group_property_feature
test and fix deprecated load_groups list
2023-01-13 14:58:46 +00:00
Min RK
663857a15f Merge pull request #4298 from mouse1203/more_selenium
Selenium testing: adding new case covered the authorisation page
2023-01-13 15:43:48 +01:00
Min RK
728b4e3dc7 test and fix deprecated load_groups list 2023-01-13 14:22:56 +01:00
mouse1203
6da46f36c9 Apply suggestions from code review
Co-authored-by: Min RK <benjaminrk@gmail.com>
2023-01-13 13:33:42 +01:00
Min RK
126f8d0115 Merge pull request #4297 from minrk/linkcheck-skip
docs: fix linkcheck in gallery
2023-01-13 11:37:53 +01:00
mouse1203
11f575568f working on test_oauth_page
updated the locator for "Authorize" button
reused functions from scopes.py
changed the part of comparing scopes on the service page
2023-01-13 11:10:05 +01:00
Min RK
57a22719a5 docs: fix linkcheck in gallery
- jupyter.chameleoncloud SSL is failing (I can reproduce with conda curl, but not /usr/bin/curl, so seems to be a CA issue)
- remove dead arnesund tag link (keep single article link)
2023-01-13 10:49:21 +01:00
Min RK
995264ffef Merge pull request #4288 from stevejpurves/docs-name-template
added note on `Spawner.name_template` setting
2023-01-12 11:45:43 +01:00
Steve Purves
f364c61d64 a more general statement on named server config 2023-01-11 16:59:37 +00:00
Erik Sundell
93926a564a Merge pull request #4295 from minrk/docstring-format
Fix formatting of load_groups help string
2023-01-11 16:49:44 +01:00
Min RK
5b743a147f Fix formatting of load_groups help string 2023-01-11 16:43:08 +01:00
Min RK
6abcbe8e37 Merge pull request #3651 from vladfreeze/group_property_feature
Dynamic table for changing customizable properties of groups
2023-01-11 16:34:45 +01:00
mouse1203
f4d8ad00a3 working on test_oauth_page
working on test_oauth_page case: added a check of scopes on the service page
2023-01-11 15:00:56 +01:00
Min RK
ad9b0095cb Move some common form CSS to page.less
so it affects other forms, such as the spawner form

results in more consistent style
2023-01-11 14:13:05 +01:00
Min RK
3c0467ebcf add group properties to rest api spec 2023-01-11 12:10:40 +01:00
Min RK
dfec64ab18 test group properties endpoint 2023-01-11 12:00:45 +01:00
Min RK
f65f429a4a avoid link myst can't seem to understand 2023-01-11 11:46:36 +01:00
Vlad Vifor
db9226d871 Added deprecation warning to jupyterhub/app.py
Co-authored-by: Min RK <benjaminrk@gmail.com>
2023-01-11 11:30:50 +01:00
pre-commit-ci[bot]
ced81d1a2e [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-01-11 09:42:51 +00:00
vpopescu
fec0cb1260 Fixed removals caused by merge, documentation 2023-01-11 10:42:03 +01:00
Min RK
52b8bc135f Apply suggestions from code review
Co-authored-by: Georgiana <georgiana.dolocan@gmail.com>
Co-authored-by: ajpower <122097973+ajpower@users.noreply.github.com>
2023-01-11 10:10:07 +01:00
Min RK
c7402676a8 expand database docs
add notes on what's in the database,
why there's a database,
and how it relates to performance
2023-01-09 15:40:00 +01:00
Min RK
336d7cfcfa Merge pull request #4290 from bl-aire/a11y
Fix skipped heading level across pages
2023-01-09 11:45:35 +01:00
Min RK
bf029d3c31 Merge pull request #4291 from jupyterhub/dependabot/npm_and_yarn/jsx/json5-2.2.3
build(deps): bump json5 from 2.2.1 to 2.2.3 in /jsx
2023-01-09 11:45:21 +01:00
Ogoh Blessing
ffb41b0164 Remove aria-hidden attribute 2023-01-09 10:26:49 +00:00
dependabot[bot]
86dcb51417 build(deps): bump json5 from 2.2.1 to 2.2.3 in /jsx
Bumps [json5](https://github.com/json5/json5) from 2.2.1 to 2.2.3.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v2.2.1...v2.2.3)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-09 02:24:16 +00:00
Ogoh Blessing
8613d43fe4 Fix skipped heading level 2023-01-08 00:05:02 +00:00
Ogoh Blessing
6b7061173f Add th cells to tables 2023-01-08 00:01:29 +00:00
pre-commit-ci[bot]
80368aad24 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-01-04 21:19:02 +00:00
Steve Purves
b17b073599 added note on Spawner.name_template setting 2023-01-04 21:14:16 +00:00
Vlad Vifor
e84359cc23 Merge branch 'jupyterhub:main' into group_property_feature 2023-01-03 16:00:45 +01:00
Erik Sundell
e4f72c9eeb Merge pull request #4286 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2023-01-03 15:05:21 +01:00
pre-commit-ci[bot]
7a94443a06 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pycqa/isort: 5.11.1 → 5.11.4](https://github.com/pycqa/isort/compare/5.11.1...5.11.4)
2023-01-03 01:50:49 +00:00
mouse1203
ddf1ff03f5 Adding the test case for the oauth confirmation page
added draft version of the test case for the oauth confirmation page
2023-01-02 13:10:22 +01:00
Min RK
49c518940b Merge pull request #4274 from bl-aire/main
Fix reoccurring accessibility issues in JupyterHub's pages
2022-12-21 15:36:44 +01:00
Ogoh Blessing
bf0927685f accessibility improvements across pages
- Add html language attribute

- Rename logo's alt text so it clearly states the image's purpose

- Fix missing first level heading for Login, Home and Token page

- Fix missing header level 1 of Login page

- Fix low contrast issue of navbar

Co-authored-by: Min RK <benjaminrk@gmail.com>
2022-12-21 15:04:25 +01:00
Erik Sundell
30f5d9c8ce Merge pull request #4258 from minrk/rm-unused-cookie
Remove remnants of unused jupyterhub-services cookie
2022-12-21 12:52:01 +01:00
Min RK
e057e8696b Merge pull request #4278 from mouse1203/more_selenium
Refactored selenium tests for improved readability
2022-12-21 12:04:27 +01:00
mouse1203
e31b69863f Changed locator under token_table_body_as_dict function
Changed locator under token_table_body_as_dict function
2022-12-21 10:41:27 +01:00
mouse1203
bf85411f23 table-as-dict function, locators, menu-bar
Added table-as-dict function instead of few functions for working with the tokens table
replaced static value from locators.py by locator itself in test_browser
simplified menu-bar case
2022-12-20 09:28:00 +01:00
Erik Sundell
5977e7f092 Merge pull request #4245 from manics/docs-fix-spawner-env
doc: fix formatting of spawner env-vars
2022-12-15 16:35:57 +01:00
Erik Sundell
70e53f31d0 Merge pull request #4268 from minrk/pre-commit-monthly
pre-commit: autoupdate monthly
2022-12-15 16:33:39 +01:00
Simon Li
afe50ef96e Merge pull request #4269 from minrk/document-jupyter-env
Document JUPYTER_PREFER_ENV_PATH=0 for shared user environments
2022-12-15 14:25:22 +00:00
Simon Li
e580b907c3 spawners.md: format env vars as code (avoids prettier bug) 2022-12-15 14:05:24 +00:00
Simon Li
3491ad6816 Merge pull request #4273 from minrk/rm-pipes
remove deprecated import of pipes.quote
2022-12-15 13:59:15 +00:00
Min RK
d300eb2519 remove deprecated import of pipes.quote
This function has been shlex.quote since 3.3, and pipes is set to be deprecated.
2022-12-15 12:12:48 +01:00
Min RK
7f7463ac3c Merge pull request #4271 from minrk/testing-localhost
only run testing config on localhost
2022-12-14 19:45:29 +01:00
Erik Sundell
b3f121e3e4 Merge pull request #4259 from minrk/toctree-max-depth
set max depth on api/index toctree
2022-12-14 16:09:49 +01:00
Min RK
7358b4d4ea only run testing config on localhost
avoids listening on the network with dummy auth
2022-12-14 13:45:10 +01:00
Min RK
15a7e9406b Document JUPYTER_PREFER_ENV_PATH=0 for shared user environments 2022-12-14 13:09:12 +01:00
Min RK
d6965cca81 Merge pull request #4207 from mouse1203/more_selenium
more selenium test cases
2022-12-13 14:57:36 +01:00
Min RK
78e36db3e3 xfail progress test
unreliable on CI, need to deal with race conditions
2022-12-13 14:07:04 +01:00
Min RK
25a4ef36db finish spawn_pending test
simplify conditions to check, fix next url, add missing ready signal to spawn_pending.html

need slow_spawn to be even slower
2022-12-13 14:02:10 +01:00
Min RK
1a8d4c0e96 pre-commit: autoupdate monthly 2022-12-13 09:29:53 +01:00
Min RK
0627fe0bb3 Merge pull request #4267 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-12-13 09:28:25 +01:00
pre-commit-ci[bot]
2b0533fd8d [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.3.0 → v3.3.1](https://github.com/asottile/pyupgrade/compare/v3.3.0...v3.3.1)
- [github.com/pycqa/isort: 5.10.1 → 5.11.1](https://github.com/pycqa/isort/compare/5.10.1...5.11.1)
- [github.com/psf/black: 22.10.0 → 22.12.0](https://github.com/psf/black/compare/22.10.0...22.12.0)
2022-12-13 01:22:36 +00:00
mouse1203
fe81f4d72d Changing in menu_bar and start_pending
Additionally replaced Dict to dict, in some places int removed
2022-12-12 18:02:20 +01:00
Min RK
241f927e91 Merge pull request #4264 from minrk/selenium-firefox
remove unnecessary actions for firefox/geckodriver
2022-12-12 13:40:32 +01:00
Min RK
ea2c081f6d Merge pull request #4263 from jupyterhub/dependabot/github_actions/dessant/support-requests-3
build(deps): bump dessant/support-requests from 2 to 3
2022-12-12 12:41:18 +01:00
dependabot[bot]
4022a3d564 build(deps): bump dessant/support-requests from 2 to 3
Bumps [dessant/support-requests](https://github.com/dessant/support-requests) from 2 to 3.
- [Release notes](https://github.com/dessant/support-requests/releases)
- [Changelog](https://github.com/dessant/support-requests/blob/master/CHANGELOG.md)
- [Commits](https://github.com/dessant/support-requests/compare/v2...v3)

---
updated-dependencies:
- dependency-name: dessant/support-requests
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-12 05:07:36 +00:00
Min RK
7739890264 simplify token page tests
- remove db utilities
- simplify waits
2022-12-09 13:54:20 +01:00
Min RK
cf5999b048 tests: wait for javascript to finish loading before clicking
allows us to wait for the javascript to finish loading,
since clicking buttons won't do anything if we click before the js has registered click handlers
2022-12-09 13:11:42 +01:00
Min RK
868a571c73 set max depth on api/index toctree
default maxdepth seems to have changed?
2022-12-09 11:32:25 +01:00
Min RK
21ff1de87e remove unmaintained actions for firefox/geckodriver
geckodriver is already set up in the GHA environment!
2022-12-09 09:40:33 +01:00
Min RK
2dab6aed99 Remove remnants of unused jupyterhub-services cookie
We stopped being able to use it in 2.0, but we didn't stop setting it.
2022-12-09 09:22:17 +01:00
Min RK
a8549ddbe2 wait for js events on token page 2022-12-08 15:56:37 +01:00
Min RK
aa91a69bc8 use a single browser session for selenium tests
avoids instantiating firefox for each test
2022-12-08 15:41:15 +01:00
Min RK
0ed05edba2 selenium: make click async 2022-12-08 15:36:39 +01:00
mouse1203
bec7c8ad2d change user to user.name
change user to user.name under case test_open_url_login
2022-12-08 15:17:17 +01:00
mouse1203
9449e77cca remove empty and pyparsing module
remove empty and pyparsing module
2022-12-08 14:52:39 +01:00
pre-commit-ci[bot]
0bd20ba74b [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-12-08 13:40:17 +00:00
mouse1203
98494b8c58 Merge branch 'main' into more_selenium 2022-12-08 14:39:42 +01:00
Min RK
7c5662ee52 Merge pull request #4256 from consideRatio/pr/update-makefile-make-bat
docs: refresh Makefile/make.bat
2022-12-08 09:21:57 +01:00
Erik Sundell
a9b6d7e51c docs: refresh Makefile/make.bat 2022-12-07 21:24:59 +01:00
Erik Sundell
ee45866afe Merge pull request #4251 from minrk/test-docs
Test docs, links on CI
2022-12-07 15:38:59 +01:00
Min RK
593112807b resolve linkcheck failures
- several http->https
- a few page moves
- miniconda->miniforge
- remove rochester from gallery, which doesn't apepar to be publicly documented (may be accessible internally, but that's not for a public gallery)
2022-12-07 15:10:42 +01:00
Min RK
0fa732a0a8 build docs, linkcheck on CI
RTD doesn't stop on warnings, but we should still notice
2022-12-07 15:10:42 +01:00
Min RK
4d0b37292d gitignore generated metrics.md 2022-12-07 15:10:42 +01:00
Min RK
d4a98738f1 Merge pull request #4249 from minrk/rst2myst
convert remaining rst files to myst
2022-12-07 14:35:19 +01:00
pre-commit-ci[bot]
3884d556b0 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-12-07 13:17:26 +00:00
Erik Sundell
71d5e604cb docs: use MyST fieldlist and substitution 2022-12-07 14:16:22 +01:00
Erik Sundell
f3bb3651b3 docs: remove redundant currentmodule directive, fix indentation 2022-12-07 13:11:23 +01:00
Erik Sundell
8bdd5a58a4 Merge pull request #4250 from minrk/figure-typo
fix bracket typo in capacity figures
2022-12-07 12:29:03 +01:00
Min RK
0085febc1c fix bracket typo in capacity figures 2022-12-07 09:43:04 +01:00
Min RK
8b988dc0be fix link targets after rst2myst 2022-12-07 09:42:26 +01:00
Min RK
b859818a9c switch generate-metrics to markdown 2022-12-07 09:02:09 +01:00
Min RK
832e8c0348 run rst2myst 2022-12-07 08:58:00 +01:00
Simon Li
5b7b9b5677 Merge pull request #4248 from consideRatio/pr/fix-py36-detail
maint: fix detail when removing support for py36
2022-12-06 19:05:19 +00:00
Erik Sundell
1d0496fc80 Merge pull request #4247 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-12-06 18:13:35 +01:00
Erik Sundell
4ff76d6d85 Merge pull request #4246 from jupyterhub/dependabot/npm_and_yarn/jsx/decode-uri-component-0.2.2
build(deps): bump decode-uri-component from 0.2.0 to 0.2.2 in /jsx
2022-12-06 18:13:15 +01:00
Erik Sundell
97e51fe54f maint: fix detail when removing support for py36 2022-12-06 18:06:40 +01:00
pre-commit-ci[bot]
19a375fba2 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.2.2 → v3.3.0](https://github.com/asottile/pyupgrade/compare/v3.2.2...v3.3.0)
2022-12-06 00:31:36 +00:00
dependabot[bot]
e5d48f419f build(deps): bump decode-uri-component from 0.2.0 to 0.2.2 in /jsx
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-05 13:45:13 +00:00
Min RK
e9c0fc6eb7 Bump to 3.2.0.dev 2022-12-05 14:45:03 +01:00
Simon Li
cfc93d8555 doc: fix formatting of spawner env-vars 2022-12-02 17:39:11 +00:00
mouse1203
ab8629642d token cases, updating cases according last review
adding checks token from db, adding some explanations to async sleep(still wip),  renamed few cases (spawn_panding, token), adding "cleanup_after" fixture into def browser()
2022-12-01 15:43:40 +01:00
mouse1203
7dee409218 Delete test_browser.py
Delete test_browser.py under jupyterhub/tests/ which was added to this folder accidentally
2022-11-11 12:59:11 +01:00
mouse1203
7dc230581c more selenium test cases
- revoking tokens
- logout
- token page
2022-11-11 10:53:33 +01:00
pre-commit-ci[bot]
a5a61893fb [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-11-02 14:22:56 +00:00
vpopescu
67f5543e18 Merge branch 2022-11-02 15:22:21 +01:00
vpopescu
6f6d60297c Merge branch 'group_property_feature' of https://github.com/vladfreeze/jupyterhub into group_property_feature 2022-09-29 16:55:41 +02:00
vpopescu
c8f0bed963 Made error disappear if keys have been fixed 2022-09-29 16:55:27 +02:00
pre-commit-ci[bot]
a1212a8503 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-09-29 14:48:32 +00:00
vpopescu
40eae6c685 Changed error to alert.alert-danger 2022-09-29 16:46:08 +02:00
pre-commit-ci[bot]
e205d05ec8 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-09-22 13:36:49 +00:00
vpopescu
2cdba6f42a Added type checks 2022-09-22 15:36:17 +02:00
vpopescu
6219c206e9 Merge branch 'group_property_feature' of https://github.com/vladfreeze/jupyterhub into group_property_feature 2022-09-22 15:23:48 +02:00
vpopescu
9d82a64a85 Removed setpropkeys and setpropvalues for testing 2022-09-22 15:23:46 +02:00
pre-commit-ci[bot]
7a4a00e5c1 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-09-22 13:12:51 +00:00
vpopescu
f28b613ccb Merge branch 'group_property_feature' of https://github.com/vladfreeze/jupyterhub into group_property_feature 2022-09-22 15:11:42 +02:00
vpopescu
20f5c2690b Added check for current_propobject 2022-09-22 15:11:40 +02:00
pre-commit-ci[bot]
f9b3ff58f9 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-09-22 11:02:27 +00:00
vpopescu
0a1811e86c Made DynamicTable functional 2022-09-22 13:01:53 +02:00
Vlad Vifor
e8ae58f6b5 Merge branch 'jupyterhub:main' into group_property_feature 2022-09-22 12:34:30 +02:00
pre-commit-ci[bot]
4033dbbd3f [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-08-25 12:37:08 +00:00
vpopescu
85da3be6af Merge branch 'group_property_feature' of https://github.com/vladfreeze/jupyterhub into group_property_feature 2022-08-25 14:36:38 +02:00
vpopescu
59d43edea1 Removed redirect to /groups when clicking on apply 2022-08-25 14:36:35 +02:00
pre-commit-ci[bot]
4a93cffb52 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-08-25 12:33:48 +00:00
vpopescu
7fb6df1c18 Fixed bug where inputs remained in the fields after already being added 2022-08-25 14:31:17 +02:00
vpopescu
f17fb36501 fixed button naming 2022-08-19 16:04:35 +02:00
vpopescu
3ff1afa88b Merge branch 'group_property_feature' of https://github.com/vladfreeze/jupyterhub into group_property_feature 2022-08-19 16:03:09 +02:00
vpopescu
faf3b4b477 fixed button naming 2022-08-19 16:01:14 +02:00
pre-commit-ci[bot]
452891148e [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-08-19 13:51:05 +00:00
vpopescu
b76a9ff146 fixed redirect bug when adding properties 2022-08-19 15:50:25 +02:00
vpopescu
08164fb0a7 Merge branch 'group_property_feature' of https://github.com/vladfreeze/jupyterhub into group_property_feature 2022-08-18 16:01:51 +02:00
vpopescu
ce4d8cf0f3 fixed typo 2022-08-18 16:01:48 +02:00
pre-commit-ci[bot]
224b14043a [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-08-18 14:00:40 +00:00
vpopescu
0fe08ad082 Fixed test issues 2022-08-18 15:59:39 +02:00
Vlad Vifor
516c394303 Merge branch 'jupyterhub:main' into group_property_feature 2022-08-18 15:40:35 +02:00
vpopescu
d4532c64aa fixed base.py 2022-08-04 17:59:06 +02:00
pre-commit-ci[bot]
5e94759fde [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-08-04 14:17:26 +00:00
vpopescu
b6a4b702ac update tests 2022-08-04 16:16:39 +02:00
vpopescu
7d902e87cd Updated test roles and scopes to correspond to new group structure 2022-08-04 16:06:41 +02:00
vpopescu
d4213a98d0 fixed test_app 2022-08-04 15:55:32 +02:00
vpopescu
6b67a1b146 fixed test_api 2022-08-04 15:47:21 +02:00
vpopescu
463e1fb9d7 app and orm 2022-08-04 15:30:08 +02:00
vpopescu
4440e56aa1 Added alembic and apihandlers 2022-08-04 15:26:55 +02:00
vpopescu
f59727b39f Added front-end 2022-08-04 15:22:27 +02:00
pre-commit-ci[bot]
aa1eb32b4c [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-08-03 14:11:16 +00:00
vpopescu
d690cfad38 Updated test_app.py for load_groups feature 2022-08-03 16:08:24 +02:00
vpopescu
0b04bf1181 Merge branch 'group_property_feature' of https://github.com/vladfreeze/jupyterhub into group_property_feature 2022-08-03 15:09:58 +02:00
vpopescu
9450a69bd3 testing load_groups 2022-08-03 15:09:33 +02:00
pre-commit-ci[bot]
67573728ad [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-08-03 11:50:31 +00:00
vpopescu
7011bc12fe Updating test_load_groups 2022-08-03 13:48:51 +02:00
Vlad Vifor
9186594dc1 Merge branch 'jupyterhub:main' into group_property_feature 2022-08-03 12:24:35 +02:00
Vlad Vifor
4d38087fa8 Merge branch 'jupyterhub:main' into group_property_feature 2022-08-02 11:58:16 +02:00
Vlad Vifor
6a8b1be940 Merge branch 'jupyterhub:main' into group_property_feature 2022-07-14 12:23:08 +02:00
Vlad Vifor
5d9967d3bd Merge branch 'jupyterhub:main' into group_property_feature 2022-06-17 13:59:31 +02:00
pre-commit-ci[bot]
3b4c8fe827 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-06-14 14:44:41 +00:00
vpopescu
052bf17292 Simplified hasDuplicates function 2022-06-14 16:44:08 +02:00
vpopescu
8df935829d Merge branch 'group_property_feature' of https://github.com/vladfreeze/jupyterhub into group_property_feature 2022-06-14 16:35:21 +02:00
vpopescu
39479609ca Added key check on users 2022-06-14 16:35:19 +02:00
pre-commit-ci[bot]
4344b0c0b0 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-06-14 14:27:38 +00:00
vpopescu
13ea058bbb Merge branch 'group_property_feature' of https://github.com/vladfreeze/jupyterhub into group_property_feature 2022-06-14 16:26:59 +02:00
vpopescu
8fe4bc201e Added properties to documentation for load_groups + example 2022-06-14 16:25:04 +02:00
pre-commit-ci[bot]
f6a35de542 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-06-14 14:22:53 +00:00
vpopescu
d7fbe494dd Added properties support in app.py 2022-06-14 16:22:15 +02:00
vpopescu
1ccf282170 Merge commit '63b7defe1a40b3abc3582a65a0402c1e82a2e230' into group_property_feature 2022-06-14 14:57:06 +02:00
vpopescu
b2a6a5a82f Updated jsx-admin 2022-04-14 17:26:36 +02:00
pre-commit-ci[bot]
60cd4ff872 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-04-14 15:17:53 +00:00
Vlad Vifor
35f4c76982 Merge branch 'main' into group_property_feature 2022-04-14 17:17:21 +02:00
Vlad Vifor
6ede428990 Merge branch 'jupyterhub:main' into group_property_feature 2022-03-30 11:25:53 +02:00
vpopescu
bfc9c880b9 Removed duplicate files 2022-03-23 13:54:07 +01:00
vpopescu
ef113a9040 Merge branch 'group_property_feature' of https://github.com/vladfreeze/jupyterhub into group_property_feature 2022-03-23 13:52:04 +01:00
vpopescu
ca4342a010 Removed git error 2022-03-23 13:31:55 +01:00
Vlad Vifor
e627e91fa6 Merge branch 'jupyterhub:main' into group_property_feature 2022-03-23 13:21:25 +01:00
pre-commit-ci[bot]
b1c0ebd521 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-03-18 11:59:17 +00:00
Vlad Vifor
e6c4ca1f25 Merge branch 'jupyterhub:main' into group_property_feature 2022-03-18 12:58:20 +01:00
Vlad Vifor
0643b8280e Merge branch 'jupyterhub:main' into group_property_feature 2022-02-16 11:35:57 +01:00
pre-commit-ci[bot]
6e9ca0dc4a [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-02-02 10:41:47 +00:00
Vlad Vifor
42af51a1a5 Merge branch 'main' into group_property_feature 2022-02-02 11:40:50 +01:00
Vlad Vifor
0d90b81cb6 Removed test add properties 2022-02-02 11:38:24 +01:00
Vlad Vifor
020738a7ea Merge branch 'jupyterhub:main' into group_property_feature 2022-01-13 12:55:23 +01:00
pre-commit-ci[bot]
515cadd079 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-01-07 09:42:31 +00:00
Vlad Vifor
5e5830185d Merge branch 'jupyterhub:main' into group_property_feature 2022-01-07 10:41:33 +01:00
Vlad Vifor
26c65339a7 Merge branch 'jupyterhub:main' into group_property_feature 2021-12-23 12:54:23 +01:00
pre-commit-ci[bot]
e59e7f534c [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2021-12-16 14:50:38 +00:00
vpopescu
25b0133979 Merge commit '92c6a23a13cc75a45e750f25bc5d76ed5cb49445' into group_property_feature 2021-12-16 15:48:50 +01:00
Vlad Vifor
3b7e4d8550 Updated alembic revision 2021-12-09 18:21:25 +01:00
vpopescu
2b6666e114 Cleaned the alembic revision 2021-12-09 16:56:36 +01:00
vpopescu
06b2b78ffc test 2021-12-09 16:53:04 +01:00
Vlad Vifor
2dd2b7d60c Merge branch 'jupyterhub:main' into group_property_feature 2021-12-02 12:32:49 +01:00
vladfreeze
c7cb4138ee Fixed bug where users where deleted when changing group properties 2021-12-02 11:29:31 +01:00
vladfreeze
d812d0f11c Removed a duplicate key error output for further testing 2021-12-02 11:29:29 +01:00
vladfreeze
7fe565cc05 updated test_scopes and access map in base.py to fit in group properties 2021-12-02 11:29:27 +01:00
vladfreeze
5aed99b4a6 Improved design 2021-12-02 11:29:26 +01:00
vladfreeze
4c30e9e1d1 Updated code to fit with latest version 2021-12-02 11:29:24 +01:00
vladfreeze
7a56cadfb5 Improved design of input fields to match template 2021-12-02 11:29:22 +01:00
vladfreeze
21231d2f23 Removed automatically generated comments from alembic 2021-12-02 11:29:20 +01:00
vladfreeze
b11814c95b Added alembic revision for upgrading databases with no properties columns. 2021-12-02 11:29:11 +01:00
vladfreeze
471e492c11 Added changes for group properties editing 2021-12-02 11:29:00 +01:00
266 changed files with 18136 additions and 11626 deletions

View File

@@ -1,4 +1,4 @@
# dependabot.yml reference: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
# dependabot.yaml reference: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
#
# Notes:
# - Status and logs from dependabot are provided at
@@ -8,8 +8,9 @@ version: 2
updates:
# Maintain dependencies in our GitHub Workflows
- package-ecosystem: github-actions
directory: "/"
directory: /
labels: [ci]
schedule:
interval: weekly
interval: monthly
time: "05:00"
timezone: "Etc/UTC"
timezone: Etc/UTC

View File

@@ -30,16 +30,16 @@ on:
jobs:
build-release:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
python-version: "3.11"
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: "14"
node-version: "20"
- name: install build requirements
run: |
@@ -67,7 +67,7 @@ jobs:
docker run --rm -v $PWD/dist:/dist:ro docker.io/library/python:3.9-slim-bullseye bash -c 'pip install /dist/jupyterhub-*.tar.gz'
# ref: https://github.com/actions/upload-artifact#readme
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: jupyterhub-${{ github.sha }}
path: "dist/*"
@@ -83,7 +83,8 @@ jobs:
twine upload --skip-existing dist/*
publish-docker:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 20
services:
# So that we can test this in PRs/branches
@@ -96,39 +97,35 @@ jobs:
- name: Should we push this image to a public registry?
run: |
if [ "${{ startsWith(github.ref, 'refs/tags/') || (github.ref == 'refs/heads/main') }}" = "true" ]; then
# Empty => Docker Hub
echo "REGISTRY=" >> $GITHUB_ENV
echo "REGISTRY=quay.io/" >> $GITHUB_ENV
else
echo "REGISTRY=localhost:5000/" >> $GITHUB_ENV
fi
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# Setup docker to build for multiple platforms, see:
# https://github.com/docker/build-push-action/tree/v2.4.0#usage
# https://github.com/docker/build-push-action/blob/v2.4.0/docs/advanced/multi-platform.md
- name: Set up QEMU (for docker buildx)
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # associated tag: v1.0.2
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx (for multi-arch builds)
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325
uses: docker/setup-buildx-action@v3
with:
# Allows pushing to registry on localhost:5000
driver-opts: network=host
- name: Setup push rights to Docker Hub
# This was setup by...
# 1. Creating a Docker Hub service account "jupyterhubbot"
# 2. Creating a access token for the service account specific to this
# repository: https://hub.docker.com/settings/security
# 3. Making the account part of the "bots" team, and granting that team
# permissions to push to the relevant images:
# https://hub.docker.com/orgs/jupyterhub/teams/bots/permissions
# 4. Registering the username and token as a secret for this repo:
# https://github.com/jupyterhub/jupyterhub/settings/secrets/actions
# 1. Creating a [Robot Account](https://quay.io/organization/jupyterhub?tab=robots) in the JupyterHub
# . Quay.io org
# 2. Giving it enough permissions to push to the jupyterhub and singleuser images
# 3. Putting the robot account's username and password in GitHub actions environment
if: env.REGISTRY != 'localhost:5000/'
run: |
docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" -p "${{ secrets.DOCKERHUB_TOKEN }}"
docker login -u "${{ secrets.QUAY_USERNAME }}" -p "${{ secrets.QUAY_PASSWORD }}" "${{ env.REGISTRY }}"
docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" -p "${{ secrets.DOCKERHUB_TOKEN }}" docker.io
# image: jupyterhub/jupyterhub
#
@@ -141,15 +138,17 @@ jobs:
# If GITHUB_TOKEN isn't available (e.g. in PRs) returns no tags [].
- name: Get list of jupyterhub tags
id: jupyterhubtags
uses: jupyterhub/action-major-minor-tag-calculator@v2
uses: jupyterhub/action-major-minor-tag-calculator@v3
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
prefix: "${{ env.REGISTRY }}jupyterhub/jupyterhub:"
prefix: >-
${{ env.REGISTRY }}jupyterhub/jupyterhub:
jupyterhub/jupyterhub:
defaultTag: "${{ env.REGISTRY }}jupyterhub/jupyterhub:noref"
branchRegex: ^\w[\w-.]*$
- name: Build and push jupyterhub
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
@@ -162,15 +161,17 @@ jobs:
#
- name: Get list of jupyterhub-onbuild tags
id: onbuildtags
uses: jupyterhub/action-major-minor-tag-calculator@v2
uses: jupyterhub/action-major-minor-tag-calculator@v3
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
prefix: "${{ env.REGISTRY }}jupyterhub/jupyterhub-onbuild:"
prefix: >-
${{ env.REGISTRY }}jupyterhub/jupyterhub-onbuild:
jupyterhub/jupyterhub-onbuild:
defaultTag: "${{ env.REGISTRY }}jupyterhub/jupyterhub-onbuild:noref"
branchRegex: ^\w[\w-.]*$
- name: Build and push jupyterhub-onbuild
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5
uses: docker/build-push-action@v5
with:
build-args: |
BASE_IMAGE=${{ fromJson(steps.jupyterhubtags.outputs.tags)[0] }}
@@ -183,15 +184,17 @@ jobs:
#
- name: Get list of jupyterhub-demo tags
id: demotags
uses: jupyterhub/action-major-minor-tag-calculator@v2
uses: jupyterhub/action-major-minor-tag-calculator@v3
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
prefix: "${{ env.REGISTRY }}jupyterhub/jupyterhub-demo:"
prefix: >-
${{ env.REGISTRY }}jupyterhub/jupyterhub-demo:
jupyterhub/jupyterhub-demo:
defaultTag: "${{ env.REGISTRY }}jupyterhub/jupyterhub-demo:noref"
branchRegex: ^\w[\w-.]*$
- name: Build and push jupyterhub-demo
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5
uses: docker/build-push-action@v5
with:
build-args: |
BASE_IMAGE=${{ fromJson(steps.onbuildtags.outputs.tags)[0] }}
@@ -207,15 +210,17 @@ jobs:
#
- name: Get list of jupyterhub/singleuser tags
id: singleusertags
uses: jupyterhub/action-major-minor-tag-calculator@v2
uses: jupyterhub/action-major-minor-tag-calculator@v3
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
prefix: "${{ env.REGISTRY }}jupyterhub/singleuser:"
prefix: >-
${{ env.REGISTRY }}jupyterhub/singleuser:
jupyterhub/singleuser:
defaultTag: "${{ env.REGISTRY }}jupyterhub/singleuser:noref"
branchRegex: ^\w[\w-.]*$
- name: Build and push jupyterhub/singleuser
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5
uses: docker/build-push-action@v5
with:
build-args: |
JUPYTERHUB_VERSION=${{ github.ref_type == 'tag' && github.ref_name || format('git:{0}', github.sha) }}

View File

@@ -12,7 +12,7 @@ jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: dessant/support-requests@v2
- uses: dessant/support-requests@v3
with:
github-token: ${{ github.token }}
support-label: "support"
@@ -25,7 +25,7 @@ jobs:
Our goal is to sustain a positive experience for both users and developers. We use GitHub issues for specific discussions related to changing a repository's content, and let the forum be where we can more generally help and inspire each other.
Thanks you for being an active member of our community! :heart:
Thank you for being an active member of our community! :heart:
close-issue: true
lock-issue: false
issue-lock-reason: "off-topic"

View File

@@ -49,6 +49,11 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
# make rediraffecheckdiff requires git history to compare current
# commit with the main branch and previous releases.
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.9"
@@ -60,3 +65,43 @@ jobs:
- name: pytest docs/
run: |
pytest docs/
# readthedocs doesn't halt on warnings,
# so raise any warnings here
- name: build docs
run: |
cd docs
make html
- name: check links
run: |
cd docs
make linkcheck
# make rediraffecheckdiff compares files for different changesets
# these diff targets aren't always available
# - compare with base ref (usually 'main', always on 'origin') for pull requests
# - only compare with tags when running against jupyterhub/jupyterhub
# to avoid errors on forks, which often lack tags
- name: check redirects for this PR
if: github.event_name == 'pull_request'
run: |
cd docs
export REDIRAFFE_BRANCH=origin/${{ github.base_ref }}
make rediraffecheckdiff
# this should check currently published 'stable' links for redirects
- name: check redirects since last release
if: github.repository == 'jupyterhub/jupyterhub'
run: |
cd docs
export REDIRAFFE_BRANCH=$(git describe --tags --abbrev=0)
make rediraffecheckdiff
# longer-term redirect check (fixed version) for older links
- name: check redirects since 3.0.0
if: github.repository == 'jupyterhub/jupyterhub'
run: |
cd docs
export REDIRAFFE_BRANCH=3.0.0
make rediraffecheckdiff

View File

@@ -28,7 +28,7 @@ on:
env:
# UTF-8 content may be interpreted as ascii and causes errors without this.
LANG: C.UTF-8
PYTEST_ADDOPTS: "--verbose --color=yes"
SQLALCHEMY_WARN_20: "1"
permissions:
contents: read
@@ -78,17 +78,31 @@ jobs:
oldest_dependencies: oldest_dependencies
legacy_notebook: legacy_notebook
- python: "3.8"
legacy_notebook: legacy_notebook
jupyter_server: "1.*"
subset: singleuser
- python: "3.9"
db: mysql
- python: "3.10"
db: postgres
- python: "3.11"
subdomain: subdomain
serverextension: serverextension
- python: "3.11"
ssl: ssl
serverextension: serverextension
- python: "3.11"
selenium: selenium
subdomain: subdomain
noextension: noextension
subset: singleuser
- python: "3.11"
ssl: ssl
noextension: noextension
subset: singleuser
- python: "3.11"
browser: browser
- python: "3.11"
subdomain: subdomain
browser: browser
- python: "3.11"
main_dependencies: main_dependencies
@@ -103,7 +117,7 @@ jobs:
fi
if [ "${{ matrix.db }}" == "mysql" ]; then
echo "MYSQL_HOST=127.0.0.1" >> $GITHUB_ENV
echo "JUPYTERHUB_TEST_DB_URL=mysql+mysqlconnector://root@127.0.0.1:3306/jupyterhub" >> $GITHUB_ENV
echo "JUPYTERHUB_TEST_DB_URL=mysql+mysqldb://root@127.0.0.1:3306/jupyterhub" >> $GITHUB_ENV
fi
if [ "${{ matrix.ssl }}" == "ssl" ]; then
echo "SSL_ENABLED=1" >> $GITHUB_ENV
@@ -114,8 +128,10 @@ jobs:
echo "PGPASSWORD=hub[test/:?" >> $GITHUB_ENV
echo "JUPYTERHUB_TEST_DB_URL=postgresql://test_user:hub%5Btest%2F%3A%3F@127.0.0.1:5432/jupyterhub" >> $GITHUB_ENV
fi
if [ "${{ matrix.jupyter_server }}" != "" ]; then
echo "JUPYTERHUB_SINGLEUSER_APP=jupyterhub.tests.mockserverapp.MockServerApp" >> $GITHUB_ENV
if [ "${{ matrix.serverextension }}" != "" ]; then
echo "JUPYTERHUB_SINGLEUSER_EXTENSION=1" >> $GITHUB_ENV
elif [ "${{ matrix.noextension }}" != "" ]; then
echo "JUPYTERHUB_SINGLEUSER_EXTENSION=0" >> $GITHUB_ENV
fi
- uses: actions/checkout@v3
# NOTE: actions/setup-node@v3 make use of a cache within the GitHub base
@@ -140,7 +156,7 @@ jobs:
- name: Install Python dependencies
run: |
pip install --upgrade pip
pip install ".[test]"
pip install -e ".[test]"
if [ "${{ matrix.oldest_dependencies }}" != "" ]; then
# take any dependencies in requirements.txt such as tornado>=5.0
@@ -151,18 +167,27 @@ jobs:
fi
if [ "${{ matrix.main_dependencies }}" != "" ]; then
pip install git+https://github.com/ipython/traitlets#egg=traitlets --force
# Tests are broken:
# https://github.com/jupyterhub/jupyterhub/issues/4418
# pip install git+https://github.com/ipython/traitlets#egg=traitlets --force
pip install --upgrade --pre sqlalchemy
fi
if [ "${{ matrix.legacy_notebook }}" != "" ]; then
pip uninstall jupyter_server --yes
pip install 'notebook<7'
fi
if [ "${{ matrix.jupyter_server }}" != "" ]; then
pip install "jupyter_server==${{ matrix.jupyter_server }}"
fi
if [ "${{ matrix.db }}" == "mysql" ]; then
pip install mysql-connector-python
pip install mysqlclient
fi
if [ "${{ matrix.db }}" == "postgres" ]; then
pip install psycopg2-binary
fi
if [ "${{ matrix.serverextension }}" != "" ]; then
pip install 'jupyter-server>=2'
fi
pip freeze
@@ -206,23 +231,18 @@ jobs:
DB=postgres bash ci/docker-db.sh
DB=postgres bash ci/init-db.sh
fi
- name: Setup Firefox
if: matrix.selenium
uses: browser-actions/setup-firefox@latest
with:
firefox-version: latest
- name: Setup Geckodriver
if: matrix.selenium
uses: browser-actions/setup-geckodriver@latest
- name: Configure browser tests
if: matrix.browser
run: echo "PYTEST_ADDOPTS=$PYTEST_ADDOPTS -m browser" >> "${GITHUB_ENV}"
- name: Configure selenium tests
if: matrix.selenium
run: echo "PYTEST_ADDOPTS=$PYTEST_ADDOPTS -m selenium" >> "${GITHUB_ENV}"
- name: Ensure browsers are installed for playwright
if: matrix.browser
run: python -m playwright install --with-deps
- name: Run pytest
run: |
pytest --maxfail=2 --cov=jupyterhub jupyterhub/tests
pytest -k "${{ matrix.subset }}" --maxfail=2 --cov=jupyterhub jupyterhub/tests
- uses: codecov/codecov-action@v3
@@ -235,9 +255,8 @@ jobs:
- name: build images
run: |
docker build -t jupyterhub/jupyterhub .
DOCKER_BUILDKIT=1 docker build -t jupyterhub/jupyterhub .
docker build -t jupyterhub/jupyterhub-onbuild onbuild
docker build -t jupyterhub/jupyterhub:alpine -f dockerfiles/Dockerfile.alpine .
docker build -t jupyterhub/singleuser singleuser
- name: smoke test jupyterhub

3
.gitignore vendored
View File

@@ -9,6 +9,8 @@ docs/_build
docs/build
docs/source/_static/rest-api
docs/source/rbac/scope-table.md
docs/source/reference/metrics.md
.ipynb_checkpoints
jsx/build/
# ignore config file at the top-level of the repo
@@ -16,6 +18,7 @@ jsx/build/
/jupyterhub_config.py
jupyterhub_cookie_secret
jupyterhub.sqlite
jupyterhub.sqlite*
package-lock.json
share/jupyterhub/static/components
share/jupyterhub/static/css/style.min.css

View File

@@ -8,18 +8,23 @@
# - Run on all files: pre-commit run --all-files
# - Register git hooks: pre-commit install --install-hooks
#
ci:
# pre-commit.ci will open PRs updating our hooks once a month
autoupdate_schedule: monthly
repos:
# Autoformat: Python code, syntax patterns are modernized
- repo: https://github.com/asottile/pyupgrade
rev: v3.2.2
rev: v3.15.0
hooks:
- id: pyupgrade
args:
- --py36-plus
- --py37-plus
# Autoformat: Python code
- repo: https://github.com/PyCQA/autoflake
rev: v2.0.0
rev: v2.2.1
hooks:
- id: autoflake
# args ref: https://github.com/PyCQA/autoflake#advanced-usage
@@ -28,25 +33,25 @@ repos:
# Autoformat: Python code
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.13.2
hooks:
- id: isort
# Autoformat: Python code
- repo: https://github.com/psf/black
rev: 22.10.0
rev: 24.1.1
hooks:
- id: black
# Autoformat: markdown, yaml, javascript (see the file .prettierignore)
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.4
rev: v4.0.0-alpha.8
hooks:
- id: prettier
# Autoformat and linting, misc. details
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: end-of-file-fixer
exclude: share/jupyterhub/static/js/admin-react.js
@@ -56,6 +61,6 @@ repos:
# Linting: Python code (see the file .flake8)
- repo: https://github.com/PyCQA/flake8
rev: "6.0.0"
rev: "7.0.0"
hooks:
- id: flake8

View File

@@ -1,2 +1,3 @@
share/jupyterhub/templates/
share/jupyterhub/static/js/admin-react.js
jupyterhub/singleuser/templates/

View File

@@ -6,7 +6,7 @@
#
# Option 1:
#
# FROM jupyterhub/jupyterhub:latest
# FROM quay.io/jupyterhub/jupyterhub:latest
#
# And put your configuration file jupyterhub_config.py in /srv/jupyterhub/jupyterhub_config.py.
#
@@ -14,90 +14,123 @@
#
# Or you can create your jupyterhub config and database on the host machine, and mount it with:
#
# docker run -v $PWD:/srv/jupyterhub -t jupyterhub/jupyterhub
# docker run -v $PWD:/srv/jupyterhub -t quay.io/jupyterhub/jupyterhub
#
# NOTE
# If you base on jupyterhub/jupyterhub-onbuild
# If you base on quay.io/jupyterhub/jupyterhub-onbuild
# your jupyterhub_config.py will be added automatically
# from your docker directory.
######################################################################
# This Dockerfile uses multi-stage builds with optimisations to build
# the JupyterHub wheel on the native architecture only
# https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/
ARG BASE_IMAGE=ubuntu:22.04
FROM $BASE_IMAGE AS builder
USER root
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update \
&& apt-get install -yq --no-install-recommends \
######################################################################
# The JupyterHub wheel is pure Python so can be built for any platform
# on the native architecture (avoiding QEMU emulation)
FROM --platform=${BUILDPLATFORM:-linux/amd64} $BASE_IMAGE AS jupyterhub-builder
ENV DEBIAN_FRONTEND=noninteractive
# Don't clear apt cache, and don't combine RUN commands, so that cached layers can
# be reused in other stages
RUN apt-get update -qq \
&& apt-get install -yqq --no-install-recommends \
build-essential \
ca-certificates \
curl \
locales \
python3-dev \
python3-pip \
python3-pycurl \
python3-venv \
&& python3 -m pip install --no-cache-dir --upgrade setuptools pip build wheel
# Ubuntu 22.04 comes with Nodejs 12 which is too old for building JupyterHub JS
# It's fine at runtime though (used only by configurable-http-proxy)
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -yqq --no-install-recommends \
nodejs \
npm \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN python3 -m pip install --upgrade setuptools pip build wheel
RUN npm install --global yarn
&& npm install --global yarn
WORKDIR /src/jupyterhub
# copy everything except whats in .dockerignore, its a
# compromise between needing to rebuild and maintaining
# what needs to be part of the build
COPY . /src/jupyterhub/
WORKDIR /src/jupyterhub
COPY . .
# Build client component packages (they will be copied into ./share and
# packaged with the built wheel.)
RUN python3 -m build --wheel
RUN python3 -m pip wheel --wheel-dir wheelhouse dist/*.whl
ARG PIP_CACHE_DIR=/tmp/pip-cache
RUN --mount=type=cache,target=${PIP_CACHE_DIR} \
python3 -m build --wheel
FROM $BASE_IMAGE
USER root
######################################################################
# All other wheels required by JupyterHub, some are platform specific
FROM $BASE_IMAGE AS wheel-builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -yq --no-install-recommends \
RUN apt-get update -qq \
&& apt-get install -yqq --no-install-recommends \
build-essential \
ca-certificates \
curl \
gnupg \
locales \
python3-dev \
python3-pip \
python3-pycurl \
nodejs \
npm \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
python3-venv \
&& python3 -m pip install --no-cache-dir --upgrade setuptools pip build wheel
ENV SHELL=/bin/bash \
WORKDIR /src/jupyterhub
COPY --from=jupyterhub-builder /src/jupyterhub/dist/*.whl /src/jupyterhub/dist/
ARG PIP_CACHE_DIR=/tmp/pip-cache
RUN --mount=type=cache,target=${PIP_CACHE_DIR} \
python3 -m pip wheel --wheel-dir wheelhouse dist/*.whl
######################################################################
# The final JupyterHub image, platform specific
FROM $BASE_IMAGE AS jupyterhub
ENV DEBIAN_FRONTEND=noninteractive \
SHELL=/bin/bash \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8
RUN locale-gen $LC_ALL
# always make sure pip is up to date!
RUN python3 -m pip install --no-cache --upgrade setuptools pip
RUN npm install -g configurable-http-proxy@^4.2.0 \
&& rm -rf ~/.npm
# install the wheels we built in the first stage
COPY --from=builder /src/jupyterhub/wheelhouse /tmp/wheelhouse
RUN python3 -m pip install --no-cache /tmp/wheelhouse/*
RUN mkdir -p /srv/jupyterhub/
WORKDIR /srv/jupyterhub/
LANGUAGE=en_US.UTF-8 \
PYTHONDONTWRITEBYTECODE=1
EXPOSE 8000
LABEL maintainer="Jupyter Project <jupyter@googlegroups.com>"
LABEL org.jupyter.service="jupyterhub"
WORKDIR /srv/jupyterhub
RUN apt-get update -qq \
&& apt-get install -yqq --no-install-recommends \
ca-certificates \
curl \
gnupg \
locales \
python-is-python3 \
python3-pip \
python3-pycurl \
nodejs \
npm \
&& locale-gen $LC_ALL \
&& npm install -g configurable-http-proxy@^4.2.0 \
# clean cache and logs
&& rm -rf /var/lib/apt/lists/* /var/log/* /var/tmp/* ~/.npm
# install the wheels we built in the previous stage
RUN --mount=type=cache,from=wheel-builder,source=/src/jupyterhub/wheelhouse,target=/tmp/wheelhouse \
# always make sure pip is up to date!
python3 -m pip install --no-compile --no-cache-dir --upgrade setuptools pip \
&& python3 -m pip install --no-compile --no-cache-dir /tmp/wheelhouse/*
CMD ["jupyterhub"]

View File

@@ -8,22 +8,12 @@
---
Please note that this repository is participating in a study into the sustainability of open source projects. Data will be gathered about this repository for approximately the next 12 months, starting from 2021-06-11.
Data collected will include the number of contributors, number of PRs, time taken to close/merge these PRs, and issues closed.
For more information, please visit
[our informational page](https://sustainable-open-science-and-software.github.io/) or download our [participant information sheet](https://sustainable-open-science-and-software.github.io/assets/PIS_sustainable_software.pdf).
---
# [JupyterHub](https://github.com/jupyterhub/jupyterhub)
[![Latest PyPI version](https://img.shields.io/pypi/v/jupyterhub?logo=pypi)](https://pypi.python.org/pypi/jupyterhub)
[![Latest conda-forge version](https://img.shields.io/conda/vn/conda-forge/jupyterhub?logo=conda-forge)](https://anaconda.org/conda-forge/jupyterhub)
[![Documentation build status](https://img.shields.io/readthedocs/jupyterhub?logo=read-the-docs)](https://jupyterhub.readthedocs.org/en/latest/)
[![GitHub Workflow Status - Test](https://img.shields.io/github/workflow/status/jupyterhub/jupyterhub/Test?logo=github&label=tests)](https://github.com/jupyterhub/jupyterhub/actions)
[![DockerHub build status](https://img.shields.io/docker/build/jupyterhub/jupyterhub?logo=docker&label=build)](https://hub.docker.com/r/jupyterhub/jupyterhub/tags)
[![Test coverage of code](https://codecov.io/gh/jupyterhub/jupyterhub/branch/main/graph/badge.svg)](https://codecov.io/gh/jupyterhub/jupyterhub)
[![GitHub](https://img.shields.io/badge/issue_tracking-github-blue?logo=github)](https://github.com/jupyterhub/jupyterhub/issues)
[![Discourse](https://img.shields.io/badge/help_forum-discourse-blue?logo=discourse)](https://discourse.jupyter.org/c/jupyterhub)
@@ -127,7 +117,7 @@ more configuration of the system.
## Configuration
The [Getting Started](https://jupyterhub.readthedocs.io/en/latest/getting-started/index.html) section of the
The [Getting Started](https://jupyterhub.readthedocs.io/en/latest/tutorial/index.html#getting-started) section of the
documentation explains the common steps in setting up JupyterHub.
The [**JupyterHub tutorial**](https://github.com/jupyterhub/jupyterhub-tutorial)
@@ -169,10 +159,10 @@ To start the Hub on a specific url and port `10.0.1.2:443` with **https**:
## Docker
A starter [**docker image for JupyterHub**](https://hub.docker.com/r/jupyterhub/jupyterhub/)
A starter [**docker image for JupyterHub**](https://quay.io/repository/jupyterhub/jupyterhub)
gives a baseline deployment of JupyterHub using Docker.
**Important:** This `jupyterhub/jupyterhub` image contains only the Hub itself,
**Important:** This `quay.io/jupyterhub/jupyterhub` image contains only the Hub itself,
with no configuration. In general, one needs to make a derivative image, with
at least a `jupyterhub_config.py` setting up an Authenticator and/or a Spawner.
To run the single-user servers, which may be on the same system as the Hub or
@@ -180,7 +170,7 @@ not, Jupyter Notebook version 4 or greater must be installed.
The JupyterHub docker image can be started with the following command:
docker run -p 8000:8000 -d --name jupyterhub jupyterhub/jupyterhub jupyterhub
docker run -p 8000:8000 -d --name jupyterhub quay.io/jupyterhub/jupyterhub jupyterhub
This command will create a container named `jupyterhub` that you can
**stop and resume** with `docker stop/start`.
@@ -239,9 +229,9 @@ You can also talk with us on our JupyterHub [Gitter](https://gitter.im/jupyterhu
- [Reporting Issues](https://github.com/jupyterhub/jupyterhub/issues)
- [JupyterHub tutorial](https://github.com/jupyterhub/jupyterhub-tutorial)
- [Documentation for JupyterHub](https://jupyterhub.readthedocs.io/en/latest/) | [PDF (latest)](https://media.readthedocs.org/pdf/jupyterhub/latest/jupyterhub.pdf) | [PDF (stable)](https://media.readthedocs.org/pdf/jupyterhub/stable/jupyterhub.pdf)
- [Documentation for JupyterHub](https://jupyterhub.readthedocs.io/en/latest/)
- [Documentation for JupyterHub's REST API][rest api]
- [Documentation for Project Jupyter](http://jupyter.readthedocs.io/en/latest/index.html) | [PDF](https://media.readthedocs.org/pdf/jupyter/latest/jupyter.pdf)
- [Documentation for Project Jupyter](http://jupyter.readthedocs.io/en/latest/index.html)
- [Project Jupyter website](https://jupyter.org)
- [Project Jupyter community](https://jupyter.org/community)

View File

@@ -2,19 +2,35 @@
# Check that installed package contains everything we expect
import os
from pathlib import Path
import jupyterhub
from jupyterhub._data import DATA_FILES_PATH
print("Checking jupyterhub._data")
print(f"DATA_FILES_PATH={DATA_FILES_PATH}")
assert os.path.exists(DATA_FILES_PATH), DATA_FILES_PATH
print("Checking jupyterhub._data", end=" ")
print(f"DATA_FILES_PATH={DATA_FILES_PATH}", end=" ")
DATA_FILES_PATH = Path(DATA_FILES_PATH)
assert DATA_FILES_PATH.is_dir(), DATA_FILES_PATH
for subpath in (
"templates/page.html",
"templates/spawn.html",
"static/css/style.min.css",
"static/components/jquery/dist/jquery.js",
"static/js/admin-react.js",
):
path = os.path.join(DATA_FILES_PATH, subpath)
assert os.path.exists(path), path
path = DATA_FILES_PATH / subpath
assert path.is_file(), path
print("OK")
print("Checking package_data", end=" ")
jupyterhub_path = Path(jupyterhub.__file__).parent.resolve()
for subpath in (
"alembic.ini",
"alembic/versions/833da8570507_rbac.py",
"event-schemas/server-actions/v1.yaml",
"singleuser/templates/page.html",
):
path = jupyterhub_path / subpath
assert path.is_file(), path
print("OK")

View File

@@ -3,7 +3,7 @@
# This should only be used for demo or testing and not as a base image to build on.
#
# It includes the notebook package and it uses the DummyAuthenticator and the SimpleLocalProcessSpawner.
ARG BASE_IMAGE=jupyterhub/jupyterhub-onbuild
ARG BASE_IMAGE=quay.io/jupyterhub/jupyterhub-onbuild
FROM ${BASE_IMAGE}
# Install the notebook package

View File

@@ -1,14 +0,0 @@
FROM alpine:3.13
ENV LANG=en_US.UTF-8
RUN apk add --no-cache \
python3 \
py3-pip \
py3-ruamel.yaml \
py3-cryptography \
py3-sqlalchemy
ARG JUPYTERHUB_VERSION=1.3.0
RUN pip3 install --no-cache jupyterhub==${JUPYTERHUB_VERSION}
USER nobody
CMD ["jupyterhub"]

View File

@@ -1,22 +0,0 @@
## What is Dockerfile.alpine
Dockerfile.alpine contains the base image for jupyterhub. It does not work independently, but only as part of a full jupyterhub cluster
## How to use it?
You will need:
1. A running configurable-http-proxy, whose API is accessible.
2. A jupyterhub_config file.
3. Authentication and other libraries required by the specific jupyterhub_config file.
## Steps to test it outside a cluster
- start configurable-http-proxy in another container
- specify CONFIGPROXY_AUTH_TOKEN env in both containers
- put both containers on the same network (e.g. docker network create jupyterhub; docker run ... --net jupyterhub)
- tell jupyterhub where CHP is (e.g. c.ConfigurableHTTPProxy.api_url = 'http://chp:8001')
- tell jupyterhub not to start the proxy itself (c.ConfigurableHTTPProxy.should_start = False)
- Use a dummy authenticator for ease of testing. Update following in jupyterhub_config file
- c.JupyterHub.authenticator_class = 'dummyauthenticator.DummyAuthenticator'
- c.DummyAuthenticator.password = "your strong password"

View File

@@ -1,212 +1,62 @@
# Makefile for Sphinx documentation
#
# Makefile for Sphinx documentation generated by sphinx-quickstart
# ----------------------------------------------------------------------------
# You can set these variables from the command line.
SPHINXOPTS = "-W"
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = build
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?= --color -W --keep-going
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " applehelp to make an Apple Help Book"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to run coverage check of the documentation (if enabled)"
@echo " spelling to run spell check on documentation"
@echo " metrics to generate documentation for metrics by inspecting the source code"
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)
clean:
rm -rf $(BUILDDIR)/*
.PHONY: help Makefile metrics scopes
metrics: source/reference/metrics.rst
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option.
#
# Several sphinx-build commands can be used through this, for example:
#
# - make clean
# - make linkcheck
# - make spelling
#
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)
source/reference/metrics.rst: generate-metrics.py
python3 generate-metrics.py
scopes: source/rbac/scope-table.md
# Manually added targets - related to code generation
# ----------------------------------------------------------------------------
source/rbac/scope-table.md: source/rbac/generate-scope-table.py
python3 source/rbac/generate-scope-table.py
# If the pre-requisites for the html target is updated, also update the Read The
# Docs section in docs/source/conf.py.
# For local development:
# - builds the html
# - NOTE: If the pre-requisites for the html target is updated, also update the
# Read The Docs section in docs/source/conf.py.
#
html: metrics scopes
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
$(SPHINXBUILD) -b html "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS)
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
metrics: source/reference/metrics.md
source/reference/metrics.md:
python3 generate-metrics.py
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
scopes: source/rbac/scope-table.md
source/rbac/scope-table.md:
python3 source/rbac/generate-scope-table.py
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
# Manually added targets - related to development
# ----------------------------------------------------------------------------
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/JupyterHub.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/JupyterHub.qhc"
applehelp:
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
@echo
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
@echo "N.B. You won't be able to view it unless you put it in" \
"~/Library/Documentation/Help or install it in your application" \
"bundle."
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/JupyterHub"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/JupyterHub"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
latexpdfja:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
spelling:
$(SPHINXBUILD) -b spelling $(ALLSPHINXOPTS) $(BUILDDIR)/spelling
@echo
@echo "Spell check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/spelling/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
coverage:
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
@echo "Testing of coverage in the sources finished, look at the " \
"results in $(BUILDDIR)/coverage/python.txt."
xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
# For local development:
# - requires sphinx-autobuild, see
# https://sphinxcontrib-spelling.readthedocs.io/en/latest/
# - builds and rebuilds html on changes to source, but does not re-generate
# metrics/scopes files
# - starts a livereload enabled webserver and opens up a browser
devenv: html
sphinx-autobuild -b html --open-browser "$(SOURCEDIR)" "$(BUILDDIR)/html"

View File

@@ -1,7 +1,6 @@
import os
from pytablewriter import RstSimpleTableWriter
from pytablewriter.style import Style
from pytablewriter import MarkdownTableWriter
import jupyterhub.metrics
@@ -11,12 +10,11 @@ HERE = os.path.abspath(os.path.dirname(__file__))
class Generator:
@classmethod
def create_writer(cls, table_name, headers, values):
writer = RstSimpleTableWriter()
writer = MarkdownTableWriter()
writer.table_name = table_name
writer.headers = headers
writer.value_matrix = values
writer.margin = 1
[writer.set_style(header, Style(align="center")) for header in headers]
return writer
def _parse_metrics(self):
@@ -33,18 +31,17 @@ class Generator:
if not os.path.exists(generated_directory):
os.makedirs(generated_directory)
filename = f"{generated_directory}/metrics.rst"
filename = f"{generated_directory}/metrics.md"
table_name = ""
headers = ["Type", "Name", "Description"]
values = self._parse_metrics()
writer = self.create_writer(table_name, headers, values)
title = "List of Prometheus Metrics"
underline = "============================"
content = f"{title}\n{underline}\n{writer.dumps()}"
with open(filename, 'w') as f:
f.write(content)
print(f"Generated {filename}.")
f.write("# List of Prometheus Metrics\n\n")
f.write(writer.dumps())
f.write("\n")
print(f"Generated {filename}")
def main():

View File

@@ -1,263 +1,49 @@
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=--color -W --keep-going
)
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set BUILDDIR=build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source
set I18NSPHINXOPTS=%SPHINXOPTS% source
if NOT "%PAPER%" == "" (
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
)
set SOURCEDIR=source
set BUILDDIR=_build
if "%1" == "" goto help
if "%1" == "help" (
:help
echo.Please use `make ^<target^>` where ^<target^> is one of
echo. html to make standalone HTML files
echo. dirhtml to make HTML files named index.html in directories
echo. singlehtml to make a single large HTML file
echo. pickle to make pickle files
echo. json to make JSON files
echo. htmlhelp to make HTML files and a HTML help project
echo. qthelp to make HTML files and a qthelp project
echo. devhelp to make HTML files and a Devhelp project
echo. epub to make an epub
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
echo. text to make text files
echo. man to make manual pages
echo. texinfo to make Texinfo files
echo. gettext to make PO message catalogs
echo. changes to make an overview over all changed/added/deprecated items
echo. xml to make Docutils-native XML files
echo. pseudoxml to make pseudoxml-XML files for display purposes
echo. linkcheck to check all external links for integrity
echo. doctest to run all doctests embedded in the documentation if enabled
echo. coverage to run coverage check of the documentation if enabled
goto end
)
if "%1" == "clean" (
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
del /q /s %BUILDDIR%\*
goto end
)
if "%1" == "devenv" goto devenv
goto default
REM Check if sphinx-build is available and fallback to Python version if any
%SPHINXBUILD% 1>NUL 2>NUL
if errorlevel 9009 goto sphinx_python
goto sphinx_ok
:sphinx_python
set SPHINXBUILD=python -m sphinx.__init__
%SPHINXBUILD% 2> nul
:default
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
echo.The 'sphinx-build' command was not found. Open and read README.md!
exit /b 1
)
:sphinx_ok
%SPHINXBUILD% -M %1 "%SOURCEDIR%" "%BUILDDIR%" %SPHINXOPTS%
goto end
if "%1" == "html" (
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
if errorlevel 1 exit /b 1
:help
%SPHINXBUILD% -M help "%SOURCEDIR%" "%BUILDDIR%" %SPHINXOPTS%
goto end
:devenv
sphinx-autobuild >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
goto end
echo.The 'sphinx-autobuild' command was not found. Open and read README.md!
exit /b 1
)
sphinx-autobuild -b html --open-browser "%SOURCEDIR%" "%BUILDDIR%/html"
goto end
if "%1" == "dirhtml" (
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
goto end
)
if "%1" == "singlehtml" (
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
goto end
)
if "%1" == "pickle" (
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the pickle files.
goto end
)
if "%1" == "json" (
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the JSON files.
goto end
)
if "%1" == "htmlhelp" (
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
goto end
)
if "%1" == "qthelp" (
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\JupyterHub.qhcp
echo.To view the help file:
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\JupyterHub.ghc
goto end
)
if "%1" == "devhelp" (
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished.
goto end
)
if "%1" == "epub" (
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The epub file is in %BUILDDIR%/epub.
goto end
)
if "%1" == "latex" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
if errorlevel 1 exit /b 1
echo.
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "latexpdf" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
cd %BUILDDIR%/latex
make all-pdf
cd %~dp0
echo.
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "latexpdfja" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
cd %BUILDDIR%/latex
make all-pdf-ja
cd %~dp0
echo.
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "text" (
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The text files are in %BUILDDIR%/text.
goto end
)
if "%1" == "man" (
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The manual pages are in %BUILDDIR%/man.
goto end
)
if "%1" == "texinfo" (
%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
goto end
)
if "%1" == "gettext" (
%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
goto end
)
if "%1" == "changes" (
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
if errorlevel 1 exit /b 1
echo.
echo.The overview file is in %BUILDDIR%/changes.
goto end
)
if "%1" == "linkcheck" (
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
if errorlevel 1 exit /b 1
echo.
echo.Link check complete; look for any errors in the above output ^
or in %BUILDDIR%/linkcheck/output.txt.
goto end
)
if "%1" == "doctest" (
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
if errorlevel 1 exit /b 1
echo.
echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
goto end
)
if "%1" == "coverage" (
%SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage
if errorlevel 1 exit /b 1
echo.
echo.Testing of coverage in the sources finished, look at the ^
results in %BUILDDIR%/coverage/python.txt.
goto end
)
if "%1" == "xml" (
%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The XML files are in %BUILDDIR%/xml.
goto end
)
if "%1" == "pseudoxml" (
%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
goto end
)
:end
popd

View File

@@ -9,9 +9,9 @@
--editable .
autodoc-traits
myst-parser
jupyterhub-sphinx-theme
myst-parser>=0.19
pre-commit
pydata-sphinx-theme
pytablewriter>=0.56
ruamel.yaml
sphinx>=4

View File

@@ -6,7 +6,7 @@ info:
description: The REST API for JupyterHub
license:
name: BSD-3-Clause
version: 3.1.0
version: 4.1.0
servers:
- url: /hub/api
security:
@@ -562,9 +562,10 @@ paths:
properties:
expires_in:
type: number
example: 3600
description:
lifetime (in seconds) after which the requested token
will expire.
will expire. Omit, or specify null or 0 for no expiration.
note:
type: string
description: A note attached to the token for future bookkeeping
@@ -815,6 +816,39 @@ paths:
- oauth2:
- groups
x-codegen-request-body-name: body
/groups/{name}/properties:
put:
summary: |
Set the group properties.
Added in JupyterHub 3.2.
parameters:
- name: name
in: path
description: group name
required: true
schema:
type: string
requestBody:
description: The new group properties, as a JSON dict.
content:
application/json:
schema:
type: object
required: true
responses:
200:
description: |
The properties have been updated.
The updated group model is returned.
content:
application/json:
schema:
$ref: "#/components/schemas/Group"
security:
- oauth2:
- groups
x-codegen-request-body-name: body
/services:
get:
summary: List services
@@ -1169,13 +1203,13 @@ components:
description: Timestamp of last-seen activity from the user
format: date-time
servers:
type: array
type: object
description: |
The servers for this user.
By default: only includes _active_ servers.
Changed in 3.0: if `?include_stopped_servers` parameter is specified,
stopped servers will be included as well.
items:
additionalProperties:
$ref: "#/components/schemas/Server"
auth_state:
type: object
@@ -1289,6 +1323,15 @@ components:
description: The names of users who are members of this group
items:
type: string
properties:
type: object
description: |
Group properties (a dictionary).
Unused by JupyterHub itself,
but an extension point to store information about groups.
Added in JupyterHub 3.2.
roles:
type: array
description: The names of roles this group has

View File

@@ -1,155 +0,0 @@
====================
Upgrading JupyterHub
====================
JupyterHub offers easy upgrade pathways between minor versions. This
document describes how to do these upgrades.
If you are using :ref:`a JupyterHub distribution <index/distributions>`, you
should consult the distribution's documentation on how to upgrade. This documentation is
for those who have set up their JupyterHub without using a distribution.
This documentation is lengthy because it is quite detailed. Most likely, upgrading
JupyterHub is painless, quick and with minimal user interruption.
The steps are discussed in detail, so if you get stuck at any step you can always refer to this guide.
Read the Changelog
==================
The `changelog <../changelog.md>`_ contains information on what has
changed with the new JupyterHub release and any deprecation warnings.
Read these notes to familiarize yourself with the coming changes. There
might be new releases of the authenticators & spawners you use, so
read the changelogs for those too!
Notify your users
=================
If you use the default configuration where ``configurable-http-proxy``
is managed by JupyterHub, your users will see service disruption during
the upgrade process. You should notify them, and pick a time to do the
upgrade where they will be least disrupted.
If you use a different proxy or run ``configurable-http-proxy``
independent of JupyterHub, your users will be able to continue using notebook
servers they had already launched, but will not be able to launch new servers or sign in.
Backup database & config
========================
Before doing an upgrade, it is critical to back up:
#. Your JupyterHub database (SQLite by default, or MySQL / Postgres if you used those).
If you use SQLite (the default), you should backup the ``jupyterhub.sqlite`` file.
#. Your ``jupyterhub_config.py`` file.
#. Your users' home directories. This is unlikely to be affected directly by
a JupyterHub upgrade, but we recommend a backup since user data is critical.
Shut down JupyterHub
====================
Shut down the JupyterHub process. This would vary depending on how you
have set up JupyterHub to run. It is most likely using a process
supervisor of some sort (``systemd`` or ``supervisord`` or even ``docker``).
Use the supervisor-specific command to stop the JupyterHub process.
Upgrade JupyterHub packages
===========================
There are two environments where the ``jupyterhub`` package is installed:
#. The *hub environment*: where the JupyterHub server process
runs. This is started with the ``jupyterhub`` command, and is what
people generally think of as JupyterHub.
#. The *notebook user environments*: where the user notebook
servers are launched from, and is probably custom to your own
installation. This could be just one environment (different from the
hub environment) that is shared by all users, one environment
per user, or the same environment as the hub environment. The hub
launched the ``jupyterhub-singleuser`` command in this environment,
which in turn starts the notebook server.
You need to make sure the version of the ``jupyterhub`` package matches
in both these environments. If you installed ``jupyterhub`` with pip,
you can upgrade it with:
.. code-block:: bash
python3 -m pip install --upgrade jupyterhub==<version>
Where ``<version>`` is the version of JupyterHub you are upgrading to.
If you used ``conda`` to install ``jupyterhub``, you should upgrade it
with:
.. code-block:: bash
conda install -c conda-forge jupyterhub==<version>
You should also check for new releases of the authenticator & spawner you
are using. You might wish to upgrade those packages, too, along with JupyterHub
or upgrade them separately.
Upgrade JupyterHub database
===========================
Once new packages are installed, you need to upgrade the JupyterHub
database. From the hub environment, in the same directory as your
``jupyterhub_config.py`` file, you should run:
.. code-block:: bash
jupyterhub upgrade-db
This should find the location of your database, and run the necessary upgrades
for it.
SQLite database disadvantages
-----------------------------
SQLite has some disadvantages when it comes to upgrading JupyterHub. These
are:
- ``upgrade-db`` may not work, and you may need to delete your database
and start with a fresh one.
- ``downgrade-db`` **will not** work if you want to rollback to an
earlier version, so backup the ``jupyterhub.sqlite`` file before
upgrading.
What happens if I delete my database?
-------------------------------------
Losing the Hub database is often not a big deal. Information that
resides only in the Hub database includes:
- active login tokens (user cookies, service tokens)
- users added via JupyterHub UI, instead of config files
- info about running servers
If the following conditions are true, you should be fine clearing the
Hub database and starting over:
- users specified in the config file, or login using an external
authentication provider (Google, GitHub, LDAP, etc)
- user servers are stopped during the upgrade
- don't mind causing users to log in again after the upgrade
Start JupyterHub
================
Once the database upgrade is completed, start the ``jupyterhub``
process again.
#. Log in and start the server to make sure things work as
expected.
#. Check the logs for any errors or deprecation warnings. You
might have to update your ``jupyterhub_config.py`` file to
deal with any deprecated options.
Congratulations, your JupyterHub has been upgraded!

View File

@@ -1,15 +0,0 @@
=========================
Application configuration
=========================
Module: :mod:`jupyterhub.app`
=============================
.. automodule:: jupyterhub.app
.. currentmodule:: jupyterhub.app
:class:`JupyterHub`
-------------------
.. autoconfigurable:: JupyterHub

View File

@@ -1,32 +0,0 @@
==============
Authenticators
==============
Module: :mod:`jupyterhub.auth`
==============================
.. automodule:: jupyterhub.auth
.. currentmodule:: jupyterhub.auth
:class:`Authenticator`
----------------------
.. autoconfigurable:: Authenticator
:members:
:class:`LocalAuthenticator`
---------------------------
.. autoconfigurable:: LocalAuthenticator
:members:
:class:`PAMAuthenticator`
-------------------------
.. autoconfigurable:: PAMAuthenticator
:class:`DummyAuthenticator`
---------------------------
.. autoconfigurable:: DummyAuthenticator

View File

@@ -1,33 +0,0 @@
.. _api-index:
##############
JupyterHub API
##############
:Release: |release|
:Date: |today|
JupyterHub also provides a REST API for administration of the Hub and users.
The documentation on `Using JupyterHub's REST API <../reference/rest.html>`_ provides
information on:
- what you can do with the API
- creating an API token
- adding API tokens to the config files
- making an API request programmatically using the requests library
- learning more about JupyterHub's API
JupyterHub API Reference:
.. toctree::
app
auth
spawner
proxy
user
service
services.auth
.. _OpenAPI Initiative: https://www.openapis.org/

View File

@@ -1,22 +0,0 @@
=======
Proxies
=======
Module: :mod:`jupyterhub.proxy`
===============================
.. automodule:: jupyterhub.proxy
.. currentmodule:: jupyterhub.proxy
:class:`Proxy`
--------------
.. autoconfigurable:: Proxy
:members:
:class:`ConfigurableHTTPProxy`
------------------------------
.. autoconfigurable:: ConfigurableHTTPProxy
:members: debug, auth_token, check_running_interval, api_url, command

View File

@@ -1,16 +0,0 @@
========
Services
========
Module: :mod:`jupyterhub.services.service`
==========================================
.. automodule:: jupyterhub.services.service
.. currentmodule:: jupyterhub.services.service
:class:`Service`
----------------
.. autoconfigurable:: Service
:members: name, admin, url, api_token, managed, kind, command, cwd, environment, user, oauth_client_id, server, prefix, proxy_spec

View File

@@ -1,40 +0,0 @@
=======================
Services Authentication
=======================
Module: :mod:`jupyterhub.services.auth`
=======================================
.. automodule:: jupyterhub.services.auth
.. currentmodule:: jupyterhub.services.auth
:class:`HubAuth`
----------------
.. autoconfigurable:: HubAuth
:members:
:class:`HubOAuth`
-----------------
.. autoconfigurable:: HubOAuth
:members:
:class:`HubAuthenticated`
-------------------------
.. autoclass:: HubAuthenticated
:members:
:class:`HubOAuthenticated`
--------------------------
.. autoclass:: HubOAuthenticated
:class:`HubOAuthCallbackHandler`
--------------------------------
.. autoclass:: HubOAuthCallbackHandler

View File

@@ -1,21 +0,0 @@
========
Spawners
========
Module: :mod:`jupyterhub.spawner`
=================================
.. automodule:: jupyterhub.spawner
.. currentmodule:: jupyterhub.spawner
:class:`Spawner`
----------------
.. autoconfigurable:: Spawner
:members: options_from_form, poll, start, stop, get_args, get_env, get_state, template_namespace, format_string, create_certs, move_certs
:class:`LocalProcessSpawner`
----------------------------
.. autoconfigurable:: LocalProcessSpawner

View File

@@ -1,36 +0,0 @@
=====
Users
=====
Module: :mod:`jupyterhub.user`
==============================
.. automodule:: jupyterhub.user
.. currentmodule:: jupyterhub.user
:class:`UserDict`
-----------------
.. autoclass:: UserDict
:members:
:class:`User`
-------------
.. autoclass:: User
:members: escaped_name
.. attribute:: name
The user's name
.. attribute:: server
The user's Server data object if running, None otherwise.
Has ``ip``, ``port`` attributes.
.. attribute:: spawner
The user's :class:`~.Spawner` instance.

View File

@@ -20,8 +20,6 @@ from jupyterhub.app import JupyterHub
project = "JupyterHub"
author = "Project Jupyter Contributors"
copyright = f"{datetime.date.today().year}, {author}"
version = "%i.%i" % jupyterhub.version_info[:2]
release = jupyterhub.__version__
# -- General Sphinx configuration --------------------------------------------
@@ -36,10 +34,11 @@ extensions = [
"sphinx-jsonschema",
"sphinxext.opengraph",
"sphinxext.rediraffe",
"jupyterhub_sphinx_theme",
"myst_parser",
]
root_doc = "index"
source_suffix = [".md", ".rst"]
source_suffix = [".md"]
# default_role let's use use `foo` instead of ``foo`` in rST
default_role = "literal"
@@ -48,11 +47,22 @@ default_role = "literal"
# ref: https://myst-parser.readthedocs.io/en/latest/configuration.html
#
myst_heading_anchors = 2
myst_enable_extensions = [
# available extensions: https://myst-parser.readthedocs.io/en/latest/syntax/optional.html
"attrs_inline",
"colon_fence",
"deflist",
"fieldlist",
"substitution",
]
myst_substitutions = {
# date example: Dev 07, 2022
"date": datetime.date.today().strftime("%b %d, %Y").title(),
"version": jupyterhub.__version__,
}
# -- Custom directives to generate documentation -----------------------------
# ref: https://myst-parser.readthedocs.io/en/latest/syntax/roles-and-directives.html
@@ -146,18 +156,13 @@ html_logo = "_static/images/logo/logo.png"
html_favicon = "_static/images/logo/favicon.ico"
html_static_path = ["_static"]
html_theme = "pydata_sphinx_theme"
html_theme = "jupyterhub_sphinx_theme"
html_theme_options = {
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/jupyterhub/jupyterhub",
"icon": "fab fa-github-square",
},
{
"name": "Discourse",
"url": "https://discourse.jupyter.org/c/jupyterhub/10",
"icon": "fab fa-discourse",
"icon": "fa-brands fa-github",
},
],
"use_edit_page_button": True,
@@ -180,20 +185,27 @@ linkcheck_ignore = [
r"https://github.com/[^/]*$", # too many github usernames / searches in changelog
"https://github.com/jupyterhub/jupyterhub/pull/", # too many PRs in changelog
"https://github.com/jupyterhub/jupyterhub/compare/", # too many comparisons in changelog
r"https?://(localhost|127.0.0.1).*", # ignore localhost references in auto-links
r".*/rest-api.html#.*", # ignore javascript-resolved internal rest-api links
r"https://linux.die.net/.*", # linux.die.net seems to block requests from CI with 403 sometimes
# don't check links to unpublished advisories
r"https://github.com/jupyterhub/jupyterhub/security/advisories/.*",
]
linkcheck_anchors_ignore = [
"/#!",
"/#%21",
]
# -- Intersphinx -------------------------------------------------------------
# ref: https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#configuration
#
intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"tornado": ("https://www.tornadoweb.org/en/stable/", None),
"jupyter-server": ("https://jupyter-server.readthedocs.io/en/stable/", None),
"nbgitpuller": ("https://nbgitpuller.readthedocs.io/en/latest", None),
}
# -- Options for the opengraph extension -------------------------------------
# ref: https://github.com/wpilibsuite/sphinxext-opengraph#options
#
@@ -205,11 +217,33 @@ ogp_use_first_image = True
# -- Options for the rediraffe extension -------------------------------------
# ref: https://github.com/wpilibsuite/sphinxext-rediraffe#readme
#
# This extensions help us relocated content without breaking links. If a
# document is moved internally, a redirect like should be configured below to
# This extension helps us relocate content without breaking links. If a
# document is moved internally, a redirect link should be configured as below to
# help us not break links.
#
rediraffe_branch = "main"
rediraffe_redirects = {
# "old-file": "new-folder/new-file-name",
}
# The workflow for adding redirects can be as follows:
# 1. Change "rediraffe_branch" below to point to the commit/ branch you
# want to base off the changes.
# 2. Option 1: run "make rediraffecheckdiff"
# a. Analyze the output of this command.
# b. Manually add the redirect entries to the "redirects.txt" file.
# Option 2: run "make rediraffewritediff"
# a. rediraffe will then automatically add the obvious redirects to redirects.txt.
# b. Analyze the output of the command for broken links.
# c. Check the "redirects.txt" file for any files that were moved/ renamed but are not listed.
# d. Manually add the redirects that have been mised by the automatic builder to "redirects.txt".
# Option 3: Do not use the commands above and, instead, do everything manually - by taking
# note of the files you have moved or renamed and adding them to the "redirects.txt" file.
#
# If you are basing changes off another branch/ commit, always change back
# rediraffe_branch to main before pushing your changes upstream.
#
rediraffe_branch = os.environ.get("REDIRAFFE_BRANCH", "main")
rediraffe_redirects = "redirects.txt"
# allow 80% match for autogenerated redirects
rediraffe_auto_redirect_perc = 80
# rediraffe_redirects = {
# "old-file": "new-folder/new-file-name",
# }

View File

@@ -19,7 +19,7 @@ We use [our Gitter channel](https://gitter.im/jupyterhub/jupyterhub) for online,
[Github issues](https://docs.github.com/en/issues/tracking-your-work-with-issues/about-issues) are used for most long-form project discussions, bug reports and feature requests.
- Issues related to a specific authenticator or spawner should be opened in the appropriate repository for the authenticator or spawner.
- If you are using a specific JupyterHub distribution (such as [Zero to JupyterHub on Kubernetes](http://github.com/jupyterhub/zero-to-jupyterhub-k8s) or [The Littlest JupyterHub](http://github.com/jupyterhub/the-littlest-jupyterhub/)), you should open issues directly in their repository.
- If you are using a specific JupyterHub distribution (such as [Zero to JupyterHub on Kubernetes](https://github.com/jupyterhub/zero-to-jupyterhub-k8s) or [The Littlest JupyterHub](https://github.com/jupyterhub/the-littlest-jupyterhub/)), you should open issues directly in their repository.
- If you cannot find a repository to open your issue in, do not worry! Open the issue in the [main JupyterHub repository](https://github.com/jupyterhub/jupyterhub/) and our community will help you figure it out.
```{note}

View File

@@ -0,0 +1,76 @@
(contributing-docs)=
# Contributing Documentation
Documentation is often more important than code. This page helps
you get set up on how to contribute to JupyterHub's documentation.
## Building documentation locally
We use [sphinx](https://www.sphinx-doc.org) to build our documentation. It takes
our documentation source files (written in [markdown](https://daringfireball.net/projects/markdown/) or [reStructuredText](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html) &
stored under the `docs/source` directory) and converts it into various
formats for people to read. To make sure the documentation you write or
change renders correctly, it is good practice to test it locally.
1. Make sure you have successfully completed {ref}`contributing/setup`.
2. Install the packages required to build the docs.
```bash
python3 -m pip install -r docs/requirements.txt
```
3. Build the html version of the docs. This is the most commonly used
output format, so verifying it renders correctly is usually good
enough.
```bash
cd docs
make html
```
This step will display any syntax or formatting errors in the documentation,
along with the filename / line number in which they occurred. Fix them,
and re-run the `make html` command to re-render the documentation.
4. View the rendered documentation by opening `_build/html/index.html` in
a web browser.
:::{tip}
**On Windows**, you can open a file from the terminal with `start <path-to-file>`.
**On macOS**, you can do the same with `open <path-to-file>`.
**On Linux**, you can do the same with `xdg-open <path-to-file>`.
After opening index.html in your browser you can just refresh the page whenever
you rebuild the docs via `make html`
:::
(contributing-docs-conventions)=
## Documentation conventions
This section lists various conventions we use in our documentation. This is a
living document that grows over time, so feel free to add to it / change it!
Our entire documentation does not yet fully conform to these conventions yet,
so help in making it so would be appreciated!
### `pip` invocation
There are many ways to invoke a `pip` command, we recommend the following
approach:
```bash
python3 -m pip
```
This invokes pip explicitly using the python3 binary that you are
currently using. This is the **recommended way** to invoke pip
in our documentation, since it is least likely to cause problems
with python3 and pip being from different environments.
For more information on how to invoke `pip` commands, see
[the pip documentation](https://pip.pypa.io/en/stable/).

View File

@@ -1,84 +0,0 @@
.. _contributing/docs:
==========================
Contributing Documentation
==========================
Documentation is often more important than code. This page helps
you get set up on how to contribute to JupyterHub's documentation.
Building documentation locally
==============================
We use `sphinx <http://sphinx-doc.org>`_ to build our documentation. It takes
our documentation source files (written in `markdown
<https://daringfireball.net/projects/markdown/>`_ or `reStructuredText
<https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html>`_ &
stored under the ``docs/source`` directory) and converts it into various
formats for people to read. To make sure the documentation you write or
change renders correctly, it is good practice to test it locally.
#. Make sure you have successfully completed :ref:`contributing/setup`.
#. Install the packages required to build the docs.
.. code-block:: bash
python3 -m pip install -r docs/requirements.txt
#. Build the html version of the docs. This is the most commonly used
output format, so verifying it renders correctly is usually good
enough.
.. code-block:: bash
cd docs
make html
This step will display any syntax or formatting errors in the documentation,
along with the filename / line number in which they occurred. Fix them,
and re-run the ``make html`` command to re-render the documentation.
#. View the rendered documentation by opening ``build/html/index.html`` in
a web browser.
.. tip::
**On Windows**, you can open a file from the terminal with ``start <path-to-file>``.
**On macOS**, you can do the same with ``open <path-to-file>``.
**On Linux**, you can do the same with ``xdg-open <path-to-file>``.
After opening index.html in your browser you can just refresh the page whenever
you rebuild the docs via ``make html``
.. _contributing/docs/conventions:
Documentation conventions
=========================
This section lists various conventions we use in our documentation. This is a
living document that grows over time, so feel free to add to it / change it!
Our entire documentation does not yet fully conform to these conventions yet,
so help in making it so would be appreciated!
``pip`` invocation
------------------
There are many ways to invoke a ``pip`` command, we recommend the following
approach:
.. code-block:: bash
python3 -m pip
This invokes pip explicitly using the python3 binary that you are
currently using. This is the **recommended way** to invoke pip
in our documentation, since it is least likely to cause problems
with python3 and pip being from different environments.
For more information on how to invoke ``pip`` commands, see
`the pip documentation <https://pip.pypa.io/en/stable/>`_.

View File

@@ -0,0 +1,22 @@
# Contributing
We want you to contribute to JupyterHub in ways that are most exciting
and useful to you. We value documentation, testing, bug reporting & code equally,
and are glad to have your contributions in whatever form you wish.
Be sure to first check our [Code of Conduct](https://github.com/jupyter/governance/blob/HEAD/conduct/code_of_conduct.md)
([reporting guidelines](https://github.com/jupyter/governance/blob/HEAD/conduct/reporting_online.md)), which help keep our community welcoming to as many people as possible.
This section covers information about our community, as well as ways that you can connect and get involved.
```{toctree}
:maxdepth: 2
contributor-list
community
setup
docs
tests
roadmap
security
```

View File

@@ -1,21 +0,0 @@
============
Contributing
============
We want you to contribute to JupyterHub in ways that are most exciting
& useful to you. We value documentation, testing, bug reporting & code equally,
and are glad to have your contributions in whatever form you wish :)
Our `Code of Conduct <https://github.com/jupyter/governance/blob/HEAD/conduct/code_of_conduct.md>`_
(`reporting guidelines <https://github.com/jupyter/governance/blob/HEAD/conduct/reporting_online.md>`_)
helps keep our community welcoming to as many people as possible.
.. toctree::
:maxdepth: 2
community
setup
docs
tests
roadmap
security

View File

@@ -0,0 +1,9 @@
# Reporting security issues in Jupyter or JupyterHub
If you find a security vulnerability in Jupyter or JupyterHub,
whether it is a failure of the security model described in [Security Overview](web-security)
or a failure in implementation,
please report it to <mailto:security@ipython.org>.
If you prefer to encrypt your security reports,
you can use {download}`this PGP public key </ipython_security.asc>`.

View File

@@ -1,10 +0,0 @@
Reporting security issues in Jupyter or JupyterHub
==================================================
If you find a security vulnerability in Jupyter or JupyterHub,
whether it is a failure of the security model described in :doc:`../reference/websecurity`
or a failure in implementation,
please report it to security@ipython.org.
If you prefer to encrypt your security reports,
you can use :download:`this PGP public key </ipython_security.asc>`.

View File

@@ -0,0 +1,175 @@
(contributing/setup)=
# Setting up a development install
## System requirements
JupyterHub can only run on macOS or Linux operating systems. If you are
using Windows, we recommend using [VirtualBox](https://virtualbox.org)
or a similar system to run [Ubuntu Linux](https://ubuntu.com) for
development.
### Install Python
JupyterHub is written in the [Python](https://python.org) programming language and
requires you have at least version 3.6 installed locally. If you havent
installed Python before, the recommended way to install it is to use
[Miniforge](https://github.com/conda-forge/miniforge#download).
### Install nodejs
[NodeJS 12+](https://nodejs.org/en/) is required for building some JavaScript components.
`configurable-http-proxy`, the default proxy implementation for JupyterHub, is written in Javascript.
If you have not installed NodeJS before, we recommend installing it in the `miniconda` environment you set up for Python.
You can do so with `conda install nodejs`.
Many in the Jupyter community use \[`nvm`\](<https://github.com/nvm-sh/nvm>) to
managing node dependencies.
### Install git
JupyterHub uses [Git](https://git-scm.com) & [GitHub](https://github.com)
for development & collaboration. You need to [install git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) to work on
JupyterHub. We also recommend getting a free account on GitHub.com.
## Setting up a development install
When developing JupyterHub, you would need to make changes and be able to instantly view the results of the changes. To achieve that, a developer install is required.
:::{note}
This guide does not attempt to dictate _how_ development
environments should be isolated since that is a personal preference and can
be achieved in many ways, for example, `tox`, `conda`, `docker`, etc. See this
[forum thread](https://discourse.jupyter.org/t/thoughts-on-using-tox/3497) for
a more detailed discussion.
:::
1. Clone the [JupyterHub git repository](https://github.com/jupyterhub/jupyterhub)
to your computer.
```bash
git clone https://github.com/jupyterhub/jupyterhub
cd jupyterhub
```
2. Make sure the `python` you installed and the `npm` you installed
are available to you on the command line.
```bash
python -V
```
This should return a version number greater than or equal to 3.6.
```bash
npm -v
```
This should return a version number greater than or equal to 5.0.
3. Install `configurable-http-proxy` (required to run and test the default JupyterHub configuration) and `yarn` (required to build some components):
```bash
npm install -g configurable-http-proxy yarn
```
If you get an error that says `Error: EACCES: permission denied`, you might need to prefix the command with `sudo`.
`sudo` may be required to perform a system-wide install.
If you do not have access to sudo, you may instead run the following commands:
```bash
npm install configurable-http-proxy yarn
export PATH=$PATH:$(pwd)/node_modules/.bin
```
The second line needs to be run every time you open a new terminal.
If you are using conda you can instead run:
```bash
conda install configurable-http-proxy yarn
```
4. Install an editable version of JupyterHub and its requirements for
development and testing. This lets you edit JupyterHub code in a text editor
& restart the JupyterHub process to see your code changes immediately.
```bash
python3 -m pip install --editable ".[test]"
```
5. Set up a database.
The default database engine is `sqlite` so if you are just trying
to get up and running quickly for local development that should be
available via [Python](https://docs.python.org/3.5/library/sqlite3.html).
See [The Hub's Database](hub-database) for details on other supported databases.
6. You are now ready to start JupyterHub!
```bash
jupyterhub
```
7. You can access JupyterHub from your browser at
`http://localhost:8000` now.
Happy developing!
## Using DummyAuthenticator & SimpleLocalProcessSpawner
To simplify testing of JupyterHub, it is helpful to use
{class}`~jupyterhub.auth.DummyAuthenticator` instead of the default JupyterHub
authenticator and SimpleLocalProcessSpawner instead of the default spawner.
There is a sample configuration file that does this in
`testing/jupyterhub_config.py`. To launch JupyterHub with this
configuration:
```bash
jupyterhub -f testing/jupyterhub_config.py
```
The default JupyterHub [authenticator](PAMAuthenticator)
& [spawner](LocalProcessSpawner)
require your system to have user accounts for each user you want to log in to
JupyterHub as.
DummyAuthenticator allows you to log in with any username & password,
while SimpleLocalProcessSpawner allows you to start servers without having to
create a Unix user for each JupyterHub user. Together, these make it
much easier to test JupyterHub.
Tip: If you are working on parts of JupyterHub that are common to all
authenticators & spawners, we recommend using both DummyAuthenticator &
SimpleLocalProcessSpawner. If you are working on just authenticator-related
parts, use only SimpleLocalProcessSpawner. Similarly, if you are working on
just spawner-related parts, use only DummyAuthenticator.
## Troubleshooting
This section lists common ways setting up your development environment may
fail, and how to fix them. Please add to the list if you encounter yet
another way it can fail!
### `lessc` not found
If the `python3 -m pip install --editable .` command fails and complains about
`lessc` being unavailable, you may need to explicitly install some
additional JavaScript dependencies:
```bash
npm install
```
This will fetch client-side JavaScript dependencies necessary to compile
CSS.
You may also need to manually update JavaScript and CSS after some
development updates, with:
```bash
python3 setup.py js # fetch updated client-side js
python3 setup.py css # recompile CSS from LESS sources
python3 setup.py jsx # build React admin app
```

View File

@@ -1,187 +0,0 @@
.. _contributing/setup:
================================
Setting up a development install
================================
System requirements
===================
JupyterHub can only run on macOS or Linux operating systems. If you are
using Windows, we recommend using `VirtualBox <https://virtualbox.org>`_
or a similar system to run `Ubuntu Linux <https://ubuntu.com>`_ for
development.
Install Python
--------------
JupyterHub is written in the `Python <https://python.org>`_ programming language and
requires you have at least version 3.6 installed locally. If you havent
installed Python before, the recommended way to install it is to use
`Miniconda <https://conda.io/miniconda.html>`_. Remember to get the Python 3 version,
and **not** the Python 2 version!
Install nodejs
--------------
`NodeJS 12+ <https://nodejs.org/en/>`_ is required for building some JavaScript components.
``configurable-http-proxy``, the default proxy implementation for JupyterHub, is written in Javascript.
If you have not installed NodeJS before, we recommend installing it in the ``miniconda`` environment you set up for Python.
You can do so with ``conda install nodejs``.
Many in the Jupyter community use [``nvm``](https://github.com/nvm-sh/nvm) to
managing node dependencies.
Install git
-----------
JupyterHub uses `Git <https://git-scm.com>`_ & `GitHub <https://github.com>`_
for development & collaboration. You need to `install git
<https://git-scm.com/book/en/v2/Getting-Started-Installing-Git>`_ to work on
JupyterHub. We also recommend getting a free account on GitHub.com.
Setting up a development install
================================
When developing JupyterHub, you would need to make changes and be able to instantly view the results of the changes. To achieve that, a developer install is required.
.. note:: This guide does not attempt to dictate *how* development
environments should be isolated since that is a personal preference and can
be achieved in many ways, for example, `tox`, `conda`, `docker`, etc. See this
`forum thread <https://discourse.jupyter.org/t/thoughts-on-using-tox/3497>`_ for
a more detailed discussion.
1. Clone the `JupyterHub git repository <https://github.com/jupyterhub/jupyterhub>`_
to your computer.
.. code:: bash
git clone https://github.com/jupyterhub/jupyterhub
cd jupyterhub
2. Make sure the ``python`` you installed and the ``npm`` you installed
are available to you on the command line.
.. code:: bash
python -V
This should return a version number greater than or equal to 3.6.
.. code:: bash
npm -v
This should return a version number greater than or equal to 5.0.
3. Install ``configurable-http-proxy`` (required to run and test the default JupyterHub configuration) and ``yarn`` (required to build some components):
.. code:: bash
npm install -g configurable-http-proxy yarn
If you get an error that says ``Error: EACCES: permission denied``, you might need to prefix the command with ``sudo``.
``sudo`` may be required to perform a system-wide install.
If you do not have access to sudo, you may instead run the following commands:
.. code:: bash
npm install configurable-http-proxy yarn
export PATH=$PATH:$(pwd)/node_modules/.bin
The second line needs to be run every time you open a new terminal.
If you are using conda you can instead run:
.. code:: bash
conda install configurable-http-proxy yarn
4. Install an editable version of JupyterHub and its requirements for
development and testing. This lets you edit JupyterHub code in a text editor
& restart the JupyterHub process to see your code changes immediately.
.. code:: bash
python3 -m pip install --editable ".[test]"
5. Set up a database.
The default database engine is ``sqlite`` so if you are just trying
to get up and running quickly for local development that should be
available via `Python <https://docs.python.org/3.5/library/sqlite3.html>`__.
See :doc:`/reference/database` for details on other supported databases.
6. You are now ready to start JupyterHub!
.. code:: bash
jupyterhub
7. You can access JupyterHub from your browser at
``http://localhost:8000`` now.
Happy developing!
Using DummyAuthenticator & SimpleLocalProcessSpawner
====================================================
To simplify testing of JupyterHub, it is helpful to use
:class:`~jupyterhub.auth.DummyAuthenticator` instead of the default JupyterHub
authenticator and SimpleLocalProcessSpawner instead of the default spawner.
There is a sample configuration file that does this in
``testing/jupyterhub_config.py``. To launch JupyterHub with this
configuration:
.. code:: bash
jupyterhub -f testing/jupyterhub_config.py
The default JupyterHub `authenticator
<https://jupyterhub.readthedocs.io/en/stable/reference/authenticators.html#the-default-pam-authenticator>`_
& `spawner
<https://jupyterhub.readthedocs.io/en/stable/api/spawner.html#localprocessspawner>`_
require your system to have user accounts for each user you want to log in to
JupyterHub as.
DummyAuthenticator allows you to log in with any username & password,
while SimpleLocalProcessSpawner allows you to start servers without having to
create a Unix user for each JupyterHub user. Together, these make it
much easier to test JupyterHub.
Tip: If you are working on parts of JupyterHub that are common to all
authenticators & spawners, we recommend using both DummyAuthenticator &
SimpleLocalProcessSpawner. If you are working on just authenticator-related
parts, use only SimpleLocalProcessSpawner. Similarly, if you are working on
just spawner-related parts, use only DummyAuthenticator.
Troubleshooting
===============
This section lists common ways setting up your development environment may
fail, and how to fix them. Please add to the list if you encounter yet
another way it can fail!
``lessc`` not found
-------------------
If the ``python3 -m pip install --editable .`` command fails and complains about
``lessc`` being unavailable, you may need to explicitly install some
additional JavaScript dependencies:
.. code:: bash
npm install
This will fetch client-side JavaScript dependencies necessary to compile
CSS.
You may also need to manually update JavaScript and CSS after some
development updates, with:
.. code:: bash
python3 setup.py js # fetch updated client-side js
python3 setup.py css # recompile CSS from LESS sources
python3 setup.py jsx # build React admin app

View File

@@ -0,0 +1,157 @@
(contributing-tests)=
# Testing JupyterHub and linting code
Unit testing helps to validate that JupyterHub works the way we think it does,
and continues to do so when changes occur. They also help communicate
precisely what we expect our code to do.
JupyterHub uses [pytest](https://pytest.org) for all the tests. You
can find them under the [jupyterhub/tests](https://github.com/jupyterhub/jupyterhub/tree/main/jupyterhub/tests) directory in the git repository.
## Running the tests
1. Make sure you have completed {ref}`contributing/setup`.
Once you are done, you would be able to run `jupyterhub` from the command line and access it from your web browser.
This ensures that the dev environment is properly set up for tests to run.
2. You can run all tests in JupyterHub
```bash
pytest -v jupyterhub/tests
```
This should display progress as it runs all the tests, printing
information about any test failures as they occur.
If you wish to confirm test coverage the run tests with the `--cov` flag:
```bash
pytest -v --cov=jupyterhub jupyterhub/tests
```
3. You can also run tests in just a specific file:
```bash
pytest -v jupyterhub/tests/<test-file-name>
```
4. To run a specific test only, you can do:
```bash
pytest -v jupyterhub/tests/<test-file-name>::<test-name>
```
This runs the test with function name `<test-name>` defined in
`<test-file-name>`. This is very useful when you are iteratively
developing a single test.
For example, to run the test `test_shutdown` in the file `test_api.py`,
you would run:
```bash
pytest -v jupyterhub/tests/test_api.py::test_shutdown
```
For more details, refer to the [pytest usage documentation](https://pytest.readthedocs.io/en/latest/usage.html).
## Test organisation
The tests live in `jupyterhub/tests` and are organized roughly into:
1. `test_api.py` tests the REST API
2. `test_pages.py` tests loading the HTML pages
and other collections of tests for different components.
When writing a new test, there should usually be a test of
similar functionality already written and related tests should
be added nearby.
The fixtures live in `jupyterhub/tests/conftest.py`. There are
fixtures that can be used for JupyterHub components, such as:
- `app`: an instance of JupyterHub with mocked parts
- `auth_state_enabled`: enables persisting auth_state (like authentication tokens)
- `db`: a sqlite in-memory DB session
- `` io_loop` ``: a Tornado event loop
- `event_loop`: a new asyncio event loop
- `user`: creates a new temporary user
- `admin_user`: creates a new temporary admin user
- single user servers
\- `cleanup_after`: allows cleanup of single user servers between tests
- mocked service
\- `MockServiceSpawner`: a spawner that mocks services for testing with a short poll interval
\- `` mockservice` ``: mocked service with no external service url
\- `mockservice_url`: mocked service with a url to test external services
And fixtures to add functionality or spawning behavior:
- `admin_access`: grants admin access
- `` no_patience` ``: sets slow-spawning timeouts to zero
- `slow_spawn`: enables the SlowSpawner (a spawner that takes a few seconds to start)
- `never_spawn`: enables the NeverSpawner (a spawner that will never start)
- `bad_spawn`: enables the BadSpawner (a spawner that fails immediately)
- `slow_bad_spawn`: enables the SlowBadSpawner (a spawner that fails after a short delay)
Refer to the [pytest fixtures documentation](https://pytest.readthedocs.io/en/latest/fixture.html) to learn how to use fixtures that exists already and to create new ones.
### The Pytest-Asyncio Plugin
When testing the various JupyterHub components and their various implementations, it sometimes becomes necessary to have a running instance of JupyterHub to test against.
The [`app`](https://github.com/jupyterhub/jupyterhub/blob/270b61992143b29af8c2fab90c4ed32f2f6fe209/jupyterhub/tests/conftest.py#L60) fixture mocks a JupyterHub application for use in testing by:
- enabling ssl if internal certificates are available
- creating an instance of [MockHub](https://github.com/jupyterhub/jupyterhub/blob/270b61992143b29af8c2fab90c4ed32f2f6fe209/jupyterhub/tests/mocking.py#L221) using any provided configurations as arguments
- initializing the mocked instance
- starting the mocked instance
- finally, a registered finalizer function performs a cleanup and stops the mocked instance
The JupyterHub test suite uses the [pytest-asyncio plugin](https://pytest-asyncio.readthedocs.io/en/latest/) that handles [event-loop](https://docs.python.org/3/library/asyncio-eventloop.html) integration in [Tornado](https://www.tornadoweb.org/en/stable/) applications. This allows for the use of top-level awaits when calling async functions or [fixtures](https://docs.pytest.org/en/6.2.x/fixture.html#what-fixtures-are) during testing. All test functions and fixtures labelled as `async` will run on the same event loop.
```{note}
With the introduction of [top-level awaits](https://piccolo-orm.com/blog/top-level-await-in-python/), the use of the `io_loop` fixture of the [pytest-tornado plugin](https://www.tornadoweb.org/en/stable/ioloop.html) is no longer necessary. It was initially used to call coroutines. With the upgrades made to `pytest-asyncio`, this usage is now deprecated. It is now, only utilized within the JupyterHub test suite to ensure complete cleanup of resources used during testing such as open file descriptors. This is demonstrated in this [pull request](https://github.com/jupyterhub/jupyterhub/pull/4332).
More information is provided below.
```
One of the general goals of the [JupyterHub Pytest Plugin project](https://github.com/jupyterhub/pytest-jupyterhub) is to ensure the MockHub cleanup fully closes and stops all utilized resources during testing so the use of the `io_loop` fixture for teardown is not necessary. This was highlighted in this [issue](https://github.com/jupyterhub/pytest-jupyterhub/issues/30)
For more information on asyncio and event-loops, here are some resources:
- **Read**: [Introduction to the Python event loop](https://www.pythontutorial.net/python-concurrency/python-event-loop)
- **Read**: [Overview of Async IO in Python 3.7](https://stackabuse.com/overview-of-async-io-in-python-3-7)
- **Watch**: [Asyncio: Understanding Async / Await in Python](https://www.youtube.com/watch?v=bs9tlDFWWdQ)
- **Watch**: [Learn Python's AsyncIO #2 - The Event Loop](https://www.youtube.com/watch?v=E7Yn5biBZ58)
## Troubleshooting Test Failures
### All the tests are failing
Make sure you have completed all the steps in {ref}`contributing/setup` successfully, and are able to access JupyterHub from your browser at http://localhost:8000 after starting `jupyterhub` in your command line.
## Code formatting and linting
JupyterHub automatically enforces code formatting. This means that pull requests
with changes breaking this formatting will receive a commit from pre-commit.ci
automatically.
To automatically format code locally, you can install pre-commit and register a
_git hook_ to automatically check with pre-commit before you make a commit if
the formatting is okay.
```bash
pip install pre-commit
pre-commit install --install-hooks
```
To run pre-commit manually you would do:
```bash
# check for changes to code not yet committed
pre-commit run
# check for changes also in already committed code
pre-commit run --all-files
```
You may also install [black integration](https://github.com/psf/black#editor-integration)
into your text editor to format code automatically.

View File

@@ -1,138 +0,0 @@
.. _contributing/tests:
===================================
Testing JupyterHub and linting code
===================================
Unit testing helps to validate that JupyterHub works the way we think it does,
and continues to do so when changes occur. They also help communicate
precisely what we expect our code to do.
JupyterHub uses `pytest <https://pytest.org>`_ for all the tests. You
can find them under the `jupyterhub/tests <https://github.com/jupyterhub/jupyterhub/tree/main/jupyterhub/tests>`_ directory in the git repository.
Running the tests
==================
#. Make sure you have completed :ref:`contributing/setup`.
Once you are done, you would be able to run ``jupyterhub`` from the command line and access it from your web browser.
This ensures that the dev environment is properly set up for tests to run.
#. You can run all tests in JupyterHub
.. code-block:: bash
pytest -v jupyterhub/tests
This should display progress as it runs all the tests, printing
information about any test failures as they occur.
If you wish to confirm test coverage the run tests with the `--cov` flag:
.. code-block:: bash
pytest -v --cov=jupyterhub jupyterhub/tests
#. You can also run tests in just a specific file:
.. code-block:: bash
pytest -v jupyterhub/tests/<test-file-name>
#. To run a specific test only, you can do:
.. code-block:: bash
pytest -v jupyterhub/tests/<test-file-name>::<test-name>
This runs the test with function name ``<test-name>`` defined in
``<test-file-name>``. This is very useful when you are iteratively
developing a single test.
For example, to run the test ``test_shutdown`` in the file ``test_api.py``,
you would run:
.. code-block:: bash
pytest -v jupyterhub/tests/test_api.py::test_shutdown
For more details, refer to the `pytest usage documentation <https://pytest.readthedocs.io/en/latest/usage.html>`_.
Test organisation
=================
The tests live in ``jupyterhub/tests`` and are organized roughly into:
#. ``test_api.py`` tests the REST API
#. ``test_pages.py`` tests loading the HTML pages
and other collections of tests for different components.
When writing a new test, there should usually be a test of
similar functionality already written and related tests should
be added nearby.
The fixtures live in ``jupyterhub/tests/conftest.py``. There are
fixtures that can be used for JupyterHub components, such as:
- ``app``: an instance of JupyterHub with mocked parts
- ``auth_state_enabled``: enables persisting auth_state (like authentication tokens)
- ``db``: a sqlite in-memory DB session
- ``io_loop```: a Tornado event loop
- ``event_loop``: a new asyncio event loop
- ``user``: creates a new temporary user
- ``admin_user``: creates a new temporary admin user
- single user servers
- ``cleanup_after``: allows cleanup of single user servers between tests
- mocked service
- ``MockServiceSpawner``: a spawner that mocks services for testing with a short poll interval
- ``mockservice```: mocked service with no external service url
- ``mockservice_url``: mocked service with a url to test external services
And fixtures to add functionality or spawning behavior:
- ``admin_access``: grants admin access
- ``no_patience```: sets slow-spawning timeouts to zero
- ``slow_spawn``: enables the SlowSpawner (a spawner that takes a few seconds to start)
- ``never_spawn``: enables the NeverSpawner (a spawner that will never start)
- ``bad_spawn``: enables the BadSpawner (a spawner that fails immediately)
- ``slow_bad_spawn``: enables the SlowBadSpawner (a spawner that fails after a short delay)
Refer to the `pytest fixtures documentation <https://pytest.readthedocs.io/en/latest/fixture.html>`_ to learn how to use fixtures that exists already and to create new ones.
Troubleshooting Test Failures
=============================
All the tests are failing
-------------------------
Make sure you have completed all the steps in :ref:`contributing/setup` successfully, and are able to access JupyterHub from your browser at http://localhost:8000 after starting ``jupyterhub`` in your command line.
Code formatting and linting
===========================
JupyterHub automatically enforces code formatting. This means that pull requests
with changes breaking this formatting will receive a commit from pre-commit.ci
automatically.
To automatically format code locally, you can install pre-commit and register a
*git hook* to automatically check with pre-commit before you make a commit if
the formatting is okay.
.. code:: bash
pip install pre-commit
pre-commit install --install-hooks
To run pre-commit manually you would do:
.. code:: bash
# check for changes to code not yet committed
pre-commit run
# check for changes also in already committed code
pre-commit run --all-files
You may also install `black integration <https://github.com/psf/black#editor-integration>`_
into your text editor to format code automatically.

View File

@@ -1,46 +0,0 @@
Event logging and telemetry
===========================
JupyterHub can be configured to record structured events from a running server using Jupyter's `Telemetry System`_. The types of events that JupyterHub emits are defined by `JSON schemas`_ listed at the bottom of this page_.
.. _logging: https://docs.python.org/3/library/logging.html
.. _`Telemetry System`: https://github.com/jupyter/telemetry
.. _`JSON schemas`: https://json-schema.org/
How to emit events
------------------
Event logging is handled by its ``Eventlog`` object. This leverages Python's standing logging_ library to emit, filter, and collect event data.
To begin recording events, you'll need to set two configurations:
1. ``handlers``: tells the EventLog *where* to route your events. This trait is a list of Python logging handlers that route events to the event log file.
2. ``allows_schemas``: tells the EventLog *which* events should be recorded. No events are emitted by default; all recorded events must be listed here.
Here's a basic example:
.. code-block::
import logging
c.EventLog.handlers = [
logging.FileHandler('event.log'),
]
c.EventLog.allowed_schemas = [
'hub.jupyter.org/server-action'
]
The output is a file, ``"event.log"``, with events recorded as JSON data.
.. _page:
Event schemas
-------------
.. toctree::
:maxdepth: 2
server-actions.rst

View File

@@ -40,7 +40,7 @@ The rest is going to be up to your users.
Per-user overhead from JupyterHub is typically negligible
up to at least a few hundred concurrent active users.
```[figure} ../images/mybinder-hub-components-cpu-memory.png
```{figure} /images/mybinder-hub-components-cpu-memory.png
JupyterHub component resource usage for mybinder.org.
```
@@ -68,7 +68,7 @@ but which are **less predictable**.
[the-littlest-jupyterhub]: https://the-littlest-jupyterhub.readthedocs.io
[zero-to-jupyterhub]: https://zero-to-jupyterhub.readthedocs.io
[zero-to-jupyterhub]: https://z2jh.jupyter.org
(limits-requests)=
@@ -200,7 +200,7 @@ The limit here is actually Kubernetes' pods per node, not memory _or_ CPU.
This is likely a extreme case, as many Binder users come from clicking links on webpages
without any actual intention of running code.
```[figure} ../images/mybinder-load5.png
```{figure} /images/mybinder-load5.png
mybinder.org node CPU usage is low with 50-150 users sharing just 8 cores
```
@@ -277,7 +277,7 @@ showing >90% of users using less than 10% CPU and 200MB,
but a few outliers near the limit of 1 CPU and 2GB of RAM.
This is the kind of information you can use to tune your requests and limits.
![Snapshot from JupyterHub's Grafana dashboards on mybinder.org](../images/mybinder-user-resources.png)
![Snapshot from JupyterHub's Grafana dashboards on mybinder.org](/images/mybinder-user-resources.png)
[prometheus]: https://prometheus.io
[grafana]: https://grafana.com
@@ -299,10 +299,10 @@ There are lots of other resources for cost and capacity planning that may be spe
Here are some useful links to other resources
- [Zero to JupyterHub](https://zero-to-jupyterhub.readthedocs.io) documentation on
- [projecting costs](https://zero-to-jupyterhub.readthedocs.io/en/latest/administrator/cost.html)
- [configuring user resources](https://zero-to-jupyterhub.readthedocs.io/en/latest/jupyterhub/customizing/user-resources.html)
- [Zero to JupyterHub](https://z2jh.jupyter.org) documentation on
- [projecting costs](https://z2jh.jupyter.org/en/latest/administrator/cost.html)
- [configuring user resources](https://z2jh.jupyter.org/en/latest/jupyterhub/customizing/user-resources.html)
- Cloud platform cost calculators:
- [Google Cloud](https://cloud.google.com/products/calculator/)
- [Amazon AWS](https://calculator.s3.amazonaws.com)
- [Amazon AWS](https://calculator.aws)
- [Microsoft Azure](https://azure.microsoft.com/en-us/pricing/calculator/)

View File

@@ -0,0 +1,183 @@
(hub-database)=
# The Hub's Database
JupyterHub uses a database to store information about users, services, and other data needed for operating the Hub.
This is the **state** of the Hub.
## Why does JupyterHub have a database?
JupyterHub is a **stateful** application (more on that 'state' later).
Updating JupyterHub's configuration or upgrading the version of JupyterHub requires restarting the JupyterHub process to apply the changes.
We want to minimize the disruption caused by restarting the Hub process, so it can be a mundane, frequent, routine activity.
Storing state information outside the process for later retrieval is necessary for this, and one of the main thing databases are for.
A lot of the operations in JupyterHub are also **relationships**, which is exactly what SQL databases are great at.
For example:
- Given an API token, what user is making the request?
- Which users don't have running servers?
- Which servers belong to user X?
- Which users have not been active in the last 24 hours?
Finally, a database allows us to have more information stored without needing it all loaded in memory,
e.g. supporting a large number (several thousands) of inactive users.
## What's in the database?
The short answer of what's in the JupyterHub database is "everything."
JupyterHub's **state** lives in the database.
That is, everything JupyterHub needs to be aware of to function that _doesn't_ come from the configuration files, such as
- users, roles, role assignments
- state, urls of running servers
- Hashed API tokens
- Short-lived state related to OAuth flow
- Timestamps for when users, tokens, and servers were last used
### What's _not_ in the database
Not _quite_ all of JupyterHub's state is in the database.
This mostly involves transient state, such as the 'pending' transitions of Spawners (starting, stopping, etc.).
Anything not in the database must be reconstructed on Hub restart, and the only sources of information to do that are the database and JupyterHub configuration file(s).
## How does JupyterHub use the database?
JupyterHub makes some _unusual_ choices in how it connects to the database.
These choices represent trade-offs favoring single-process simplicity and performance at the expense of horizontal scalability (multiple Hub instances).
We often say that the Hub 'owns' the database.
This ownership means that we assume the Hub is the only process that will talk to the database.
This assumption enables us to make several caching optimizations that dramatically improve JupyterHub's performance (i.e. data written recently to the database can be read from memory instead of fetched again from the database) that would not work if multiple processes could be interacting with the database at the same time.
Database operations are also synchronous, so while JupyterHub is waiting on a database operation, it cannot respond to other requests.
This allows us to avoid complex locking mechanisms, because transaction races can only occur during an `await`, so we only need to make sure we've completed any given transaction before the next `await` in a given request.
:::{note}
We are slowly working to remove these assumptions, and moving to a more traditional db session per-request pattern.
This will enable multiple Hub instances and enable scaling JupyterHub, but will significantly reduce the number of active users a single Hub instance can serve.
:::
### Database performance in a typical request
Most authenticated requests to JupyterHub involve a few database transactions:
1. look up the authenticated user (e.g. look up token by hash, then resolve owner and permissions)
2. record activity
3. perform any relevant changes involved in processing the request (e.g. create the records for a running server when starting one)
This means that the database is involved in almost every request, but only in quite small, simple queries, e.g.:
- lookup one token by hash
- lookup one user by name
- list tokens or servers for one user (typically 1-10)
- etc.
### The database as a limiting factor
As a result of the above transactions in most requests, database performance is the _leading_ factor in JupyterHub's baseline requests-per-second performance, but that cost does not scale significantly with the number of users, active or otherwise.
However, the database is _rarely_ a limiting factor in JupyterHub performance in a practical sense, because the main thing JupyterHub does is start, stop, and monitor whole servers, which take far more time than any small database transaction, no matter how many records you have or how slow your database is (within reason).
Additionally, there is usually _very_ little load on the database itself.
By far the most taxing activity on the database is the 'list all users' endpoint, primarily used by the [idle-culling service](https://github.com/jupyterhub/jupyterhub-idle-culler).
Database-based optimizations have been added to make even these operations feasible for large numbers of users:
1. State filtering on [GET /hub/api/users?state=active](../reference/rest-api.html#/default/get_users){.external},
which limits the number of results in the query to only the relevant subset (added in JupyterHub 1.3), rather than all users.
2. [Pagination](api-pagination) of all list endpoints, allowing the request of a large number of resources to be more fairly balanced with other Hub activities across multiple requests (added in 2.0).
:::{note}
It's important to note when discussing performance and limiting factors and that all of this only applies to requests to `/hub/...`.
The Hub and its database are not involved in most requests to single-user servers (`/user/...`), which is by design, and largely motivated by the fact that the Hub itself doesn't _need_ to be fast because its operations are infrequent and large.
:::
## Database backends
JupyterHub supports a variety of database backends via [SQLAlchemy][].
The default is sqlite, which works great for many cases, but you should be able to use many backends supported by SQLAlchemy.
Usually, this will mean PostgreSQL or MySQL, both of which are officially supported and well tested with JupyterHub, but others may work as well.
See [SQLAlchemy's docs][sqlalchemy-dialect] for how to connect to different database backends.
Doing so generally involves:
1. installing a Python package that provides a client implementation, and
2. setting [](JupyterHub.db_url) to connect to your database with the specified implementation
[sqlalchemy-dialect]: https://docs.sqlalchemy.org/en/20/dialects/
[sqlalchemy]: https://www.sqlalchemy.org
### Default backend: SQLite
The default database backend for JupyterHub is [SQLite](https://sqlite.org).
We have chosen SQLite as JupyterHub's default because it's simple (the 'database' is a single file) and ubiquitous (it is in the Python standard library).
It works very well for testing, small deployments, and workshops.
For production systems, SQLite has some disadvantages when used with JupyterHub:
- `upgrade-db` may not always work, and you may need to start with a fresh database
- `downgrade-db` **will not** work if you want to rollback to an earlier
version, so backup the `jupyterhub.sqlite` file before upgrading (JupyterHub automatically creates a date-stamped backup file when upgrading sqlite)
The sqlite documentation provides a helpful page about [when to use SQLite and
where traditional RDBMS may be a better choice](https://sqlite.org/whentouse.html).
### Picking your database backend (PostgreSQL, MySQL)
When running a long term deployment or a production system, we recommend using a full-fledged relational database, such as [PostgreSQL](https://www.postgresql.org) or [MySQL](https://www.mysql.com), that supports the SQL `ALTER TABLE` statement, which is used in some database upgrade steps.
In general, you select your database backend with [](JupyterHub.db_url), and can further configure it (usually not necessary) with [](JupyterHub.db_kwargs).
## Notes and Tips
### SQLite
The SQLite database should not be used on NFS. SQLite uses reader/writer locks
to control access to the database. This locking mechanism might not work
correctly if the database file is kept on an NFS filesystem. This is because
`fcntl()` file locking is broken on many NFS implementations. Therefore, you
should avoid putting SQLite database files on NFS since it will not handle well
multiple processes which might try to access the file at the same time.
### PostgreSQL
We recommend using PostgreSQL for production if you are unsure whether to use
MySQL or PostgreSQL or if you do not have a strong preference.
There is additional configuration required for MySQL that is not needed for PostgreSQL.
For example, to connect to a postgres database with psycopg2:
1. install psycopg2: `pip instal psycopg2` (or `psycopg2-binary` to avoid compilation, which is [not recommended for production][psycopg2-binary])
2. set authentication via environment variables `PGUSER` and `PGPASSWORD`
3. configure [](JupyterHub.db_url):
```python
c.JupyterHub.db_url = "postgres+psycopg2://my-postgres-server:5432/my-db-name"
```
[psycopg2-binary]: https://www.psycopg.org/docs/install.html#psycopg-vs-psycopg-binary
### MySQL / MariaDB
- You should probably use the `pymysql` or `mysqlclient` sqlalchemy provider, or another backend [recommended by sqlalchemy](https://docs.sqlalchemy.org/en/20/dialects/mysql.html#dialect-mysql)
- You also need to set `pool_recycle` to some value (typically 60 - 300, JupyterHub will default to 60)
which depends on your MySQL setup. This is necessary since MySQL kills
connections serverside if they've been idle for a while, and the connection
from the hub will be idle for longer than most connections. This behavior
will lead to frustrating 'the connection has gone away' errors from
sqlalchemy if `pool_recycle` is not set.
- If you use `utf8mb4` collation with MySQL earlier than 5.7.7 or MariaDB
earlier than 10.2.1 you may get an `1709, Index column size too large` error.
To fix this you need to set `innodb_large_prefix` to enabled and
`innodb_file_format` to `Barracuda` to allow for the index sizes jupyterhub
uses. `row_format` will be set to `DYNAMIC` as long as those options are set
correctly. Later versions of MariaDB and MySQL should set these values by
default, as well as have a default `DYNAMIC` `row_format` and pose no trouble
to users.
For example, to connect to a mysql database with mysqlclient:
1. install mysqlclient: `pip install mysqlclient`
2. configure [](JupyterHub.db_url):
```python
c.JupyterHub.db_url = "mysql+mysqldb://myuser:mypassword@my-sql-server:3306/my-db-name"
```

View File

@@ -0,0 +1,14 @@
# Explanation
_Explanation_ documentation provide big-picture descriptions of how JupyterHub works. This section is meant to build your understanding of particular topics.
```{toctree}
:maxdepth: 1
capacity-planning
database
websecurity
oauth
singleuser
../rbac/index
```

View File

@@ -255,7 +255,7 @@ To authenticate this request, the single token stored in the encrypted cookie is
If the user model matches who should be allowed (e.g. Danez),
then the request is allowed.
See {doc}`../rbac/scopes` for how JupyterHub uses scopes to determine authorized access to servers and services.
See [Scopes in JupyterHub](jupyterhub-scopes) for how JupyterHub uses scopes to determine authorized access to servers and services.
_the end_

View File

@@ -0,0 +1,109 @@
(singleuser)=
# The JupyterHub single-user server
When a user logs into JupyterHub, they get a 'server', which we usually call the **single-user server**, because it's a server that's meant for a single JupyterHub user.
Each JupyterHub user gets a different one (or more than one!).
A single-user server is a process running somewhere that is:
1. accessible over http[s],
2. authenticated via JupyterHub using OAuth 2.0,
3. started by a [Spawner](spawners), and
4. 'owned' by a single JupyterHub user
## The single-user server command
The Spawner's default single-user server startup command, `jupyterhub-singleuser`, launches `jupyter-server`, the same program used when you run `jupyter lab` on your laptop.
(_It can also launch the legacy `jupyter-notebook` server_).
That's why JupyterHub looks familiar to folks who are already using Jupyter at home or elsewhere.
It's the same!
`jupyterhub-singleuser` _customizes_ that program to change (approximately) one thing: **authenticate requests with JupyterHub**.
(singleuser-auth)=
## Single-user server authentication
Implementation-wise, JupyterHub single-user servers are a special-case of {ref}`services`
and as such use the same (OAuth) authentication mechanism (more on OAuth in JupyterHub at [](oauth)).
This is primarily implemented in the {class}`~.HubOAuth` class.
This code resides in `jupyterhub.singleuser` subpackage of JupyterHub.
The main task of this code is to:
1. resolve a JupyterHub token to a JupyterHub user (authenticate)
2. check permissions (`access:servers`) for the token to make sure the request should be allowed (authorize)
3. if not authorized, begin the OAuth process with a redirect to the Hub
4. after login, store OAuth tokens in a cookie only used by this single-user server
5. implement logout to clear the cookie
Most of this is implemented in the {class}`~.HubOAuth` class. `jupyterhub.singleuser` is responsible for _adapting_ the base Jupyter Server to use HubOAuth for these tasks.
### JupyterHub authentication extension
By default, `jupyter-server` uses its own cookie to authenticate.
If that cookie is not present, the server redirects you a login page and asks you to enter a password or token.
Jupyter Server 2.0 introduces two new _APIs_ for customizing authentication: the [IdentityProvider](inv:jupyter-server#jupyter_server.auth.IdentityProvider) and the [Authorizer](inv:jupyter-server#jupyter_server.auth.Authorizer).
More information can be found in the [Jupyter Server documentation](https://jupyter-server.readthedocs.io).
JupyterHub implements these APIs in `jupyterhub.singleuser.extension`.
The IdentityProvider is responsible for _authenticating_ requests.
In JupyterHub, that means extracting OAuth tokens from the request and resolving them to a JupyterHub user.
The Authorizer is a _separate_ API for _authorizing_ actions on particular resources.
Because the JupyterHub IdentityProvider only allows _authenticating_ users who already have the necessary `access:servers` permission to access the server, the default Authorizer only contains a redundant check for this same permission, and ignores the resource inputs.
However, specifying a _custom_ Authorizer allows for granular permissions, such as read-only access to subsets of a shared server.
### JupyterHub authentication via subclass
Prior to Jupyter Server 2 (i.e. Jupyter Server 1.x or the legacy `jupyter-notebook` server), JupyterHub authentication is applied via _subclass_.
Originally a subclass of `NotebookApp`,
this approach works with both `jupyter-server` and `jupyter-notebook`.
Instead of using the extension mechanisms above,
the server application is _subclassed_. This worked well in the `jupyter-notebook` days,
but doesn't fit well with Jupyter Server's extension-based architecture.
### Selecting jupyterhub-singleuser implementation
Using the JupyterHub singleuser-server extension is the default behavior of JupyterHub 4 and Jupyter Server 2, otherwise the subclass approach is taken.
You can opt-out of the extension by setting the environment variable `JUPYTERHUB_SINGLEUSER_EXTENSION=0`:
```python
c.Spawner.environment.update(
{
"JUPYTERHUB_SINGLEUSER_EXTENSION": "0",
}
)
```
The subclass approach will also be taken if you've opted to use the classic notebook server with:
```
JUPYTERHUB_SINGLEUSER_APP=notebook
```
which was introduced in JupyterHub 2.
## Other customizations
`jupyterhub-singleuser` makes other small customizations to how the single-user server behaves:
1. logs activity on the single-user server, used in [idle-culling](https://github.com/jupyterhub/jupyterhub-idle-culler).
2. disables some features that don't make sense in JupyterHub (trash, retrying ports)
3. loading options such as URLs and SSL configuration from the environment
4. customize logging for consistency with JupyterHub logs
## Running a single-user server that's not `jupyterhub-singleuser`
By default, `jupyterhub-singleuser` is the same `jupyter-server` used by JupyterLab, Jupyter notebook (>= 7), etc.
But technically, all JupyterHub cares about is that it is:
1. an http server at the prescribed URL, accessible from the Hub and proxy, and
2. authenticated via [OAuth](oauth) with the Hub (it doesn't even have to do this, if you want to do your own authentication, as is done in BinderHub)
which means that you can customize JupyterHub to launch _any_ web application that meets these criteria, by following the specifications in {ref}`services`.
Most of the time, though, it's easier to use [jupyter-server-proxy](https://jupyter-server-proxy.readthedocs.io) if you want to launch additional web applications in JupyterHub.

View File

@@ -0,0 +1,272 @@
(web-security)=
# Security Overview
The **Security Overview** section helps you learn about:
- the design of JupyterHub with respect to web security
- the semi-trusted user
- the available mitigations to protect untrusted users from each other
- the value of periodic security audits
This overview also helps you obtain a deeper understanding of how JupyterHub
works.
## Semi-trusted and untrusted users
JupyterHub is designed to be a _simple multi-user server for modestly sized
groups_ of **semi-trusted** users. While the design reflects serving
semi-trusted users, JupyterHub can also be suitable for serving **untrusted** users,
but **is not suitable for untrusted users** in its default configuration.
As a result, using JupyterHub with **untrusted** users means more work by the
administrator, since much care is required to secure a Hub, with extra caution on
protecting users from each other.
One aspect of JupyterHub's _design simplicity_ for **semi-trusted** users is that
the Hub and single-user servers are placed in a _single domain_, behind a
[_proxy_][configurable-http-proxy]. If the Hub is serving untrusted
users, many of the web's cross-site protections are not applied between
single-user servers and the Hub, or between single-user servers and each
other, since browsers see the whole thing (proxy, Hub, and single user
servers) as a single website (i.e. single domain).
## Protect users from each other
To protect users from each other, a user must **never** be able to write arbitrary
HTML and serve it to another user on the Hub's domain. This is prevented by JupyterHub's
authentication setup because only the owner of a given single-user notebook server is
allowed to view user-authored pages served by the given single-user notebook
server.
To protect all users from each other, JupyterHub administrators must
ensure that:
- A user **does not have permission** to modify their single-user notebook server,
including:
- the installation of new packages in the Python environment that runs
their single-user server;
- the creation of new files in any `PATH` directory that precedes the
directory containing `jupyterhub-singleuser` (if the `PATH` is used
to resolve the single-user executable instead of using an absolute path);
- the modification of environment variables (e.g. PATH, PYTHONPATH) for
their single-user server;
- the modification of the configuration of the notebook server
(the `~/.jupyter` or `JUPYTER_CONFIG_DIR` directory).
- unrestricted selection of the base environment (e.g. the image used in container-based Spawners)
If any additional services are run on the same domain as the Hub, the services
**must never** display user-authored HTML that is neither _sanitized_ nor _sandboxed_
to any user that lacks authentication as the author of a file.
### Sharing access to servers
Because sharing access to servers (via `access:servers` scopes or the sharing feature in JupyterHub 5) by definition means users can serve each other files, enabling sharing is not suitable for untrusted users without also enabling per-user domains.
JupyterHub does not enable any sharing by default.
## Mitigate security issues
The several approaches to mitigating security issues with configuration
options provided by JupyterHub include:
### Enable user subdomains
JupyterHub provides the ability to run single-user servers on their own
domains. This means the cross-origin protections between servers has the
desired effect, and user servers and the Hub are protected from each other.
**Subdomains are the only way to reliably isolate user servers from each other.**
To enable subdomains, set:
```python
c.JupyterHub.subdomain_host = "https://jupyter.example.org"
```
When subdomains are enabled, each user's single-user server will be at e.g. `https://username.jupyter.example.org`.
This also requires all user subdomains to point to the same address,
which is most easily accomplished with wildcard DNS, where a single A record points to your server and a wildcard CNAME record points to your A record:
```
A jupyter.example.org 192.168.1.123
CNAME *.jupyter.example.org jupyter.example.org
```
Since this spreads the service across multiple domains, you will likely need wildcard SSL as well,
matching `*.jupyter.example.org`.
Unfortunately, for many institutional domains, wildcard DNS and SSL may not be available.
We also **strongly encourage** serving JupyterHub and user content on a domain that is _not_ a subdomain of any sensitive content.
For reasoning, see [GitHub's discussion of moving user content to github.io from \*.github.com](https://github.blog/2013-04-09-yummy-cookies-across-domains/).
**If you do plan to serve untrusted users, enabling subdomains is highly encouraged**,
as it resolves many security issues, which are difficult to unavoidable when JupyterHub is on a single-domain.
:::{important}
JupyterHub makes no guarantees about protecting users from each other unless subdomains are enabled.
If you want to protect users from each other, you **_must_** enable per-user domains.
:::
### Disable user config
If subdomains are unavailable or undesirable, JupyterHub provides a
configuration option `Spawner.disable_user_config = True`, which can be set to prevent
the user-owned configuration files from being loaded. After implementing this
option, `PATH`s and package installation are the other things that the
admin must enforce.
### Prevent spawners from evaluating shell configuration files
For most Spawners, `PATH` is not something users can influence, but it's important that
the Spawner should _not_ evaluate shell configuration files prior to launching the server.
### Isolate packages in a read-only environment
The user must not have permission to install packages into the environment where the singleuser-server runs.
On a shared system, package isolation is most easily handled by running the single-user server in
a root-owned virtualenv with disabled system-site-packages.
The user must not have permission to install packages into this environment.
The same principle extends to the images used by container-based deployments.
If users can select the images in which their servers run, they can disable all security for their own servers.
It is important to note that the control over the environment is only required for the
single-user server, and not the environment(s) in which the users' kernel(s)
may run. Installing additional packages in the kernel environment does not
pose additional risk to the web application's security.
### Encrypt internal connections with SSL/TLS
By default, all communications within JupyterHub—between the proxy, hub, and single
-user notebooks—are performed unencrypted. Setting the `internal_ssl` flag in
`jupyterhub_config.py` secures the aforementioned routes. Turning this
feature on does require that the enabled `Spawner` can use the certificates
generated by the `Hub` (the default `LocalProcessSpawner` can, for instance).
It is also important to note that this encryption **does not** cover the
`zmq tcp` sockets between the Notebook client and kernel yet. While users cannot
submit arbitrary commands to another user's kernel, they can bind to these
sockets and listen. When serving untrusted users, this eavesdropping can be
mitigated by setting `KernelManager.transport` to `ipc`. This applies standard
Unix permissions to the communication sockets thereby restricting
communication to the socket owner. The `internal_ssl` option will eventually
extend to securing the `tcp` sockets as well.
### Mitigating same-origin deployments
While per-user domains are **required** for robust protection of users from each other,
you can mitigate many (but not all) cross-user issues.
First, it is critical that users cannot modify their server environments, as described above.
Second, it is important that users do not have `access:servers` permission to any server other than their own.
If users can access each others' servers, additional security measures must be enabled, some of which come with distinct user-experience costs.
Without the [Same-Origin Policy] (SOP) protecting user servers from each other,
each user server is considered a trusted origin for requests to each other user server (and the Hub itself).
Servers _cannot_ meaningfully distinguish requests originating from other user servers,
because SOP implies a great deal of trust, losing many restrictions applied to cross-origin requests.
That means pages served from each user server can:
1. arbitrarily modify the path in the Referer
2. make fully authorized requests with cookies
3. access full page contents served from the hub or other servers via popups
JupyterHub uses distinct xsrf tokens stored in cookies on each server path to attempt to limit requests across.
This has limitations because not all requests are protected by these XSRF tokens,
and unless additional measures are taken, the XSRF tokens from other user prefixes may be retrieved.
[Same-Origin Policy]: https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy
For example:
- `Content-Security-Policy` header must prohibit popups and iframes from the same origin.
The following Content-Security-Policy rules are _insecure_ and readily enable users to access each others' servers:
- `frame-ancestors: 'self'`
- `frame-ancestors: '*'`
- `sandbox allow-popups`
- Ideally, pages should use the strictest `Content-Security-Policy: sandbox` available,
but this is not feasible in general for JupyterLab pages, which need at least `sandbox allow-same-origin allow-scripts` to work.
The default Content-Security-Policy for single-user servers is
```
frame-ancestors: 'none'
```
which prohibits iframe embedding, but not pop-ups.
A more secure Content-Security-Policy that has some costs to user experience is:
```
frame-ancestors: 'none'; sandbox allow-same-origin allow-scripts
```
`allow-popups` is not disabled by default because disabling it breaks legitimate functionality, like "Open this in a new tab", and the "JupyterHub Control Panel" menu item.
To reiterate, the right way to avoid these issues is to enable per-user domains, where none of these concerns come up.
Note: even this level of protection requires administrators maintaining full control over the user server environment.
If users can modify their server environment, these methods are ineffective, as users can readily disable them.
### Cookie tossing
Cookie tossing is a technique where another server on a subdomain or peer subdomain can set a cookie
which will be read on another domain.
This is not relevant unless there are other user-controlled servers on a peer domain.
"Domain-locked" cookies avoid this issue, but have their own restrictions:
- JupyterHub must be served over HTTPS
- All secure cookies must be set on `/`, not on sub-paths, which means they are shared by all JupyterHub components in a single-domain deployment.
As a result, this option is only recommended when per-user subdomains are enabled,
to prevent sending all jupyterhub cookies to all user servers.
To enable domain-locked cookies, set:
```python
c.JupyterHub.cookie_host_prefix_enabled = True
```
```{versionadded} 4.1
```
### Forced-login
Jupyter servers can share links with `?token=...`.
JupyterHub prior to 5.0 will accept this request and persist the token for future requests.
This is useful for enabling admins to create 'fully authenticated' links bypassing login.
However, it also means users can share their own links that will log other users into their own servers,
enabling them to serve each other notebooks and other arbitrary HTML, depending on server configuration.
```{versionadded} 4.1
Setting environment variable `JUPYTERHUB_ALLOW_TOKEN_IN_URL=0` in the single-user environment can opt out of accepting token auth in URL parameters.
```
```{versionadded} 5.0
Accepting tokens in URLs is disabled by default, and `JUPYTERHUB_ALLOW_TOKEN_IN_URL=1` environment variable must be set to _allow_ token auth in URL parameters.
```
## Security audits
We recommend that you do periodic reviews of your deployment's security. It's
good practice to keep [JupyterHub](https://readthedocs.org/projects/jupyterhub/), [configurable-http-proxy][], and [nodejs
versions](https://github.com/nodejs/Release) up to date.
A handy website for testing your deployment is
[Qualsys' SSL analyzer tool](https://www.ssllabs.com/ssltest/analyze.html).
[configurable-http-proxy]: https://github.com/jupyterhub/configurable-http-proxy
## Vulnerability reporting
If you believe you have found a security vulnerability in JupyterHub, or any
Jupyter project, please report it to
[security@ipython.org](mailto:security@ipython.org). If you prefer to encrypt
your security reports, you can use [this PGP public
key](https://jupyter.org/assets/ipython_security.asc).

76
docs/source/faq/faq.md Normal file
View File

@@ -0,0 +1,76 @@
# Frequently asked questions
## How do I share links to notebooks?
Sharing links to notebooks is a common activity,
and can look different depending on what you mean by 'share.'
Your first instinct might be to copy the URL you see in the browser,
e.g. `jupyterhub.example/user/yourname/notebooks/coolthing.ipynb`,
but this usually won't work, depending on the permissions of the person you share the link with.
Unfortunately, 'share' means at least a few things to people in a JupyterHub context.
We'll cover 3 common cases here, when they are applicable, and what assumptions they make:
1. sharing links that will open the same file on the visitor's own server
2. sharing links that will bring the visitor to _your_ server (e.g. for real-time collaboration, or RTC)
3. publishing notebooks and sharing links that will download the notebook into the user's server
### link to the same file on the visitor's server
This is for the case where you have JupyterHub on a shared (or sufficiently similar) filesystem, where you want to share a link that will cause users to login and start their _own_ server, to view or edit the file.
**Assumption:** the same path on someone else's server is valid and points to the same file
This is useful in e.g. classes where you know students have certain files in certain locations, or collaborations where you know you have a shared filesystem where everyone has access to the same files.
A link should look like `https://jupyterhub.example/hub/user-redirect/lab/tree/foo.ipynb`.
You can hand-craft these URLs from the URL you are looking at, where you see `/user/name/lab/tree/foo.ipynb` use `/hub/user-redirect/lab/tree/foo.ipynb` (replace `/user/name/` with `/hub/user-redirect/`).
Or you can use JupyterLab's "copy shareable link" in the context menu in the file browser:
![copy shareable link in JupyterLab](../images/shareable_link.webp)
which will produce a correct URL with `/hub/user-redirect/` in it.
### link to the file on your server
This is for the case where you want to both be using _your_ server, e.g. for real-time collaboration (RTC).
**Assumption:** the user has (or should have) access to your server.
**Assumption:** your server is running _or_ the user has permission to start it.
By default, JupyterHub users don't have access to each other's servers, but JupyterHub 2.0 administrators can grant users limited access permissions to each other's servers.
If the visitor doesn't have access to the server, these links will result in a 403 Permission Denied error.
In many cases, for this situation you can copy the link in your URL bar (`/user/yourname/lab`), or you can add `/tree/path/to/specific/notebook.ipynb` to open a specific file.
The [jupyterlab-link-share] JupyterLab extension generates these links, and even can _grant_ other users access to your server.
[jupyterlab-link-share]: https://github.com/jupyterlab-contrib/jupyterlab-link-share
:::{warning}
Note that the way the extension _grants_ access is handing over credentials to allow the other user to **_BECOME YOU_**.
This is usually not appropriate in JupyterHub.
:::
### link to a published copy
Another way to 'share' notebooks is to publish copies, e.g. pushing the notebook to a git repository and sharing a download link.
This way is especially useful for course materials,
where no assumptions are necessary about the user's environment,
except for having one package installed.
**Assumption:** The [nbgitpuller](inv:nbgitpuller#index) server extension is installed
Unlike the other two methods, nbgitpuller doesn't provide an extension to copy a shareable link for the document you're currently looking at,
but it does provide a [link generator](inv:nbgitpuller#link),
which uses the `user-redirect` approach above.
When visiting an nbgitpuller link:
- The visitor will be directed to their own server
- Your repo will be cloned (or updated if it's already been cloned)
- and then the file opened when it's ready
[nbgitpuller]: https://nbgitpuller.readthedocs.io
[nbgitpuller-link]: https://nbgitpuller.readthedocs.io/en/latest/link.html

11
docs/source/faq/index.md Normal file
View File

@@ -0,0 +1,11 @@
# FAQs
Find answers to some of the most frequently-asked questions around JupyterHub and how it works.
```{toctree}
:maxdepth: 2
faq
institutional-faq
troubleshooting
```

View File

@@ -66,12 +66,12 @@ Here is a sample of organizations that use JupyterHub:
- **Universities and colleges**: UC Berkeley, UC San Diego, Cal Poly SLO, Harvard University, University of Chicago,
University of Oslo, University of Sheffield, Université Paris Sud, University of Versailles
- **Research laboratories**: NASA, NCAR, NOAA, the Large Synoptic Survey Telescope, Brookhaven National Lab,
Minnesota Supercomputing Institute, ALCF, CERN, Lawrence Livermore National Laboratory
Minnesota Supercomputing Institute, ALCF, CERN, Lawrence Livermore National Laboratory, HUNT
- **Online communities**: Pangeo, Quantopian, mybinder.org, MathHub, Open Humans
- **Computing infrastructure providers**: NERSC, San Diego Supercomputing Center, Compute Canada
- **Companies**: Capital One, SANDVIK code, Globus
See the [Gallery of JupyterHub deployments](../gallery-jhub-deployments.md) for
See the [Gallery of JupyterHub deployments](gallery-of-deployments) for
a more complete list of JupyterHub deployments at institutions.
### How does JupyterHub compare with hosted products, like Google Colaboratory, RStudio.cloud, or Anaconda Enterprise?
@@ -124,15 +124,15 @@ as more resources are needed - allowing you to utilize the benefits of a flexibl
### Is JupyterHub secure?
The short answer: yes.
The short answer: yes.
JupyterHub as a standalone application has been battle-tested at an institutional
level for several years, and makes a number of "default" security decisions that are reasonable for most
users.
- For security considerations in the base JupyterHub application,
[see the JupyterHub security page](https://jupyterhub.readthedocs.io/en/stable/reference/websecurity.html).
[see the JupyterHub security page](web-security).
- For security considerations when deploying JupyterHub on Kubernetes, see the
[JupyterHub on Kubernetes security page](https://zero-to-jupyterhub.readthedocs.io/en/latest/security.html).
[JupyterHub on Kubernetes security page](https://z2jh.jupyter.org/en/latest/security.html).
The longer answer: it depends on your deployment. Because JupyterHub is very flexible, it can be used
in a variety of deployment setups. This often entails connecting your JupyterHub to **other** infrastructure

View File

@@ -1,3 +1,5 @@
(troubleshooting)=
# Troubleshooting
When troubleshooting, you may see unexpected behaviors or receive an error
@@ -44,13 +46,13 @@ things like inspect other users' servers or modify the user list at runtime).
### JupyterHub Docker container is not accessible at localhost
Even though the command to start your Docker container exposes port 8000
(`docker run -p 8000:8000 -d --name jupyterhub jupyterhub/jupyterhub jupyterhub`),
(`docker run -p 8000:8000 -d --name jupyterhub quay.io/jupyterhub/jupyterhub jupyterhub`),
it is possible that the IP address itself is not accessible/visible. As a result,
when you try http://localhost:8000 in your browser, you are unable to connect
even though the container is running properly. One workaround is to explicitly
tell Jupyterhub to start at `0.0.0.0` which is visible to everyone. Try this
command:
`docker run -p 8000:8000 -d --name jupyterhub jupyterhub/jupyterhub jupyterhub --ip 0.0.0.0 --port 8000`
`docker run -p 8000:8000 -d --name jupyterhub quay.io/jupyterhub/jupyterhub jupyterhub --ip 0.0.0.0 --port 8000`
### How can I kill ports from JupyterHub-managed services that have been orphaned?
@@ -165,7 +167,7 @@ When your whole JupyterHub sits behind an organization proxy (_not_ a reverse pr
### Launching Jupyter Notebooks to run as an externally managed JupyterHub service with the `jupyterhub-singleuser` command returns a `JUPYTERHUB_API_TOKEN` error
[JupyterHub services](https://jupyterhub.readthedocs.io/en/stable/reference/services.html) allow processes to interact with JupyterHub's REST API. Example use-cases include:
{ref}`services` allow processes to interact with JupyterHub's REST API. Example use-cases include:
- **Secure Testing**: provide a canonical Jupyter Notebook for testing production data to reduce the number of entry points into production systems.
- **Grading Assignments**: provide access to shared Jupyter Notebooks that may be used for management tasks such as grading assignments.
@@ -345,12 +347,12 @@ In order to resolve this issue, there are two potential options.
### Where do I find Docker images and Dockerfiles related to JupyterHub?
Docker images can be found at the [JupyterHub organization on DockerHub](https://hub.docker.com/u/jupyterhub/).
The Docker image [jupyterhub/singleuser](https://hub.docker.com/r/jupyterhub/singleuser/)
Docker images can be found at the [JupyterHub organization on Quay.io](https://quay.io/organization/jupyterhub).
The Docker image [jupyterhub/singleuser](https://quay.io/repository/jupyterhub/singleuser)
provides an example single-user notebook server for use with DockerSpawner.
Additional single-user notebook server images can be found at the [Jupyter
organization on DockerHub](https://hub.docker.com/r/jupyter/) and information
organization on Quay.io](https://quay.io/organization/jupyter) and information
about each image at the [jupyter/docker-stacks repo](https://github.com/jupyter/docker-stacks).
### How can I view the logs for JupyterHub or the user's Notebook servers when using the DockerSpawner?

View File

@@ -1,36 +0,0 @@
# Frequently asked questions
## How do I share links to notebooks?
In short, where you see `/user/name/notebooks/foo.ipynb` use `/hub/user-redirect/notebooks/foo.ipynb` (replace `/user/name` with `/hub/user-redirect`).
Sharing links to notebooks is a common activity,
and can look different based on what you mean.
Your first instinct might be to copy the URL you see in the browser,
e.g. `hub.jupyter.org/user/yourname/notebooks/coolthing.ipynb`.
However, let's break down what this URL means:
`hub.jupyter.org/user/yourname/` is the URL prefix handled by _your server_,
which means that sharing this URL is asking the person you share the link with
to come to _your server_ and look at the exact same file.
In most circumstances, this is forbidden by permissions because the person you share with does not have access to your server.
What actually happens when someone visits this URL will depend on whether your server is running and other factors.
**But what is our actual goal?**
A typical situation is that you have some shared or common filesystem,
such that the same path corresponds to the same document
(either the exact same document or another copy of it).
Typically, what folks want when they do sharing like this
is for each visitor to open the same file _on their own server_,
so Breq would open `/user/breq/notebooks/foo.ipynb` and
Seivarden would open `/user/seivarden/notebooks/foo.ipynb`, etc.
JupyterHub has a special URL that does exactly this!
It's called `/hub/user-redirect/...`.
So if you replace `/user/yourname` in your URL bar
with `/hub/user-redirect` any visitor should get the same
URL on their own server, rather than visiting yours.
In JupyterLab 2.0, this should also be the result of the "Copy Shareable Link"
action in the file browser.

View File

@@ -1,19 +0,0 @@
Get Started
===========
This section covers how to configure and customize JupyterHub for your
needs. It contains information about authentication, networking, security, and
other topics that are relevant to individuals or organizations deploying their
own JupyterHub.
.. toctree::
:maxdepth: 2
config-basics
networking-basics
security-basics
authenticators-users-basics
spawners-basics
services-basics
faq
institutional-faq

View File

@@ -1,254 +0,0 @@
Security settings
=================
.. important::
You should not run JupyterHub without SSL encryption on a public network.
Security is the most important aspect of configuring Jupyter.
Three (3) configuration settings are the main aspects of security configuration:
1. :ref:`SSL encryption <ssl-encryption>` (to enable HTTPS)
2. :ref:`Cookie secret <cookie-secret>` (a key for encrypting browser cookies)
3. Proxy :ref:`authentication token <authentication-token>` (used for the Hub and
other services to authenticate to the Proxy)
The Hub hashes all secrets (e.g. auth tokens) before storing them in its
database. A loss of control over read-access to the database should have
minimal impact on your deployment. If your database has been compromised, it
is still a good idea to revoke existing tokens.
.. _ssl-encryption:
Enabling SSL encryption
-----------------------
Since JupyterHub includes authentication and allows arbitrary code execution,
you should not run it without SSL (HTTPS).
Using an SSL certificate
~~~~~~~~~~~~~~~~~~~~~~~~
This will require you to obtain an official, trusted SSL certificate or create a
self-signed certificate. Once you have obtained and installed a key and
certificate, you need to specify their locations in the ``jupyterhub_config.py``
configuration file as follows:
.. code-block:: python
c.JupyterHub.ssl_key = '/path/to/my.key'
c.JupyterHub.ssl_cert = '/path/to/my.cert'
Some cert files also contain the key, in which case only the cert is needed. It
is important that these files be put in a secure location on your server, where
they are not readable by regular users.
If you are using a **chain certificate**, see also chained certificate for SSL
in the JupyterHub `Troubleshooting FAQ <../troubleshooting.html>`_.
Using letsencrypt
~~~~~~~~~~~~~~~~~
It is also possible to use `letsencrypt <https://letsencrypt.org/>`_ to obtain
a free, trusted SSL certificate. If you run letsencrypt using the default
options, the needed configuration is (replace ``mydomain.tld`` by your fully
qualified domain name):
.. code-block:: python
c.JupyterHub.ssl_key = '/etc/letsencrypt/live/{mydomain.tld}/privkey.pem'
c.JupyterHub.ssl_cert = '/etc/letsencrypt/live/{mydomain.tld}/fullchain.pem'
If the fully qualified domain name (FQDN) is ``example.com``, the following
would be the needed configuration:
.. code-block:: python
c.JupyterHub.ssl_key = '/etc/letsencrypt/live/example.com/privkey.pem'
c.JupyterHub.ssl_cert = '/etc/letsencrypt/live/example.com/fullchain.pem'
If SSL termination happens outside of the Hub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In certain cases, for example, if the hub is running behind a reverse proxy, and
`SSL termination is being provided by NGINX <https://www.nginx.com/resources/admin-guide/nginx-ssl-termination/>`_,
it is reasonable to run the hub without SSL.
To achieve this, remove ``c.JupyterHub.ssl_key`` and ``c.JupyterHub.ssl_cert``
from your configuration (setting them to ``None`` or an empty string does not
have the same effect, and will result in an error).
.. _authentication-token:
Proxy authentication token
--------------------------
The Hub authenticates its requests to the Proxy using a secret token that
the Hub and Proxy agree upon. Note that this applies to the default
``ConfigurableHTTPProxy`` implementation. Not all proxy implementations
use an auth token.
The value of this token should be a random string (for example, generated by
``openssl rand -hex 32``). You can store it in the configuration file or an
environment variable.
Generating and storing token in the configuration file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can set the value in the configuration file, ``jupyterhub_config.py``:
.. code-block:: python
c.ConfigurableHTTPProxy.api_token = 'abc123...' # any random string
Generating and storing as an environment variable
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can pass this value of the proxy authentication token to the Hub and Proxy
using the ``CONFIGPROXY_AUTH_TOKEN`` environment variable:
.. code-block:: bash
export CONFIGPROXY_AUTH_TOKEN=$(openssl rand -hex 32)
This environment variable needs to be visible to the Hub and Proxy.
Default if token is not set
~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you do not set the Proxy authentication token, the Hub will generate a random
key itself. This means that any time you restart the Hub, you **must also
restart the Proxy**. If the proxy is a subprocess of the Hub, this should happen
automatically (this is the default configuration).
.. _cookie-secret:
Cookie secret
-------------
The cookie secret is an encryption key, used to encrypt the browser cookies,
which are used for authentication. Three common methods are described for
generating and configuring the cookie secret.
Generating and storing as a cookie secret file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The cookie secret should be 32 random bytes, encoded as hex, and is typically
stored in a ``jupyterhub_cookie_secret`` file. Below, is an example command to generate the
``jupyterhub_cookie_secret`` file:
.. code-block:: bash
openssl rand -hex 32 > /srv/jupyterhub/jupyterhub_cookie_secret
In most deployments of JupyterHub, you should point this to a secure location on
the file system, such as ``/srv/jupyterhub/jupyterhub_cookie_secret``.
The location of the ``jupyterhub_cookie_secret`` file can be specified in the
``jupyterhub_config.py`` file as follows:
.. code-block:: python
c.JupyterHub.cookie_secret_file = '/srv/jupyterhub/jupyterhub_cookie_secret'
If the cookie secret file doesn't exist when the Hub starts, a new cookie
secret is generated and stored in the file. The file must not be readable by
``group`` or ``other``, otherwise the server won't start. The recommended permissions
for the cookie secret file are ``600`` (owner-only rw).
Generating and storing as an environment variable
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you would like to avoid the need for files, the value can be loaded in the
Hub process from the ``JPY_COOKIE_SECRET`` environment variable, which is a
hex-encoded string. You can set it this way:
.. code-block:: bash
export JPY_COOKIE_SECRET=$(openssl rand -hex 32)
For security reasons, this environment variable should only be visible to the
Hub. If you set it dynamically as above, all users will be logged out each time
the Hub starts.
Generating and storing as a binary string
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can also set the cookie secret, as a binary string,
in the configuration file (``jupyterhub_config.py``) itself:
.. code-block:: python
c.JupyterHub.cookie_secret = bytes.fromhex('64 CHAR HEX STRING')
.. _cookies:
Cookies used by JupyterHub authentication
-----------------------------------------
The following cookies are used by the Hub for handling user authentication.
This section was created based on this post_ from Discourse.
.. _post: https://discourse.jupyter.org/t/how-to-force-re-login-for-users/1998/6
jupyterhub-hub-login
~~~~~~~~~~~~~~~~~~~~
This is the login token used when visiting Hub-served pages that are
protected by authentication, such as the main home, the spawn form, etc.
If this cookie is set, then the user is logged in.
Resetting the Hub cookie secret effectively revokes this cookie.
This cookie is restricted to the path ``/hub/``.
jupyterhub-user-<username>
~~~~~~~~~~~~~~~~~~~~~~~~~~
This is the cookie used for authenticating with a single-user server.
It is set by the single-user server, after OAuth with the Hub.
Effectively the same as ``jupyterhub-hub-login``, but for the
single-user server instead of the Hub. It contains an OAuth access token,
which is checked with the Hub to authenticate the browser.
Each OAuth access token is associated with a session id (see ``jupyterhub-session-id`` section
below).
To avoid hitting the Hub on every request, the authentication response is cached.
The cache key is comprised of both the token and session id, to avoid a stale cache.
Resetting the Hub cookie secret effectively revokes this cookie.
This cookie is restricted to the path ``/user/<username>``,
to ensure that only the users server receives it.
jupyterhub-session-id
~~~~~~~~~~~~~~~~~~~~~
This is a random string, meaningless in itself, and the only cookie
shared by the Hub and single-user servers.
Its sole purpose is to coordinate the logout of the multiple OAuth cookies.
This cookie is set to ``/`` so all endpoints can receive it, clear it, etc.
jupyterhub-user-<username>-oauth-state
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A short-lived cookie, used solely to store and validate OAuth state.
It is only set while OAuth between the single-user server and the Hub
is processing.
If you use your browser development tools, you should see this cookie
for a very brief moment before you are logged in,
with an expiration date shorter than ``jupyterhub-hub-login`` or
``jupyterhub-user-<username>``.
This cookie should not exist after you have successfully logged in.
This cookie is restricted to the path ``/user/<username>``, so that only
the users server receives it.

View File

@@ -6,14 +6,14 @@ Only do this if you are very sure you must.
## Overview
There are many [Authenticators](../getting-started/authenticators-users-basics) and [Spawners](../getting-started/spawners-basics) available for JupyterHub. Some, such
There are many [Authenticators](authenticators) and [Spawners](spawners) available for JupyterHub. Some, such
as [DockerSpawner](https://github.com/jupyterhub/dockerspawner) or [OAuthenticator](https://github.com/jupyterhub/oauthenticator), do not need any elevated permissions. This
document describes how to get the full default behavior of JupyterHub while
running notebook servers as real system users on a shared system, without
running the Hub itself as root.
Since JupyterHub needs to spawn processes as other users, the simplest way
is to run it as root, spawning user servers with [setuid](http://linux.die.net/man/2/setuid).
is to run it as root, spawning user servers with [setuid](https://linux.die.net/man/2/setuid).
But this isn't especially safe, because you have a process running on the
public web as root.
@@ -114,7 +114,7 @@ sudo: a password is required
## Enable PAM for non-root
By default, [PAM authentication](http://en.wikipedia.org/wiki/Pluggable_authentication_module)
By default, [PAM authentication](https://en.wikipedia.org/wiki/Pluggable_authentication_module)
is used by JupyterHub. To use PAM, the process may need to be able to read
the shadow password database.
@@ -159,13 +159,13 @@ sudo setcap 'cap_net_bind_service=+ep' /usr/bin/node
```
However, you may want to further understand the consequences of this.
([Further reading](http://man7.org/linux/man-pages/man7/capabilities.7.html))
([Further reading](https://man7.org/linux/man-pages/man7/capabilities.7.html))
You may also be interested in limiting the amount of CPU any process can use
on your server. `cpulimit` is a useful tool that is available for many Linux
distributions' packaging system. This can be used to keep any user's process
from using too much CPU cycles. You can configure it accoring to [these
instructions](http://ubuntuforums.org/showthread.php?t=992706).
instructions](https://ubuntuforums.org/showthread.php?t=992706).
### Shadow group (FreeBSD)
@@ -228,7 +228,7 @@ And try logging in.
## Troubleshooting: SELinux
If you still get a generic `Permission denied` `PermissionError`, it's possible SELinux is blocking you.
If you still get a generic `Permission denied` `PermissionError`, it's possible SELinux is blocking you.
Here's how you can make a module to resolve this.
First, put this in a file named `sudo_exec_selinux.te`:

View File

@@ -45,7 +45,7 @@ additional packages.
## Configuring Jupyter and IPython
[Jupyter](https://jupyter-notebook.readthedocs.io/en/stable/config_overview.html)
[Jupyter](https://jupyter-notebook.readthedocs.io/en/stable/configuring/config_overview.html)
and [IPython](https://ipython.readthedocs.io/en/stable/development/config.html)
have their own configuration systems.
@@ -57,6 +57,24 @@ The typical locations for these config files are:
- **system-wide** in `/etc/{jupyter|ipython}`
- **env-wide** (environment wide) in `{sys.prefix}/etc/{jupyter|ipython}`.
### Jupyter environment configuration priority
When Jupyter runs in an environment (conda or virtualenv), it prefers to load configuration from the environment over each user's own configuration (e.g. in `~/.jupyter`).
This may cause issues if you use a _shared_ conda environment or virtualenv for users, because e.g. jupyterlab may try to write information like workspaces or settings to the environment instead of the user's own directory.
This could fail with something like `Permission denied: $PREFIX/etc/jupyter/lab`.
To avoid this issue, set `JUPYTER_PREFER_ENV_PATH=0` in the user environment:
```python
c.Spawner.environment.update(
{
"JUPYTER_PREFER_ENV_PATH": "0",
}
)
```
which tells Jupyter to prefer _user_ configuration paths (e.g. in `~/.jupyter`) to configuration set in the environment.
### Example: Enable an extension system-wide
For example, to enable the `cython` IPython extension for all of your users, create the file `/etc/ipython/ipython_config.py`:
@@ -153,11 +171,11 @@ c.JupyterHub.allow_named_servers = True
Named servers were implemented in the REST API in JupyterHub 0.8,
and JupyterHub 1.0 introduces UI for managing named servers via the user home page:
![named servers on the home page](../images/named-servers-home.png)
![named servers on the home page](/images/named-servers-home.png)
as well as the admin page:
![named servers on the admin page](../images/named-servers-admin.png)
![named servers on the admin page](/images/named-servers-admin.png)
Named servers can be accessed, created, started, stopped, and deleted
from these pages. Activity tracking is now per server as well.
@@ -184,6 +202,8 @@ This can be useful for quota service implementations. The example above limits t
If `named_server_limit_per_user` is set to `0`, no limit is enforced.
When using named servers, Spawners may need additional configuration to take the `servername` into account. Whilst `KubeSpawner` takes the `servername` into account by default in [`pod_name_template`](https://jupyterhub-kubespawner.readthedocs.io/en/latest/spawner.html#kubespawner.KubeSpawner.pod_name_template), other Spawners may not. Check the documentation for the specific Spawner to see how singleuser servers are named, for example in `DockerSpawner` this involves modifying the [`name_template`](https://jupyterhub-dockerspawner.readthedocs.io/en/latest/api/index.html) setting to include `servername`, eg. `"{prefix}-{username}-{servername}"`.
(classic-notebook-ui)=
## Switching back to the classic notebook
@@ -192,13 +212,31 @@ By default, the single-user server launches JupyterLab,
which is based on [Jupyter Server][].
This is the default server when running JupyterHub ≥ 2.0.
To switch to using the legacy Jupyter Notebook server, you can set the `JUPYTERHUB_SINGLEUSER_APP` environment variable
To switch to using the legacy Jupyter Notebook server (notebook < 7.0), you can set the `JUPYTERHUB_SINGLEUSER_APP` environment variable
(in the single-user environment) to:
```bash
export JUPYTERHUB_SINGLEUSER_APP='notebook.notebookapp.NotebookApp'
```
:::{note}
```
JUPYTERHUB_SINGLEUSER_APP='notebook.notebookapp.NotebookApp'
```
is only valid for notebook < 7. notebook v7 is based on jupyter-server,
and the default jupyter-server application must be used.
Selecting the new notebook UI is no longer a matter of selecting the server app to launch,
but only the default URL for users to visit.
To use notebook v7 with JupyterHub, leave the default singleuser app config alone (or specify `JUPYTERHUB_SINGLEUSER_APP=jupyter-server`) and set the default _URL_ for user servers:
```python
c.Spawner.default_url = '/tree/'
```
:::
[jupyter server]: https://jupyter-server.readthedocs.io
[jupyter notebook]: https://jupyter-notebook.readthedocs.io

View File

@@ -0,0 +1,34 @@
# How-to
The _How-to_ guides provide practical step-by-step details to help you achieve a particular goal. They are useful when you are trying to get something done but require you to understand and adapt the steps to your specific usecase.
Use the following guides when:
```{toctree}
:maxdepth: 1
api-only
proxy
rest
separate-proxy
templates
upgrading
log-messages
```
(config-examples)=
## Configuration
The following guides provide examples, including configuration files and tips, for the
following:
```{toctree}
:maxdepth: 1
configuration/config-user-env
configuration/config-ghoauth
configuration/config-proxy
configuration/config-sudo
```

View File

@@ -1,4 +1,4 @@
(rest-api)=
(using-jupyterhub-rest-api)=
# Using JupyterHub's REST API
@@ -19,7 +19,7 @@ Hub.
## What you can do with the API
Using the [JupyterHub REST API][], you can perform actions on the Hub,
Using the [JupyterHub REST API](jupyterhub-rest-API), you can perform actions on the Hub,
such as:
- Checking which users are active
@@ -33,36 +33,13 @@ such as:
To send requests using the JupyterHub API, you must pass an API token with
the request.
The preferred way of generating an API token is by running:
```bash
openssl rand -hex 32
```
This `openssl` command generates a potential token that can then be
added to JupyterHub using `.api_tokens` configuration setting in
`jupyterhub_config.py`.
```{note}
The api_tokens configuration has been softly deprecated since the introduction of services.
```
Alternatively, you can use the `jupyterhub token` command to generate a token
for a specific hub user by passing the **username**:
```bash
jupyterhub token <username>
```
This command generates a random string to use as a token and registers
it for the given user with the Hub's database.
In [version 0.8.0](../changelog.md), a token request page for
generating an API token is available from the JupyterHub user interface:
While JupyterHub is running, any JupyterHub user can request a token via the `token` page.
This is accessible via a `token` link in the top nav bar from the JupyterHub home page,
or at the URL `/hub/token`.
:::{figure-md}
![token request page](../images/token-request.png)
![token request page](../images/token-page.png)
JupyterHub's API token page
:::
@@ -74,6 +51,40 @@ JupyterHub's token page after successfully requesting a token.
:::
### Register API tokens via configuration
Sometimes, you'll want to pre-generate a token for access to JupyterHub,
typically for use by external services,
so that both JupyterHub and the service have access to the same value.
First, you need to generate a good random secret.
A good way of generating an API token is by running:
```bash
openssl rand -hex 32
```
This `openssl` command generates a random token that can be added to the JupyterHub configuration in `jupyterhub_config.py`.
For external services, this would be registered with JupyterHub via configuration:
```python
c.JupyterHub.services = [
{
"name": "my-service",
"api_token": the_secret_value,
},
]
```
At this point, requests authenticated with the token will be associated with The service `my-service`.
```{note}
You can also load additional tokens for users via the `JupyterHub.api_tokens` configuration.
However, this option has been deprecated since the introduction of services.
```
## Assigning permissions to a token
Prior to JupyterHub 2.0, there were two levels of permissions:
@@ -276,7 +287,7 @@ Pagination is enabled on the `GET /users`, `GET /groups`, and `GET /proxy` REST
## Enabling users to spawn multiple named-servers via the API
Support for multiple servers per user was introduced in JupyterHub [version 0.8.](../changelog.md)
Support for multiple servers per user was introduced in JupyterHub [version 0.8.](changelog)
Prior to that, each user could only launch a single default server via the API
like this:
@@ -294,7 +305,7 @@ First you must enable named-servers by including the following setting in the `j
If you are using the [zero-to-jupyterhub-k8s](https://github.com/jupyterhub/zero-to-jupyterhub-k8s) set-up to run JupyterHub,
then instead of editing the `jupyterhub_config.py` file directly, you could pass
the following as part of the `config.yaml` file, as per the [tutorial](https://zero-to-jupyterhub.readthedocs.io/en/latest/):
the following as part of the `config.yaml` file, as per the [tutorial](https://z2jh.jupyter.org/en/latest/):
```bash
hub:
@@ -320,7 +331,7 @@ or kubernetes pods.
## Learn more about the API
You can see the full [JupyterHub REST API][] for more details.
You can see the full [JupyterHub REST API](jupyterhub-rest-api) for more details.
[openapi initiative]: https://www.openapis.org/
[jupyterhub rest api]: ./rest-api

View File

@@ -1,3 +1,5 @@
(separate-proxy)=
# Running proxy separately from the hub
## Background
@@ -68,7 +70,7 @@ need to configure the options there.
## Docker image
You can use [jupyterhub configurable-http-proxy docker
image](https://hub.docker.com/r/jupyterhub/configurable-http-proxy/)
image](https://quay.io/repository/jupyterhub/configurable-http-proxy)
to run the proxy.
## See also

View File

@@ -0,0 +1,141 @@
(upgrading-jupyterhub)=
# Upgrading JupyterHub
JupyterHub offers easy upgrade pathways between minor versions. This
document describes how to do these upgrades.
If you are using {ref}`a JupyterHub distribution <index/distributions>`, you
should consult the distribution's documentation on how to upgrade. This documentation is
for those who have set up their JupyterHub without using a distribution.
This documentation is lengthy because it is quite detailed. Most likely, upgrading
JupyterHub is painless, quick and with minimal user interruption.
The steps are discussed in detail, so if you get stuck at any step you can always refer to this guide.
## Read the Changelog
The [changelog](changelog) contains information on what has
changed with the new JupyterHub release and any deprecation warnings.
Read these notes to familiarize yourself with the coming changes. There
might be new releases of the authenticators & spawners you use, so
read the changelogs for those too!
## Notify your users
If you use the default configuration where `configurable-http-proxy`
is managed by JupyterHub, your users will see service disruption during
the upgrade process. You should notify them, and pick a time to do the
upgrade where they will be least disrupted.
If you use a different proxy or run `configurable-http-proxy`
independent of JupyterHub, your users will be able to continue using notebook
servers they had already launched, but will not be able to launch new servers or sign in.
## Backup database & config
Before doing an upgrade, it is critical to back up:
1. Your JupyterHub database (SQLite by default, or MySQL / Postgres if you used those).
If you use SQLite (the default), you should backup the `jupyterhub.sqlite` file.
2. Your `jupyterhub_config.py` file.
3. Your users' home directories. This is unlikely to be affected directly by
a JupyterHub upgrade, but we recommend a backup since user data is critical.
## Shut down JupyterHub
Shut down the JupyterHub process. This would vary depending on how you
have set up JupyterHub to run. It is most likely using a process
supervisor of some sort (`systemd` or `supervisord` or even `docker`).
Use the supervisor-specific command to stop the JupyterHub process.
## Upgrade JupyterHub packages
There are two environments where the `jupyterhub` package is installed:
1. The _hub environment_: where the JupyterHub server process
runs. This is started with the `jupyterhub` command, and is what
people generally think of as JupyterHub.
2. The _notebook user environments_: where the user notebook
servers are launched from, and is probably custom to your own
installation. This could be just one environment (different from the
hub environment) that is shared by all users, one environment
per user, or the same environment as the hub environment. The hub
launched the `jupyterhub-singleuser` command in this environment,
which in turn starts the notebook server.
You need to make sure the version of the `jupyterhub` package matches
in both these environments. If you installed `jupyterhub` with pip,
you can upgrade it with:
```bash
python3 -m pip install --upgrade jupyterhub==<version>
```
Where `<version>` is the version of JupyterHub you are upgrading to.
If you used `conda` to install `jupyterhub`, you should upgrade it
with:
```bash
conda install -c conda-forge jupyterhub==<version>
```
You should also check for new releases of the authenticator & spawner you
are using. You might wish to upgrade those packages, too, along with JupyterHub
or upgrade them separately.
## Upgrade JupyterHub database
Once new packages are installed, you need to upgrade the JupyterHub
database. From the hub environment, in the same directory as your
`jupyterhub_config.py` file, you should run:
```bash
jupyterhub upgrade-db
```
This should find the location of your database, and run the necessary upgrades
for it.
### SQLite database disadvantages
SQLite has some disadvantages when it comes to upgrading JupyterHub. These
are:
- `upgrade-db` may not work, and you may need to delete your database
and start with a fresh one.
- `downgrade-db` **will not** work if you want to rollback to an
earlier version, so backup the `jupyterhub.sqlite` file before
upgrading.
### What happens if I delete my database?
Losing the Hub database is often not a big deal. Information that
resides only in the Hub database includes:
- active login tokens (user cookies, service tokens)
- users added via JupyterHub UI, instead of config files
- info about running servers
If the following conditions are true, you should be fine clearing the
Hub database and starting over:
- users specified in the config file, or login using an external
authentication provider (Google, GitHub, LDAP, etc)
- user servers are stopped during the upgrade
- don't mind causing users to log in again after the upgrade
## Start JupyterHub
Once the database upgrade is completed, start the `jupyterhub`
process again.
1. Log in and start the server to make sure things work as
expected.
2. Check the logs for any errors or deprecation warnings. You
might have to update your `jupyterhub_config.py` file to
deal with any deprecated options.
Congratulations, your JupyterHub has been upgraded!

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

View File

@@ -1,15 +0,0 @@
=====
About
=====
JupyterHub is an open source project and community. It is a part of the
`Jupyter Project <https://jupyter.org>`_. JupyterHub is an open and inclusive
community, and invites contributions from anyone. This section covers information
about our community, as well as ways that you can connect and get involved.
.. toctree::
:maxdepth: 1
contributor-list
changelog
gallery-jhub-deployments

View File

@@ -1,15 +0,0 @@
=====================
Administrator's Guide
=====================
This guide covers best-practices, tips, common questions and operations, as
well as other information relevant to running your own JupyterHub over time.
.. toctree::
:maxdepth: 2
troubleshooting
admin/capacity-planning
admin/upgrading
admin/log-messages
changelog

137
docs/source/index.md Normal file
View File

@@ -0,0 +1,137 @@
# JupyterHub
[JupyterHub] is the best way to serve [Jupyter notebook] for multiple users.
Because JupyterHub manages a separate Jupyter environment for each user,
it can be used in a class of students, a corporate data science group, or a scientific
research group. It is a multi-user **Hub** that spawns, manages, and proxies multiple
instances of the single-user [Jupyter notebook] server.
(index/distributions)=
## Distributions
JupyterHub can be used in a collaborative environment by both small (0-100 users) and
large teams (more than 100 users) such as a class of students, corporate data science group
or scientific research group.
It has two main distributions which are developed to serve the needs of each of these teams respectively.
1. [The Littlest JupyterHub](https://github.com/jupyterhub/the-littlest-jupyterhub) distribution is suitable if you need a small number of users (1-100) and a single server with a simple environment.
2. [Zero to JupyterHub with Kubernetes](https://github.com/jupyterhub/zero-to-jupyterhub-k8s) allows you to deploy dynamic servers on the cloud if you need even more users.
This distribution runs JupyterHub on top of [Kubernetes](https://k8s.io).
```{note}
It is important to evaluate these distributions before you can continue with the
configuration of JupyterHub.
```
## Subsystems
JupyterHub is made up of four subsystems:
- a **Hub** (tornado process) that is the heart of JupyterHub
- a **configurable http proxy** (node-http-proxy) that receives the requests from the client's browser
- multiple **single-user Jupyter notebook servers** (Python/IPython/tornado) that are monitored by Spawners
- an **authentication class** that manages how users can access the system
Additionally, optional configurations can be added through a `config.py` file and manage users
kernels on an admin panel. A simplification of the whole system is displayed in the figure below:
```{image} images/jhub-fluxogram.jpeg
:align: center
:alt: JupyterHub subsystems
:width: 80%
```
JupyterHub performs the following functions:
- The Hub launches a proxy
- The proxy forwards all requests to the Hub by default
- The Hub handles user login and spawns single-user servers on demand
- The Hub configures the proxy to forward URL prefixes to the single-user
notebook servers
For convenient administration of the Hub, its users, and services,
JupyterHub also provides a {doc}`REST API <reference/rest-api>`.
The JupyterHub team and Project Jupyter value our community, and JupyterHub
follows the Jupyter [Community Guides](https://jupyter.readthedocs.io/en/latest/community/content-community.html).
---
## Documentation structure
### Tutorials
This section of the documentation contains step-by-step tutorials that help outline the capabilities of JupyterHub and how you can achieve specific aims, such as installing it. The tutorials are recommended if you do not have much experience with JupyterHub.
```{toctree}
:maxdepth: 2
tutorial/index.md
```
### How-to guides
The _How-to_ guides provide more in-depth details than the tutorials. They are recommended for those already familiar with JupyterHub and have a specific goal. The guides help answer the question _"How do I ...?"_ based on a particular topic.
```{toctree}
:maxdepth: 2
howto/index.md
```
### Explanation
The _Explanation_ section provides further details that can be used to better understand JupyterHub, such as how it can be used and configured. They are intended for those seeking to expand their knowledge of JupyterHub.
```{toctree}
:maxdepth: 2
explanation/index.md
```
### Reference
The _Reference_ section provides technical information about JupyterHub, such as monitoring the state of your installation and working with JupyterHub's API modules and classes.
```{toctree}
:maxdepth: 2
reference/index.md
```
### Frequently asked questions
Find answers to the most frequently asked questions about JupyterHub such as how to troubleshoot an issue.
```{toctree}
:maxdepth: 2
faq/index.md
```
### Contributing
JupyterHub welcomes all contributors, whether you are new to the project or know your way around. The _Contributing_ section provides information on how you can make your contributions.
```{toctree}
:maxdepth: 2
contributing/index
```
---
## Indices and tables
- {ref}`genindex`
- {ref}`modindex`
## Questions? Suggestions?
All questions and suggestions are welcome. Please feel free to use our [Jupyter Discourse Forum](https://discourse.jupyter.org/) to contact our team.
Looking forward to hearing from you!
[jupyter notebook]: https://jupyter-notebook.readthedocs.io/en/latest/
[jupyterhub]: https://github.com/jupyterhub/jupyterhub

View File

@@ -1,161 +0,0 @@
==========
JupyterHub
==========
`JupyterHub`_ is the best way to serve `Jupyter notebook`_ for multiple users.
Because JupyterHub manages a separate Jupyter environment for each user,
it can be used in a class of students, a corporate data science group, or a scientific
research group. It is a multi-user **Hub** that spawns, manages, and proxies multiple
instances of the single-user `Jupyter notebook`_ server.
JupyterHub offers distributions for different use cases. As of now, you can find two main cases:
1. `The Littlest JupyterHub <https://github.com/jupyterhub/the-littlest-jupyterhub>`__ distribution is suitable if you need a small number of users (1-100) and a single server with a simple environment.
2. `Zero to JupyterHub with Kubernetes <https://github.com/jupyterhub/zero-to-jupyterhub-k8s>`__ allows you to deploy dynamic servers on the cloud if you need even more users.
JupyterHub can be used in a collaborative environment by both both small (0-100 users) and
large teams (more than 100 users) such as a class of students, corporate data science group
or scientific research group. It has distributions which are developed to serve the needs of
each of these teams respectively.
JupyterHub is made up of four subsystems:
* a **Hub** (tornado process) that is the heart of JupyterHub
* a **configurable http proxy** (node-http-proxy) that receives the requests from the client's browser
* multiple **single-user Jupyter notebook servers** (Python/IPython/tornado) that are monitored by Spawners
* an **authentication class** that manages how users can access the system
Additionally, optional configurations can be added through a `config.py` file and manage users
kernels on an admin panel. A simplification of the whole system is displayed in the figure below:
.. image:: images/jhub-fluxogram.jpeg
:alt: JupyterHub subsystems
:width: 80%
:align: center
JupyterHub performs the following functions:
- The Hub launches a proxy
- The proxy forwards all requests to the Hub by default
- The Hub handles user login and spawns single-user servers on demand
- The Hub configures the proxy to forward URL prefixes to the single-user
notebook servers
For convenient administration of the Hub, its users, and services,
JupyterHub also provides a :doc:`REST API <reference/rest-api>`.
The JupyterHub team and Project Jupyter value our community, and JupyterHub
follows the Jupyter `Community Guides <https://jupyter.readthedocs.io/en/latest/community/content-community.html>`_.
Contents
========
.. _index/distributions:
Distributions
-------------
A JupyterHub **distribution** is tailored
towards a particular set of use cases. These are generally easier
to set up than setting up JupyterHub from scratch, assuming they fit your use case.
Today, you can find two main use cases:
1. If you need a simple case for a small amount of users (0-100) and single server
take a look at
`The Littlest JupyterHub <https://github.com/jupyterhub/the-littlest-jupyterhub>`__ distribution.
2. If you need to allow for a larger number of machines and users,
a dynamic amount of servers can be used on a cloud,
take a look at the `Zero to JupyterHub with Kubernetes <https://github.com/jupyterhub/zero-to-jupyterhub-k8s>`__ distribution.
This distribution runs JupyterHub on top of `Kubernetes <https://k8s.io>`_.
*It is important to evaluate these distributions before you can continue with the
configuration of JupyterHub*.
Installation Guide
------------------
.. toctree::
:maxdepth: 2
installation-guide
Getting Started
---------------
.. toctree::
:maxdepth: 2
getting-started/index
Technical Reference
-------------------
.. toctree::
:maxdepth: 2
reference/index
Administrators guide
--------------------
.. toctree::
:maxdepth: 2
index-admin
API Reference
-------------
.. toctree::
:maxdepth: 2
api/index
RBAC Reference
--------------
.. toctree::
:maxdepth: 2
rbac/index
Contributing
------------
We welcome you to contribute to JupyterHub in ways that are most exciting
& useful to you. We value documentation, testing, bug reporting & code equally
and are glad to have your contributions in whatever form you wish :)
Our `Code of Conduct <https://github.com/jupyter/governance/blob/HEAD/conduct/code_of_conduct.md>`_ and `reporting guidelines <https://github.com/jupyter/governance/blob/HEAD/conduct/reporting_online.md>`_
help keep our community welcoming to as many people as possible.
.. toctree::
:maxdepth: 2
contributing/index
About JupyterHub
----------------
.. toctree::
:maxdepth: 2
index-about
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
Questions? Suggestions?
=======================
All questions and suggestions are welcome. Please feel free to use our `Jupyter Discourse Forum <https://discourse.jupyter.org/>`_ to contact our team.
Looking forward to hearing from you!
.. _JupyterHub: https://github.com/jupyterhub/jupyterhub
.. _Jupyter notebook: https://jupyter-notebook.readthedocs.io/en/latest/

View File

@@ -0,0 +1,7 @@
---
orphan: true
---
# JupyterHub the hard way
This guide has moved to <https://github.com/jupyterhub/jupyterhub-the-hard-way/blob/HEAD/docs/installation-guide-hard.md>

View File

@@ -1,6 +0,0 @@
:orphan:
JupyterHub the hard way
=======================
This guide has moved to https://github.com/jupyterhub/jupyterhub-the-hard-way/blob/HEAD/docs/installation-guide-hard.md

View File

@@ -1,13 +0,0 @@
Installation
============
These sections cover how to get up-and-running with JupyterHub. They cover
some basics of the tools needed to deploy JupyterHub as well as how to get it
running on your own infrastructure.
.. toctree::
:maxdepth: 3
quickstart
quickstart-docker
installation-basics

View File

@@ -1,69 +0,0 @@
Install JupyterHub with Docker
==============================
The JupyterHub `docker image <https://hub.docker.com/r/jupyterhub/jupyterhub/>`_ is the fastest way to set up Jupyterhub in your local development environment.
.. note::
This ``jupyterhub/jupyterhub`` docker image is only an image for running
the Hub service itself. It does not provide the other Jupyter components,
such as Notebook installation, which are needed by the single-user servers.
To run the single-user servers, which may be on the same system as the Hub or
not, `JupyterLab <https://jupyterlab.readthedocs.io/>`_ or Jupyter Notebook must be installed.
.. important::
We strongly recommend that you follow the `Zero to JupyterHub`_ tutorial to
install JupyterHub.
Prerequisites
-------------
You should have `Docker`_ installed on a Linux/Unix based system.
Run the Docker Image
--------------------
To pull the latest JupyterHub image and start the `jupyterhub` container, run this command in your terminal.
::
docker run -d -p 8000:8000 --name jupyterhub jupyterhub/jupyterhub jupyterhub
This command exposes the Jupyter container on port:8000. Navigate to `http://localhost:8000` in a web browser to access the JupyterHub console.
You can stop and resume the container by running `docker stop` and `docker start` respectively.
::
# find the container id
docker ps
# stop the running container
docker stop <container-id>
# resume the paused container
docker start <container-id>
If you want to run docker on a computer that has a public IP then you should
(as in MUST) **secure it with ssl** by adding ssl options to your docker
configuration or using an ssl enabled proxy.
`Mounting volumes <https://docs.docker.com/engine/admin/volumes/volumes/>`_
enables you to persist and store the data generated by the docker container, even when you stop the container.
The persistent data can be stored on the host system, outside the container.
Create System Users
-------------------
Spawn a root shell in your docker container by running this command in the terminal.::
docker exec -it jupyterhub bash
The created accounts will be used for authentication in JupyterHub's default
configuration.
.. _Zero to JupyterHub: https://zero-to-jupyterhub.readthedocs.io/en/latest/
.. _Docker: https://www.docker.com/

View File

@@ -13,6 +13,7 @@ The files are:
This file is JupyterHub's REST API schema. Both a version and the RBAC
scopes descriptions are updated in it.
"""
import os
from collections import defaultdict
from pathlib import Path

View File

@@ -1,4 +1,9 @@
(RBAC)=
<!---
RBAC docs are part of the Explanation section of the JupyterHub documentation.
As a result, this index file is referenced in the toctree within the explanation/index.md file.
--->
(rbac)=
# JupyterHub RBAC

View File

@@ -1,8 +1,10 @@
(jupyterhub-scopes)=
# Scopes in JupyterHub
A scope has a syntax-based design that reveals which resources it provides access to. Resources are objects with a type, associated data, relationships to other resources, and a set of methods that operate on them (see [RESTful API](https://restful-api-design.readthedocs.io/en/latest/resources.html) documentation for more information).
`<resource>` in the RBAC scope design refers to the resource name in the [JupyterHub's API](../reference/rest-api.rst) endpoints in most cases. For instance, `<resource>` equal to `users` corresponds to JupyterHub's API endpoints beginning with _/users_.
`<resource>` in the RBAC scope design refers to the resource name in the [JupyterHub's API](jupyterhub-rest-API) endpoints in most cases. For instance, `<resource>` equal to `users` corresponds to JupyterHub's API endpoints beginning with _/users_.
(scope-conventions-target)=
@@ -298,6 +300,6 @@ Custom scope _filters_ are NOT supported.
### Scopes and APIs
The scopes are also listed in the [](../reference/rest-api.rst) documentation. Each API endpoint has a list of scopes which can be used to access the API; if no scopes are listed, the API is not authenticated and can be accessed without any permissions (i.e., no scopes).
The scopes are also listed in the [](jupyterhub-rest-API) documentation. Each API endpoint has a list of scopes which can be used to access the API; if no scopes are listed, the API is not authenticated and can be accessed without any permissions (i.e., no scopes).
Listed scopes by each API endpoint reflect the "lowest" permissions required to gain any access to the corresponding API. For example, posting user's activity (_POST /users/:name/activity_) needs `users:activity` scope. If scope `users` is passed during the request, the access will be granted as the required scope is a subscope of the `users` scope. If, on the other hand, `read:users:activity` scope is passed, the access will be denied.

View File

@@ -65,7 +65,7 @@ If the token's scopes are a subset of the token owner's scopes, the token is iss
{ref}`Figure 1 <token-request-chart>` below illustrates the steps involved. The orange rectangles highlight where in the process the roles and scopes are resolved.
```{figure} ../images/rbac-token-request-chart.png
```{figure} /images/rbac-token-request-chart.png
:align: center
:name: token-request-chart
@@ -91,7 +91,7 @@ The passed scopes are compared to the scopes required to access the API as follo
{ref}`Figure 2 <api-request-chart>` illustrates this process highlighting the steps where the role and scope resolutions as well as filtering occur in orange.
```{figure} ../images/rbac-api-request-chart.png
```{figure} /images/rbac-api-request-chart.png
:align: center
:name: api-request-chart

View File

@@ -11,7 +11,7 @@ No other database records are affected.
## Upgrade steps
1. All running **servers must be stopped** before proceeding with the upgrade.
2. To upgrade the Hub, follow the [Upgrading JupyterHub](../admin/upgrading.rst) instructions.
2. To upgrade the Hub, follow the [Upgrading JupyterHub](upgrading-jupyterhub) instructions.
```{attention}
We advise against defining any new roles in the `jupyterhub.config.py` file right after the upgrade is completed and JupyterHub restarted for the first time. This preserves the 'current' state of the Hub. You can define and assign new roles on any other following startup.
```
@@ -45,7 +45,7 @@ OAuth token is issued by the Hub to a single-user server when the user logs in.
API token is issued by the Hub to a single-user server when launched and is used to communicate with the Hub's APIs such as posting activity or completing the OAuth flow. This token has no expiry by default.
API tokens can also be issued to users via API ([_/hub/token_](../reference/urls.md) or [_POST /users/:username/tokens_](../reference/rest-api.rst)) and services via `jupyterhub_config.py` to perform API requests.
API tokens can also be issued to users via API ([_/hub/token_](jupyterhub-url) or [_POST /users/:username/tokens_](jupyterhub-rest-API)) and services via `jupyterhub_config.py` to perform API requests.
### With RBAC

View File

@@ -3,13 +3,13 @@
To determine which scopes a role should have, one can follow these steps:
1. Determine what actions the role holder should have/have not access to
2. Match the actions against the [JupyterHub's APIs](../reference/rest-api.rst)
2. Match the actions against the [JupyterHub's APIs](jupyterhub-rest-API)
3. Check which scopes are required to access the APIs
4. Combine scopes and subscopes if applicable
5. Customize the scopes with filters if needed
6. Define the role with required scopes and assign to users/services/groups/tokens
Below, different use cases are presented on how to use the [RBAC framework](./index.md)
Below, different use cases are presented on how to use the [RBAC framework](rbac)
## Service to cull idle servers

54
docs/source/redirects.txt Normal file
View File

@@ -0,0 +1,54 @@
# This file contains rediraffe redirects as generated from the docs/source/conf.py file
# For more information, see rediraffe configuration in the conf.py file.
"changelog.md" "reference/changelog.md"
"contributor-list.md" "contributing/contributor-list.md"
"gallery-jhub-deployments.md" "reference/gallery-jhub-deployments.md"
"installation-basics.md" "tutorial/installation-basics.md"
"quickstart.md" "tutorial/quickstart.md"
"quickstart-docker.md" "tutorial/quickstart-docker.md"
"troubleshooting.md" "faq/troubleshooting.md"
"admin/capacity-planning.md" "explanation/capacity-planning.md"
"admin/log-messages.md" "howto/log-messages.md"
"admin/upgrading.md" "howto/upgrading.md"
"events/index.md" "reference/event-logging.md"
"getting-started/authenticators-users-basics.md" "tutorial/getting-started/authenticators-users-basics.md"
"getting-started/config-basics.md" "tutorial/getting-started/config-basics.md"
"getting-started/faq.md" "faq/faq.md"
"getting-started/institutional-faq.md" "faq/institutional-faq.md"
"getting-started/networking-basics.md" "tutorial/getting-started/networking-basics.md"
"getting-started/services-basics.md" "tutorial/getting-started/services-basics.md"
"getting-started/spawners-basics.md" "tutorial/getting-started/spawners-basics.md"
"reference/api-only.md" "howto/api-only.md"
"reference/config-ghoauth.md" "howto/configuration/config-ghoauth.md"
"reference/config-proxy.md" "howto/configuration/config-proxy.md"
"reference/database.md" "explanation/database.md"
"reference/oauth.md" "explanation/oauth.md"
"reference/proxy.md" "howto/proxy.md"
"reference/templates.md" "howto/templates.md"
"reference/config-examples.md" "howto/index.md"
"reference/config-sudo.md" "howto/configuration/config-sudo.md"
"reference/config-user-env.md" "howto/configuration/config-user-env.md"
"reference/rest.md" "howto/rest.md"
"reference/separate-proxy.md" "howto/separate-proxy.md"
"reference/server-api.md" "tutorial/server-api.md"
"reference/websecurity.md" "explanation/websecurity.md"
"api/app.md" "reference/api/app.md"
"api/auth.md" "reference/api/auth.md"
"api/index.md" "reference/api/index.md"
"api/proxy.md" "reference/api/proxy.md"
"api/service.md" "reference/api/service.md"
"api/services.auth.md" "reference/api/services.auth.md"
"api/spawner.md" "reference/api/spawner.md"
"api/user.md" "reference/api/user.md"
# -- JupyterHub 4.0 --
# redirects above are up-to-date as of JupyterHub 4.0
# add future redirects below
# (e.g. with `make rediraffewritediff`)

View File

@@ -0,0 +1,13 @@
# Application configuration
## Module: {mod}`jupyterhub.app`
```{eval-rst}
.. automodule:: jupyterhub.app
```
### {class}`JupyterHub`
```{eval-rst}
.. autoconfigurable:: JupyterHub
```

View File

@@ -0,0 +1,33 @@
# Authenticators
## Module: {mod}`jupyterhub.auth`
```{eval-rst}
.. automodule:: jupyterhub.auth
```
### {class}`Authenticator`
```{eval-rst}
.. autoconfigurable:: Authenticator
:members:
```
### {class}`LocalAuthenticator`
```{eval-rst}
.. autoconfigurable:: LocalAuthenticator
:members:
```
### {class}`PAMAuthenticator`
```{eval-rst}
.. autoconfigurable:: PAMAuthenticator
```
### {class}`DummyAuthenticator`
```{eval-rst}
.. autoconfigurable:: DummyAuthenticator
```

View File

@@ -0,0 +1,36 @@
(api-index)=
# JupyterHub API Reference
<!--
Below is a MyST field list, using MyST substitution, as supported
by enabling the respective MyST extensions in docs/source/conf.py.
-->
:Date: {{ date }}
:Release: {{ version }}
JupyterHub also provides a REST API for administration of the Hub and users.
The documentation on [Using JupyterHub's REST API](using-jupyterhub-rest-api) provides
information on:
- what you can do with the API
- creating an API token
- adding API tokens to the config files
- making an API request programmatically using the requests library
- learning more about JupyterHub's API
```{toctree}
:maxdepth: 1
../rest-api
app
auth
spawner
proxy
user
service
services.auth
```
[openapi initiative]: https://www.openapis.org/

View File

@@ -0,0 +1,21 @@
# Proxies
## Module: {mod}`jupyterhub.proxy`
```{eval-rst}
.. automodule:: jupyterhub.proxy
```
### {class}`Proxy`
```{eval-rst}
.. autoconfigurable:: Proxy
:members:
```
### {class}`ConfigurableHTTPProxy`
```{eval-rst}
.. autoconfigurable:: ConfigurableHTTPProxy
:members: debug, auth_token, check_running_interval, api_url, command
```

View File

@@ -0,0 +1,14 @@
# Services
## Module: {mod}`jupyterhub.services.service`
```{eval-rst}
.. automodule:: jupyterhub.services.service
```
### {class}`Service`
```{eval-rst}
.. autoconfigurable:: Service
:members: name, admin, url, api_token, managed, kind, command, cwd, environment, user, oauth_client_id, server, prefix, proxy_spec
```

View File

@@ -0,0 +1,40 @@
# Services Authentication
## Module: {mod}`jupyterhub.services.auth`
```{eval-rst}
.. automodule:: jupyterhub.services.auth
```
### {class}`HubAuth`
```{eval-rst}
.. autoconfigurable:: HubAuth
:members:
```
### {class}`HubOAuth`
```{eval-rst}
.. autoconfigurable:: HubOAuth
:members:
```
### {class}`HubAuthenticated`
```{eval-rst}
.. autoclass:: HubAuthenticated
:members:
```
### {class}`HubOAuthenticated`
```{eval-rst}
.. autoclass:: HubOAuthenticated
```
### {class}`HubOAuthCallbackHandler`
```{eval-rst}
.. autoclass:: HubOAuthCallbackHandler
```

View File

@@ -0,0 +1,20 @@
# Spawners
## Module: {mod}`jupyterhub.spawner`
```{eval-rst}
.. automodule:: jupyterhub.spawner
```
### {class}`Spawner`
```{eval-rst}
.. autoconfigurable:: Spawner
:members: options_from_form, poll, start, stop, get_args, get_env, get_state, template_namespace, format_string, create_certs, move_certs
```
### {class}`LocalProcessSpawner`
```{eval-rst}
.. autoconfigurable:: LocalProcessSpawner
```

View File

@@ -0,0 +1,34 @@
# Users
## Module: {mod}`jupyterhub.user`
```{eval-rst}
.. automodule:: jupyterhub.user
```
### {class}`UserDict`
```{eval-rst}
.. autoclass:: UserDict
:members:
```
### {class}`User`
```{eval-rst}
.. autoclass:: User
:members: escaped_name
.. attribute:: name
The user's name
.. attribute:: server
The user's Server data object if running, None otherwise.
Has ``ip``, ``port`` attributes.
.. attribute:: spawner
The user's :class:`~.Spawner` instance.
```

View File

@@ -1,3 +1,5 @@
(authenticators-reference)=
# Authenticators
The {class}`.Authenticator` is the mechanism for authorizing users to use the
@@ -28,7 +30,6 @@ popular services:
- Globus
- Google
- MediaWiki
- Okpy
- OpenShift
A [generic implementation](https://github.com/jupyterhub/oauthenticator/blob/master/oauthenticator/generic.py), which you can use for OAuth authentication with any provider, is also available.
@@ -271,7 +272,7 @@ c.Spawner.auth_state_hook = auth_state_hook
:::
Some identity providers may have their own concept of group membership that you would like to preserve in JupyterHub.
This is now possible with `Authenticator.managed_groups`.
This is now possible with `Authenticator.manage_groups`.
You can set the config:

View File

@@ -1,3 +1,5 @@
(changelog)=
# Changelog
For detailed changes from the prior release, click on the version number, and
@@ -6,8 +8,281 @@ command line for details.
## [Unreleased]
## 4.1
### 4.1.0 - 2024-03
JupyterHub 4.1 is a security release, fixing [CVE-2024-28233].
All JupyterHub deployments are encouraged to upgrade,
especially those with other user content on peer domains to JupyterHub.
As always, JupyterHub deployments are especially encouraged to enable per-user domains if protecting users from each other is a concern.
For more information on securely deploying JupyterHub, see the [web security documentation](web-security).
[CVE-2024-28233]: https://github.com/jupyterhub/jupyterhub/security/advisories/GHSA-7r3h-4ph8-w38g
([full changelog](https://github.com/jupyterhub/jupyterhub/compare/4.0.2...4.1.0))
#### Enhancements made
- Backport PR #4628 on branch 4.x (Include LDAP groups in local spawner gids) [#4735](https://github.com/jupyterhub/jupyterhub/pull/4735) ([@minrk](https://github.com/minrk))
- Backport PR #4561 on branch 4.x (Improve debugging when waiting for servers) [#4714](https://github.com/jupyterhub/jupyterhub/pull/4714) ([@minrk](https://github.com/minrk))
- Backport PR #4563 on branch 4.x (only set 'domain' field on session-id cookie) [#4707](https://github.com/jupyterhub/jupyterhub/pull/4707) ([@minrk](https://github.com/minrk))
#### Bugs fixed
- Backport PR #4733 on branch 4.x (Catch ValueError while waiting for server to be reachable) [#4734](https://github.com/jupyterhub/jupyterhub/pull/4734) ([@minrk](https://github.com/minrk))
- Backport PR #4679 on branch 4.x (Unescape jinja username) [#4705](https://github.com/jupyterhub/jupyterhub/pull/4705) ([@minrk](https://github.com/minrk))
- Backport PR #4630: avoid setting unused oauth state cookies on API requests [#4697](https://github.com/jupyterhub/jupyterhub/pull/4697) ([@minrk](https://github.com/minrk))
- Backport PR #4632: simplify, avoid errors in parsing accept headers [#4696](https://github.com/jupyterhub/jupyterhub/pull/4696) ([@minrk](https://github.com/minrk))
- Backport PR #4677 on branch 4.x (Improve validation, docs for token.expires_in) [#4692](https://github.com/jupyterhub/jupyterhub/pull/4692) ([@minrk](https://github.com/minrk))
- Backport PR #4570 on branch 4.x (fix mutation of frozenset in scope intersection) [#4691](https://github.com/jupyterhub/jupyterhub/pull/4691) ([@minrk](https://github.com/minrk))
- Backport PR #4562 on branch 4.x (Use `user.stop` to cleanup spawners that stopped while Hub was down) [#4690](https://github.com/jupyterhub/jupyterhub/pull/4690) ([@minrk](https://github.com/minrk))
- Backport PR #4542 on branch 4.x (Fix include_stopped_servers in paginated next_url) [#4689](https://github.com/jupyterhub/jupyterhub/pull/4689) ([@minrk](https://github.com/minrk))
- Backport PR #4651 on branch 4.x (avoid attempting to patch removed IPythonHandler with notebook v7) [#4688](https://github.com/jupyterhub/jupyterhub/pull/4688) ([@minrk](https://github.com/minrk))
- Backport PR #4560 on branch 4.x (singleuser extension: persist token from ?token=... url in cookie) [#4687](https://github.com/jupyterhub/jupyterhub/pull/4687) ([@minrk](https://github.com/minrk))
#### Maintenance and upkeep improvements
- Backport quay.io publishing [#4698](https://github.com/jupyterhub/jupyterhub/pull/4698) ([@minrk](https://github.com/minrk))
- Backport PR #4617: try to improve reliability of test_external_proxy [#4695](https://github.com/jupyterhub/jupyterhub/pull/4695) ([@minrk](https://github.com/minrk))
- Backport PR #4618 on branch 4.x (browser test: wait for token request to finish before reloading) [#4694](https://github.com/jupyterhub/jupyterhub/pull/4694) ([@minrk](https://github.com/minrk))
- preparing 4.x branch [#4685](https://github.com/jupyterhub/jupyterhub/pull/4685) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
#### Contributors to this release
The following people contributed discussions, new ideas, code and documentation contributions, and review.
See [our definition of contributors](https://github-activity.readthedocs.io/en/latest/#how-does-this-tool-define-contributions-in-the-reports).
([GitHub contributors page for this release](https://github.com/jupyterhub/jupyterhub/graphs/contributors?from=2023-08-10&to=2024-03-19&type=c))
@Achele ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AAchele+updated%3A2023-08-10..2024-03-19&type=Issues)) | @akashthedeveloper ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aakashthedeveloper+updated%3A2023-08-10..2024-03-19&type=Issues)) | @balajialg ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Abalajialg+updated%3A2023-08-10..2024-03-19&type=Issues)) | @BhavyaT-135 ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3ABhavyaT-135+updated%3A2023-08-10..2024-03-19&type=Issues)) | @blink1073 ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ablink1073+updated%3A2023-08-10..2024-03-19&type=Issues)) | @consideRatio ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AconsideRatio+updated%3A2023-08-10..2024-03-19&type=Issues)) | @fcollonval ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Afcollonval+updated%3A2023-08-10..2024-03-19&type=Issues)) | @I-Am-D-B ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AI-Am-D-B+updated%3A2023-08-10..2024-03-19&type=Issues)) | @jakirkham ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ajakirkham+updated%3A2023-08-10..2024-03-19&type=Issues)) | @ktaletsk ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aktaletsk+updated%3A2023-08-10..2024-03-19&type=Issues)) | @kzgrzendek ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Akzgrzendek+updated%3A2023-08-10..2024-03-19&type=Issues)) | @lumberbot-app ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Alumberbot-app+updated%3A2023-08-10..2024-03-19&type=Issues)) | @manics ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Amanics+updated%3A2023-08-10..2024-03-19&type=Issues)) | @mbiette ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ambiette+updated%3A2023-08-10..2024-03-19&type=Issues)) | @minrk ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aminrk+updated%3A2023-08-10..2024-03-19&type=Issues)) | @rcthomas ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Arcthomas+updated%3A2023-08-10..2024-03-19&type=Issues)) | @ryanlovett ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aryanlovett+updated%3A2023-08-10..2024-03-19&type=Issues)) | @sgaist ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Asgaist+updated%3A2023-08-10..2024-03-19&type=Issues)) | @shubham0473 ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ashubham0473+updated%3A2023-08-10..2024-03-19&type=Issues)) | @Temidayo32 ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3ATemidayo32+updated%3A2023-08-10..2024-03-19&type=Issues)) | @willingc ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Awillingc+updated%3A2023-08-10..2024-03-19&type=Issues)) | @yuvipanda ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ayuvipanda+updated%3A2023-08-10..2024-03-19&type=Issues))
## 4.0
### 4.0.2 - 2023-08-10
([full changelog](https://github.com/jupyterhub/jupyterhub/compare/4.0.1...4.0.2))
#### Enhancements made
- avoid counting failed requests to not-running servers as 'activity' [#4491](https://github.com/jupyterhub/jupyterhub/pull/4491) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- improve permission-denied errors for various cases [#4489](https://github.com/jupyterhub/jupyterhub/pull/4489) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
#### Bugs fixed
- set root_dir when using singleuser extension [#4503](https://github.com/jupyterhub/jupyterhub/pull/4503) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio), [@manics](https://github.com/manics))
- Allow setting custom log_function in tornado_settings in SingleUserServer [#4475](https://github.com/jupyterhub/jupyterhub/pull/4475) ([@grios-stratio](https://github.com/grios-stratio), [@minrk](https://github.com/minrk))
#### Documentation improvements
- doc: update notebook config URL [#4523](https://github.com/jupyterhub/jupyterhub/pull/4523) ([@minrk](https://github.com/minrk), [@manics](https://github.com/manics))
- document how to use notebook v7 with jupyterhub [#4522](https://github.com/jupyterhub/jupyterhub/pull/4522) ([@minrk](https://github.com/minrk), [@manics](https://github.com/manics))
#### Contributors to this release
The following people contributed discussions, new ideas, code and documentation contributions, and review.
See [our definition of contributors](https://github-activity.readthedocs.io/en/latest/#how-does-this-tool-define-contributions-in-the-reports).
([GitHub contributors page for this release](https://github.com/jupyterhub/jupyterhub/graphs/contributors?from=2023-06-08&to=2023-08-10&type=c))
@agelosnm ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aagelosnm+updated%3A2023-06-08..2023-08-10&type=Issues)) | @consideRatio ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AconsideRatio+updated%3A2023-06-08..2023-08-10&type=Issues)) | @diocas ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Adiocas+updated%3A2023-06-08..2023-08-10&type=Issues)) | @grios-stratio ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Agrios-stratio+updated%3A2023-06-08..2023-08-10&type=Issues)) | @jhgoebbert ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ajhgoebbert+updated%3A2023-06-08..2023-08-10&type=Issues)) | @jtpio ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ajtpio+updated%3A2023-06-08..2023-08-10&type=Issues)) | @kosmonavtus ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Akosmonavtus+updated%3A2023-06-08..2023-08-10&type=Issues)) | @kreuzert ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Akreuzert+updated%3A2023-06-08..2023-08-10&type=Issues)) | @manics ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Amanics+updated%3A2023-06-08..2023-08-10&type=Issues)) | @martinRenou ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AmartinRenou+updated%3A2023-06-08..2023-08-10&type=Issues)) | @minrk ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aminrk+updated%3A2023-06-08..2023-08-10&type=Issues)) | @opoplawski ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aopoplawski+updated%3A2023-06-08..2023-08-10&type=Issues)) | @Ph0tonic ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3APh0tonic+updated%3A2023-06-08..2023-08-10&type=Issues)) | @sgaist ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Asgaist+updated%3A2023-06-08..2023-08-10&type=Issues)) | @trungleduc ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Atrungleduc+updated%3A2023-06-08..2023-08-10&type=Issues)) | @yuvipanda ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ayuvipanda+updated%3A2023-06-08..2023-08-10&type=Issues))
### 4.0.1 - 2023-06-08
([full changelog](https://github.com/jupyterhub/jupyterhub/compare/4.0.0...4.0.1))
#### Enhancements made
- Delete server button on admin page [#4457](https://github.com/jupyterhub/jupyterhub/pull/4457) ([@diocas](https://github.com/diocas), [@minrk](https://github.com/minrk))
#### Bugs fixed
- Abort informatively on unrecognized CLI options [#4467](https://github.com/jupyterhub/jupyterhub/pull/4467) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Add xsrf to custom_html template context [#4464](https://github.com/jupyterhub/jupyterhub/pull/4464) ([@opoplawski](https://github.com/opoplawski), [@minrk](https://github.com/minrk))
- preserve CLI > env priority config in jupyterhub-singleuser extension [#4451](https://github.com/jupyterhub/jupyterhub/pull/4451) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio), [@timeu](https://github.com/timeu), [@rcthomas](https://github.com/rcthomas))
#### Maintenance and upkeep improvements
- Fix link to collaboration accounts doc in example [#4448](https://github.com/jupyterhub/jupyterhub/pull/4448) ([@minrk](https://github.com/minrk))
- Remove Dockerfile.alpine [#4444](https://github.com/jupyterhub/jupyterhub/pull/4444) ([@manics](https://github.com/manics), [@minrk](https://github.com/minrk))
- Update jsx dependencies as much as possible [#4443](https://github.com/jupyterhub/jupyterhub/pull/4443) ([@manics](https://github.com/manics), [@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Remove unused admin JS code [#4438](https://github.com/jupyterhub/jupyterhub/pull/4438) ([@yuvipanda](https://github.com/yuvipanda), [@minrk](https://github.com/minrk))
- Finish migrating browser tests from selenium to playwright [#4435](https://github.com/jupyterhub/jupyterhub/pull/4435) ([@mouse1203](https://github.com/mouse1203), [@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Migrate some tests from selenium to playwright [#4431](https://github.com/jupyterhub/jupyterhub/pull/4431) ([@mouse1203](https://github.com/mouse1203), [@minrk](https://github.com/minrk))
- Begin setup of playwright tests [#4420](https://github.com/jupyterhub/jupyterhub/pull/4420) ([@mouse1203](https://github.com/mouse1203), [@minrk](https://github.com/minrk), [@manics](https://github.com/manics))
#### Documentation improvements
- Reorder token request docs [#4463](https://github.com/jupyterhub/jupyterhub/pull/4463) ([@minrk](https://github.com/minrk), [@manics](https://github.com/manics))
- 'servers' should be a dict of dicts, not a list of dicts in rest-api.yml [#4458](https://github.com/jupyterhub/jupyterhub/pull/4458) ([@tfmark](https://github.com/tfmark), [@minrk](https://github.com/minrk))
- Config reference: link to nicer(?) API docs first [#4456](https://github.com/jupyterhub/jupyterhub/pull/4456) ([@manics](https://github.com/manics), [@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Add CERN to Gallery of JupyterHub Deployments [#4454](https://github.com/jupyterhub/jupyterhub/pull/4454) ([@goseind](https://github.com/goseind), [@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Fix "Thanks" typo. [#4441](https://github.com/jupyterhub/jupyterhub/pull/4441) ([@ryanlovett](https://github.com/ryanlovett), [@minrk](https://github.com/minrk))
- add HUNT into research institutions [#4432](https://github.com/jupyterhub/jupyterhub/pull/4432) ([@matuskosut](https://github.com/matuskosut), [@minrk](https://github.com/minrk), [@manics](https://github.com/manics))
- docs: fix missing redirects for api to reference/api [#4429](https://github.com/jupyterhub/jupyterhub/pull/4429) ([@consideRatio](https://github.com/consideRatio), [@minrk](https://github.com/minrk), [@manics](https://github.com/manics))
- update sharing faq for 2023 [#4428](https://github.com/jupyterhub/jupyterhub/pull/4428) ([@minrk](https://github.com/minrk))
- Fix some public URL links within the docs [#4427](https://github.com/jupyterhub/jupyterhub/pull/4427) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- add upgrade note for 4.0 to changelog [#4426](https://github.com/jupyterhub/jupyterhub/pull/4426) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
#### Contributors to this release
The following people contributed discussions, new ideas, code and documentation contributions, and review.
See [our definition of contributors](https://github-activity.readthedocs.io/en/latest/#how-does-this-tool-define-contributions-in-the-reports).
([GitHub contributors page for this release](https://github.com/jupyterhub/jupyterhub/graphs/contributors?from=2023-04-20&to=2023-06-07&type=c))
@consideRatio ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AconsideRatio+updated%3A2023-04-20..2023-06-07&type=Issues)) | @diocas ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Adiocas+updated%3A2023-04-20..2023-06-07&type=Issues)) | @echarles ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aecharles+updated%3A2023-04-20..2023-06-07&type=Issues)) | @goseind ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Agoseind+updated%3A2023-04-20..2023-06-07&type=Issues)) | @hsadia538 ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ahsadia538+updated%3A2023-04-20..2023-06-07&type=Issues)) | @mahamtariq58 ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Amahamtariq58+updated%3A2023-04-20..2023-06-07&type=Issues)) | @manics ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Amanics+updated%3A2023-04-20..2023-06-07&type=Issues)) | @matuskosut ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Amatuskosut+updated%3A2023-04-20..2023-06-07&type=Issues)) | @minrk ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aminrk+updated%3A2023-04-20..2023-06-07&type=Issues)) | @mouse1203 ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Amouse1203+updated%3A2023-04-20..2023-06-07&type=Issues)) | @opoplawski ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aopoplawski+updated%3A2023-04-20..2023-06-07&type=Issues)) | @rcthomas ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Arcthomas+updated%3A2023-04-20..2023-06-07&type=Issues)) | @ryanlovett ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aryanlovett+updated%3A2023-04-20..2023-06-07&type=Issues)) | @tfmark ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Atfmark+updated%3A2023-04-20..2023-06-07&type=Issues)) | @timeu ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Atimeu+updated%3A2023-04-20..2023-06-07&type=Issues)) | @yuvipanda ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ayuvipanda+updated%3A2023-04-20..2023-06-07&type=Issues))
### 4.0.0 - 2023-04-20
4.0 is a major release, but a small one.
:::{admonition} Upgrade note
Upgrading from 3.1 to 4.0 should require no additional action beyond running `jupyterhub --upgrade-db` to upgrade the database schema after upgrading the package version.
It is otherwise a regular jupyterhub [upgrade](upgrading-jupyterhub).
:::
There are three major changes that _should_ be invisible to most users:
1. Groups can now have 'properties', editable via the admin page, which can be used by Spawners for their operations.
This requires a db schema upgrade, so remember to [**backup and upgrade your database**](upgrading-jupyterhub)!
2. Often-problematic header-based checks for cross-site requests have been replaces with more standard use of XSRF tokens.
Most folks shouldn't notice this change, but if "Blocking Cross Origin API request" has been giving you headaches, this should be much improved.
3. Improved support for Jupyter Server 2.0 by reimplementing `jupyterhub-singleuser` as a standard _server extension_.
This mode is used by default with Jupyter Server >=2.0.
Again, this should be an implementation detail to most, but it's a big change under the hood.
If you have issues, please let us know and you can opt-out by setting `JUPYTERHUB_SINGLEUSER_EXTENSION=0` in your single-user environment.
In addition to these, thanks to contributions from this years Outreachy interns, we have reorganized the documentation according to [diataxis](https://diataxis.fr), improved accessibility of JupyterHub pages, and improved testing.
([full changelog](https://github.com/jupyterhub/jupyterhub/compare/3.1.0...4.0.0))
#### API and Breaking Changes
- require sqlalchemy 1.4 [#4319](https://github.com/jupyterhub/jupyterhub/pull/4319) ([@minrk](https://github.com/minrk), [@manics](https://github.com/manics))
- Use XSRF tokens for cross-site checks [#4032](https://github.com/jupyterhub/jupyterhub/pull/4032) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio), [@julietKiloRomeo](https://github.com/julietKiloRomeo))
#### New features added
- add Spawner.server_token_scopes config [#4400](https://github.com/jupyterhub/jupyterhub/pull/4400) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Make singleuser server-extension default [#4354](https://github.com/jupyterhub/jupyterhub/pull/4354) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- singleuser auth as server extension [#3888](https://github.com/jupyterhub/jupyterhub/pull/3888) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Dynamic table for changing customizable properties of groups [#3651](https://github.com/jupyterhub/jupyterhub/pull/3651) ([@vladfreeze](https://github.com/vladfreeze), [@minrk](https://github.com/minrk), [@naatebarber](https://github.com/naatebarber), [@manics](https://github.com/manics))
#### Enhancements made
- admin page: improve display of long lists (groups, etc.) [#4417](https://github.com/jupyterhub/jupyterhub/pull/4417) ([@manics](https://github.com/manics), [@minrk](https://github.com/minrk), [@ryanlovett](https://github.com/ryanlovett))
- add a few more buckets for server_spawn_duration_seconds [#4352](https://github.com/jupyterhub/jupyterhub/pull/4352) ([@shaneknapp](https://github.com/shaneknapp), [@yuvipanda](https://github.com/yuvipanda))
- Improve contrast on muted text [#4326](https://github.com/jupyterhub/jupyterhub/pull/4326) ([@bl-aire](https://github.com/bl-aire), [@minrk](https://github.com/minrk))
- Standardize styling on input fields by moving common form CSS to page.less [#4294](https://github.com/jupyterhub/jupyterhub/pull/4294) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
#### Bugs fixed
- make sure named server URLs include trailing slash [#4402](https://github.com/jupyterhub/jupyterhub/pull/4402) ([@minrk](https://github.com/minrk), [@manics](https://github.com/manics))
- fix inclusion of singleuser/templates/page.html in wheel [#4387](https://github.com/jupyterhub/jupyterhub/pull/4387) ([@consideRatio](https://github.com/consideRatio), [@minrk](https://github.com/minrk))
- exponential_backoff: preserve jitter when max_wait is reached [#4383](https://github.com/jupyterhub/jupyterhub/pull/4383) ([@minrk](https://github.com/minrk), [@manics](https://github.com/manics))
- admin panel: fix condition for start/stop buttons on user servers [#4365](https://github.com/jupyterhub/jupyterhub/pull/4365) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- avoid logging error when browsers send invalid cookies [#4356](https://github.com/jupyterhub/jupyterhub/pull/4356) ([@minrk](https://github.com/minrk), [@manics](https://github.com/manics), [@consideRatio](https://github.com/consideRatio))
- test and fix deprecated load_groups list [#4299](https://github.com/jupyterhub/jupyterhub/pull/4299) ([@minrk](https://github.com/minrk), [@manics](https://github.com/manics))
- Fix formatting of load_groups help string [#4295](https://github.com/jupyterhub/jupyterhub/pull/4295) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Fix skipped heading level across pages [#4290](https://github.com/jupyterhub/jupyterhub/pull/4290) ([@bl-aire](https://github.com/bl-aire), [@minrk](https://github.com/minrk))
- Fix reoccurring accessibility issues in JupyterHub's pages [#4274](https://github.com/jupyterhub/jupyterhub/pull/4274) ([@bl-aire](https://github.com/bl-aire), [@minrk](https://github.com/minrk))
- Remove remnants of unused jupyterhub-services cookie [#4258](https://github.com/jupyterhub/jupyterhub/pull/4258) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
#### Maintenance and upkeep improvements
- add remaining redirects for docs reorg [#4423](https://github.com/jupyterhub/jupyterhub/pull/4423) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Disable dev traitlets [#4419](https://github.com/jupyterhub/jupyterhub/pull/4419) ([@manics](https://github.com/manics), [@consideRatio](https://github.com/consideRatio))
- dependabot: rename to .yaml [#4409](https://github.com/jupyterhub/jupyterhub/pull/4409) ([@consideRatio](https://github.com/consideRatio))
- dependabot: fix syntax error of not using quotes for ##:## [#4408](https://github.com/jupyterhub/jupyterhub/pull/4408) ([@consideRatio](https://github.com/consideRatio))
- dependabot: monthly updates of github actions [#4403](https://github.com/jupyterhub/jupyterhub/pull/4403) ([@consideRatio](https://github.com/consideRatio), [@minrk](https://github.com/minrk))
- Refresh 4.0 changelog [#4396](https://github.com/jupyterhub/jupyterhub/pull/4396) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Reduce size of jupyterhub image [#4394](https://github.com/jupyterhub/jupyterhub/pull/4394) ([@alekseyolg](https://github.com/alekseyolg), [@minrk](https://github.com/minrk))
- Selenium: updating test_oauth_page [#4393](https://github.com/jupyterhub/jupyterhub/pull/4393) ([@mouse1203](https://github.com/mouse1203), [@minrk](https://github.com/minrk))
- avoid warning on engine_connect listener [#4392](https://github.com/jupyterhub/jupyterhub/pull/4392) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio), [@manics](https://github.com/manics))
- remove pin from singleuser [#4379](https://github.com/jupyterhub/jupyterhub/pull/4379) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio), [@mathbunnyru](https://github.com/mathbunnyru))
- temporary fix: pin base-notebook tag [#4348](https://github.com/jupyterhub/jupyterhub/pull/4348) ([@minrk](https://github.com/minrk))
- simplify some async fixtures [#4332](https://github.com/jupyterhub/jupyterhub/pull/4332) ([@minrk](https://github.com/minrk), [@GeorgianaElena](https://github.com/GeorgianaElena), [@Sheila-nk](https://github.com/Sheila-nk))
- Selenium: adding new cases that covered Admin UI page [#4328](https://github.com/jupyterhub/jupyterhub/pull/4328) ([@mouse1203](https://github.com/mouse1203), [@minrk](https://github.com/minrk))
- also ignore sqlite backups [#4327](https://github.com/jupyterhub/jupyterhub/pull/4327) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- pre-commit: bump isort [#4325](https://github.com/jupyterhub/jupyterhub/pull/4325) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Remove no longer relevant notice in readme [#4324](https://github.com/jupyterhub/jupyterhub/pull/4324) ([@consideRatio](https://github.com/consideRatio), [@minrk](https://github.com/minrk))
- Fix the oauthenticator docs api links [#4304](https://github.com/jupyterhub/jupyterhub/pull/4304) ([@GeorgianaElena](https://github.com/GeorgianaElena), [@minrk](https://github.com/minrk))
- Selenium testing: adding new case covered the authorisation page [#4298](https://github.com/jupyterhub/jupyterhub/pull/4298) ([@mouse1203](https://github.com/mouse1203), [@minrk](https://github.com/minrk))
- docs: fix linkcheck in gallery [#4297](https://github.com/jupyterhub/jupyterhub/pull/4297) ([@minrk](https://github.com/minrk))
- Refactored selenium tests for improved readability [#4278](https://github.com/jupyterhub/jupyterhub/pull/4278) ([@mouse1203](https://github.com/mouse1203), [@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- remove deprecated import of pipes.quote [#4273](https://github.com/jupyterhub/jupyterhub/pull/4273) ([@minrk](https://github.com/minrk), [@manics](https://github.com/manics))
- only run testing config on localhost [#4271](https://github.com/jupyterhub/jupyterhub/pull/4271) ([@minrk](https://github.com/minrk), [@manics](https://github.com/manics))
- pre-commit: autoupdate monthly [#4268](https://github.com/jupyterhub/jupyterhub/pull/4268) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio), [@GeorgianaElena](https://github.com/GeorgianaElena), [@betatim](https://github.com/betatim))
- remove unnecessary actions for firefox/geckodriver [#4264](https://github.com/jupyterhub/jupyterhub/pull/4264) ([@minrk](https://github.com/minrk), [@manics](https://github.com/manics))
- docs: refresh Makefile/make.bat [#4256](https://github.com/jupyterhub/jupyterhub/pull/4256) ([@consideRatio](https://github.com/consideRatio), [@minrk](https://github.com/minrk))
- Test docs, links on CI [#4251](https://github.com/jupyterhub/jupyterhub/pull/4251) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- maint: fix detail when removing support for py36 [#4248](https://github.com/jupyterhub/jupyterhub/pull/4248) ([@consideRatio](https://github.com/consideRatio), [@manics](https://github.com/manics))
- more selenium test cases [#4207](https://github.com/jupyterhub/jupyterhub/pull/4207) ([@mouse1203](https://github.com/mouse1203), [@minrk](https://github.com/minrk))
#### Documentation improvements
- Fix variable spelling. [#4398](https://github.com/jupyterhub/jupyterhub/pull/4398) ([@ryanlovett](https://github.com/ryanlovett), [@manics](https://github.com/manics))
- Remove bracket around link text without address [#4416](https://github.com/jupyterhub/jupyterhub/pull/4416) ([@crazytan](https://github.com/crazytan), [@minrk](https://github.com/minrk))
- add some more detail and examples to database doc [#4399](https://github.com/jupyterhub/jupyterhub/pull/4399) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Add emphasis about role loading and hub restarts. [#4390](https://github.com/jupyterhub/jupyterhub/pull/4390) ([@ryanlovett](https://github.com/ryanlovett), [@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Re-enable links to REST API [#4386](https://github.com/jupyterhub/jupyterhub/pull/4386) ([@minrk](https://github.com/minrk), [@manics](https://github.com/manics))
- reduce nested hierarchy in docs organization [#4377](https://github.com/jupyterhub/jupyterhub/pull/4377) ([@alwasega](https://github.com/alwasega), [@minrk](https://github.com/minrk))
- changelog for 4.0 beta [#4375](https://github.com/jupyterhub/jupyterhub/pull/4375) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Getting started link broken [#4374](https://github.com/jupyterhub/jupyterhub/pull/4374) ([@3coins](https://github.com/3coins), [@minrk](https://github.com/minrk))
- add collaboration accounts tutorial [#4373](https://github.com/jupyterhub/jupyterhub/pull/4373) ([@minrk](https://github.com/minrk), [@fperez](https://github.com/fperez), [@ryanlovett](https://github.com/ryanlovett))
- Updated the top-level index file [#4368](https://github.com/jupyterhub/jupyterhub/pull/4368) ([@alwasega](https://github.com/alwasega), [@sgibson91](https://github.com/sgibson91))
- JupyterHub sphinx theme [#4363](https://github.com/jupyterhub/jupyterhub/pull/4363) ([@minrk](https://github.com/minrk), [@choldgraf](https://github.com/choldgraf))
- Remove PDF links from README.md [#4358](https://github.com/jupyterhub/jupyterhub/pull/4358) ([@pnasrat](https://github.com/pnasrat), [@manics](https://github.com/manics))
- add singleuser explanation doc [#4357](https://github.com/jupyterhub/jupyterhub/pull/4357) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Updates to the documentation Contribution section [#4355](https://github.com/jupyterhub/jupyterhub/pull/4355) ([@alwasega](https://github.com/alwasega), [@sgibson91](https://github.com/sgibson91), [@minrk](https://github.com/minrk))
- Restructured references section of the docs [#4343](https://github.com/jupyterhub/jupyterhub/pull/4343) ([@alwasega](https://github.com/alwasega), [@minrk](https://github.com/minrk), [@sgibson91](https://github.com/sgibson91))
- Document use of pytest-asyncio in JupyterHub test suite [#4341](https://github.com/jupyterhub/jupyterhub/pull/4341) ([@Sheila-nk](https://github.com/Sheila-nk), [@minrk](https://github.com/minrk), [@alwasega](https://github.com/alwasega))
- Moved Explanation/Background files [#4340](https://github.com/jupyterhub/jupyterhub/pull/4340) ([@alwasega](https://github.com/alwasega), [@sgibson91](https://github.com/sgibson91), [@minrk](https://github.com/minrk))
- Moved last set of Tutorials [#4338](https://github.com/jupyterhub/jupyterhub/pull/4338) ([@alwasega](https://github.com/alwasega), [@sgibson91](https://github.com/sgibson91))
- fix a couple ref links in changelog [#4334](https://github.com/jupyterhub/jupyterhub/pull/4334) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Added rediraffe using auto redirect builder [#4331](https://github.com/jupyterhub/jupyterhub/pull/4331) ([@alwasega](https://github.com/alwasega), [@sgibson91](https://github.com/sgibson91), [@GeorgianaElena](https://github.com/GeorgianaElena), [@consideRatio](https://github.com/consideRatio), [@manics](https://github.com/manics))
- Backport PR #4316 on branch 3.x (changelog for 3.1.1) [#4318](https://github.com/jupyterhub/jupyterhub/pull/4318) ([@minrk](https://github.com/minrk))
- changelog for 3.1.1 [#4316](https://github.com/jupyterhub/jupyterhub/pull/4316) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Moved second half of HowTo documentation [#4314](https://github.com/jupyterhub/jupyterhub/pull/4314) ([@alwasega](https://github.com/alwasega), [@sgibson91](https://github.com/sgibson91), [@minrk](https://github.com/minrk))
- Moved first half of HowTo documentation [#4311](https://github.com/jupyterhub/jupyterhub/pull/4311) ([@alwasega](https://github.com/alwasega), [@sgibson91](https://github.com/sgibson91), [@minrk](https://github.com/minrk))
- number agreement in authenticators-users-basics [#4309](https://github.com/jupyterhub/jupyterhub/pull/4309) ([@TaofeeqatDev](https://github.com/TaofeeqatDev), [@minrk](https://github.com/minrk))
- transferred docs to the FAQ folder [#4307](https://github.com/jupyterhub/jupyterhub/pull/4307) ([@alwasega](https://github.com/alwasega), [@sgibson91](https://github.com/sgibson91), [@minrk](https://github.com/minrk), [@GeorgianaElena](https://github.com/GeorgianaElena))
- Added docs to the folder [#4305](https://github.com/jupyterhub/jupyterhub/pull/4305) ([@alwasega](https://github.com/alwasega), [@sgibson91](https://github.com/sgibson91), [@minrk](https://github.com/minrk))
- Created folders to house the restructured documentation [#4301](https://github.com/jupyterhub/jupyterhub/pull/4301) ([@alwasega](https://github.com/alwasega), [@sgibson91](https://github.com/sgibson91), [@minrk](https://github.com/minrk), [@manics](https://github.com/manics), [@GeorgianaElena](https://github.com/GeorgianaElena))
- expand database docs [#4292](https://github.com/jupyterhub/jupyterhub/pull/4292) ([@minrk](https://github.com/minrk), [@GeorgianaElena](https://github.com/GeorgianaElena), [@ajpower](https://github.com/ajpower), [@consideRatio](https://github.com/consideRatio), [@manics](https://github.com/manics), [@sgibson91](https://github.com/sgibson91))
- added note on `Spawner.name_template` setting [#4288](https://github.com/jupyterhub/jupyterhub/pull/4288) ([@stevejpurves](https://github.com/stevejpurves), [@minrk](https://github.com/minrk))
- Document JUPYTER_PREFER_ENV_PATH=0 for shared user environments [#4269](https://github.com/jupyterhub/jupyterhub/pull/4269) ([@minrk](https://github.com/minrk), [@manics](https://github.com/manics))
- set max depth on api/index toctree [#4259](https://github.com/jupyterhub/jupyterhub/pull/4259) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- fix bracket typo in capacity figures [#4250](https://github.com/jupyterhub/jupyterhub/pull/4250) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- convert remaining rst files to myst [#4249](https://github.com/jupyterhub/jupyterhub/pull/4249) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- doc: fix formatting of spawner env-vars [#4245](https://github.com/jupyterhub/jupyterhub/pull/4245) ([@manics](https://github.com/manics), [@consideRatio](https://github.com/consideRatio), [@minrk](https://github.com/minrk))
#### Contributors to this release
The following people contributed discussions, new ideas, code and documentation contributions, and review.
See [our definition of contributors](https://github-activity.readthedocs.io/en/latest/#how-does-this-tool-define-contributions-in-the-reports).
([GitHub contributors page for this release](https://github.com/jupyterhub/jupyterhub/graphs/contributors?from=2022-12-05&to=2023-04-20&type=c))
@3coins ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3A3coins+updated%3A2022-12-05..2023-04-20&type=Issues)) | @ajcollett ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aajcollett+updated%3A2022-12-05..2023-04-20&type=Issues)) | @ajpower ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aajpower+updated%3A2022-12-05..2023-04-20&type=Issues)) | @alekseyolg ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aalekseyolg+updated%3A2022-12-05..2023-04-20&type=Issues)) | @alwasega ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aalwasega+updated%3A2022-12-05..2023-04-20&type=Issues)) | @betatim ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Abetatim+updated%3A2022-12-05..2023-04-20&type=Issues)) | @bl-aire ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Abl-aire+updated%3A2022-12-05..2023-04-20&type=Issues)) | @choldgraf ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Acholdgraf+updated%3A2022-12-05..2023-04-20&type=Issues)) | @consideRatio ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AconsideRatio+updated%3A2022-12-05..2023-04-20&type=Issues)) | @crazytan ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Acrazytan+updated%3A2022-12-05..2023-04-20&type=Issues)) | @dependabot ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Adependabot+updated%3A2022-12-05..2023-04-20&type=Issues)) | @fperez ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Afperez+updated%3A2022-12-05..2023-04-20&type=Issues)) | @GeorgianaElena ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AGeorgianaElena+updated%3A2022-12-05..2023-04-20&type=Issues)) | @julietKiloRomeo ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AjulietKiloRomeo+updated%3A2022-12-05..2023-04-20&type=Issues)) | @ktaletsk ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aktaletsk+updated%3A2022-12-05..2023-04-20&type=Issues)) | @manics ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Amanics+updated%3A2022-12-05..2023-04-20&type=Issues)) | @mathbunnyru ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Amathbunnyru+updated%3A2022-12-05..2023-04-20&type=Issues)) | @meeseeksdev ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ameeseeksdev+updated%3A2022-12-05..2023-04-20&type=Issues)) | @meeseeksmachine ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ameeseeksmachine+updated%3A2022-12-05..2023-04-20&type=Issues)) | @minrk ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aminrk+updated%3A2022-12-05..2023-04-20&type=Issues)) | @mouse1203 ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Amouse1203+updated%3A2022-12-05..2023-04-20&type=Issues)) | @naatebarber ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Anaatebarber+updated%3A2022-12-05..2023-04-20&type=Issues)) | @pnasrat ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Apnasrat+updated%3A2022-12-05..2023-04-20&type=Issues)) | @pre-commit-ci ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Apre-commit-ci+updated%3A2022-12-05..2023-04-20&type=Issues)) | @ryanlovett ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aryanlovett+updated%3A2022-12-05..2023-04-20&type=Issues)) | @sgibson91 ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Asgibson91+updated%3A2022-12-05..2023-04-20&type=Issues)) | @shaneknapp ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ashaneknapp+updated%3A2022-12-05..2023-04-20&type=Issues)) | @Sheila-nk ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3ASheila-nk+updated%3A2022-12-05..2023-04-20&type=Issues)) | @stevejpurves ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Astevejpurves+updated%3A2022-12-05..2023-04-20&type=Issues)) | @TaofeeqatDev ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3ATaofeeqatDev+updated%3A2022-12-05..2023-04-20&type=Issues)) | @vladfreeze ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Avladfreeze+updated%3A2022-12-05..2023-04-20&type=Issues)) | @yuvipanda ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ayuvipanda+updated%3A2022-12-05..2023-04-20&type=Issues))
## 3.1
### 3.1.1 - 2023-01-27
3.1.1 has only tiny bugfixes, enabling compatibility with the latest sqlalchemy 2.0 release, and fixing some metadata files that were not being included in wheel installs.
([full changelog](https://github.com/jupyterhub/jupyterhub/compare/3.1.0...3.1.1))
#### Bugs fixed
- Backport PR #4303 on branch 3.x: make sure event-schemas are installed [#4317](https://github.com/jupyterhub/jupyterhub/pull/4317) ([@minrk](https://github.com/minrk))
- Backport PR #4302 on branch 3.x: sqlalchemy 2 compatibility [#4315](https://github.com/jupyterhub/jupyterhub/pull/4315) ([@minrk](https://github.com/minrk))
### 3.1.0 - 2022-12-05
3.1.0 is a small release, fixing various bugs and introducing some small new features and metrics.
@@ -183,18 +458,18 @@ This can be used to e.g. limit student/grader/instructor permissions in a gradin
or grant instructors read-only access to their students' single-user servers starting with upcoming Jupyter Server 2.0.
Further extending granular control of permissions,
we have added `!service` and `!server` filters for scopes (:ref:`self-referencing-filters`),
we have added `!service` and `!server` filters for scopes ({ref}`self-referencing-filters`),
like we had for `!user`.
Access to the admin UI is now governed by a dedicated `admin-ui` scope,
rather than combined `admin:servers` and `admin:users` in 2.0.
More info in `ref`{available-scopes-target}.
More info in {ref}`available-scopes-target`.
#### More highlights
- The admin UI can now show more detailed info about users and their servers in a drop-down details table:
![Details view in admin UI](./images/dropdown-details-3.0.png)
![Details view in admin UI](/images/dropdown-details-3.0.png)
- Several bugfixes and improvements in the new admin UI.
- Direct access to the Hub's database is deprecated.
@@ -568,10 +843,10 @@ default 'user' role as expected.
JupyterHub 2.0 is a big release!
The most significant change is the addition of [roles and scopes][rbac]
The most significant change is the addition of [roles and scopes](rbac)
to the JupyterHub permissions model,
allowing more fine-grained access control.
Read more about it [in the docs][rbac].
Read more about it [in the docs](rbac).
In particular, the 'admin' level of permissions should not be needed anymore,
and you can now grant users and services only the permissions they need, not more.
@@ -581,7 +856,7 @@ and consider assigning only the necessary roles and scopes.
[rbac]: ./rbac/index.md
JupyterHub 2.0 requires an update to the database schema,
so **make sure to [read the upgrade documentation and backup your database](admin/upgrading)
so **make sure to [read the upgrade documentation and backup your database](upgrading-jupyterhub)
before upgrading**.
:::{admonition} stop all servers before upgrading
@@ -1229,7 +1504,7 @@ Thanks to everyone who has contributed to this release!
- `JupyterHub.init_spawners_timeout` is introduced to combat slow startups on large JupyterHub deployments [#2721](https://github.com/jupyterhub/jupyterhub/pull/2721) ([@minrk](https://github.com/minrk))
- The configuration `uids` for local authenticators is added to consistently assign users UNIX id's between installations [#2687](https://github.com/jupyterhub/jupyterhub/pull/2687) ([@rgerkin](https://github.com/rgerkin))
- `JupyterHub.activity_resolution` is introduced with a default value of 30s improving performance by not updating the database with user activity too often [#2605](https://github.com/jupyterhub/jupyterhub/pull/2605) ([@minrk](https://github.com/minrk))
- [HubAuth](https://jupyterhub.readthedocs.io/en/stable/api/services.auth.html#jupyterhub.services.auth.HubAuth)'s SSL configuration can now be set through environment variables [#2588](https://github.com/jupyterhub/jupyterhub/pull/2588) ([@cmd-ntrf](https://github.com/cmd-ntrf))
- [HubAuth](jupyterhub.services.auth.HubAuth)'s SSL configuration can now be set through environment variables [#2588](https://github.com/jupyterhub/jupyterhub/pull/2588) ([@cmd-ntrf](https://github.com/cmd-ntrf))
- Expose spawner.user_options in REST API. [#2755](https://github.com/jupyterhub/jupyterhub/pull/2755) ([@danielballan](https://github.com/danielballan))
- add block for scripts included in head [#2828](https://github.com/jupyterhub/jupyterhub/pull/2828) ([@bitnik](https://github.com/bitnik))
- Instrument JupyterHub to record events with jupyter_telemetry [Part II] [#2698](https://github.com/jupyterhub/jupyterhub/pull/2698) ([@Zsailer](https://github.com/Zsailer))
@@ -1342,7 +1617,7 @@ whether it was through discussion, testing, documentation, or development.
- There is now full UI support for managing named servers.
With named servers, each jupyterhub user may have access to more than one named server. For example, a professor may access a server named `research` and another named `teaching`.
![named servers on the home page](./images/named-servers-home.png)
![named servers on the home page](/images/named-servers-home.png)
- Authenticators can now expire and refresh authentication data by implementing
`Authenticator.refresh_user(user)`.

View File

@@ -1,8 +0,0 @@
# Configuration examples
The following sections provide examples, including configuration files and tips, for the
following:
- Configuring GitHub OAuth
- Using reverse proxy (nginx and Apache)
- Run JupyterHub without root privileges using `sudo`

View File

@@ -0,0 +1,35 @@
# Configuration Reference
:::{important}
Make sure the version of JupyterHub for this documentation matches your
installation version, as the output of this command may change between versions.
:::
## JupyterHub configuration
As explained in the [Configuration Basics](generate-config-file)
section, the `jupyterhub_config.py` can be automatically generated via
> ```bash
> jupyterhub --generate-config
> ```
Most of this information is available in a nicer format in:
- [](./api/app.md)
- [](./api/auth.md)
- [](./api/spawner.md)
The following contains the output of that command for reference.
```{eval-rst}
.. jupyterhub-generate-config::
```
## JupyterHub help command output
This section contains the output of the command `jupyterhub --help-all`.
```{eval-rst}
.. jupyterhub-help-all::
```

Some files were not shown because too many files have changed in this diff Show More