Compare commits

...

1277 Commits
2.3.1 ... 4.0.1

Author SHA1 Message Date
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
Min RK
eca9c00872 Bump to 3.1.0 2022-12-05 14:44:43 +01:00
Min RK
e6e2a7d003 Merge pull request #4232 from minrk/changelog-3.1
changelog for 3.1.0
2022-12-05 14:44:02 +01:00
Min RK
b35a78240c changelog for 1.5.1 2022-12-05 14:02:36 +01:00
Min RK
d317c067d1 Update changelog for 3.1.0 2022-12-05 13:35:59 +01:00
Simon Li
cfc93d8555 doc: fix formatting of spawner env-vars 2022-12-02 17:39:11 +00:00
Erik Sundell
681ff09e06 Merge pull request #4233 from minrk/ci-db-versions
ci: update database image versions
2022-12-01 16:40:03 +01:00
Erik Sundell
0d72280e5d Merge pull request #4214 from yuvipanda/metricsss
Add active users prometheus metrics
2022-12-01 15:45:59 +01: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
Simon Li
dca8725876 Merge pull request #4240 from minrk/default-named-server-doc
clarify docstrings for default_server_name
2022-12-01 14:20:37 +00:00
Min RK
3bb1d640ee clearer descriptions of default_server_name behavior
Co-authored-by: Jörg Behrmann <behrmann@physik.fu-berlin.de>
2022-12-01 14:52:23 +01:00
Min RK
954e64e3ca clarify docstrings for default_server_name
and warn if default_server_name is specified but named servers not enabled
2022-12-01 14:39:19 +01:00
Min RK
58475ffcfd make active_users config and methods consistent
- use interval instead of period to match other interval config
- avoid redundant `metric` in both class and method/attr names
- interval is separate per metric group (only one for now)
2022-12-01 14:22:47 +01:00
Georgiana
181aec31af Merge pull request #4236 from minrk/deprecate-extra-handlers
deprecate JupyterHub.extra_handlers
2022-12-01 13:41:36 +02:00
Min RK
c6ac4e0d34 test active users metrics 2022-12-01 10:23:51 +01:00
Min RK
8fe875430a Merge pull request #4209 from ArafatAbdussalam/patch-2
avoid contraction in setup.rst
2022-12-01 09:01:23 +01:00
Min RK
f2dcf96bef remove unused monthy_active_users metric
just jupyterhub_active_users now

Co-authored-by: Erik Sundell <erik.i.sundell@gmail.com>
2022-12-01 08:25:44 +01:00
Yuvi Panda
6e90059580 Merge pull request #4230 from minrk/logout-clear-user
make current_user available to handle_logout hook
2022-11-30 15:19:01 -08:00
Min RK
0a2e6a4042 Merge pull request #4127 from ArafatAbdussalam/branch1
update troubleshooting.md docs
2022-11-30 14:11:53 +01:00
Arafat Abdussalam
672ef34d9b update troubleshooting.md docs
I fixed the grammatical errors on the docs

address review

Co-authored-by: Erik Sundell <erik.i.sundell@gmail.com>
2022-11-30 14:01:13 +01:00
Min RK
2d9285d447 Merge pull request #4156 from liliyao2022/patch-5
Update dockerfile README
2022-11-30 13:54:02 +01:00
Chris Holdgraf
859cff345c Merge pull request #4008 from minrk/capacity-planning 2022-11-30 12:10:16 +01:00
Min RK
4938ed66b6 set base jupyterhub db upgrade-from test version to 1.1
jupyterhub 1.0 is not compatible with more recent mysql
2022-11-30 11:58:37 +01:00
Min RK
770325f695 deprecate JupyterHub.extra_handlers
I don't think we should encourage in-memory extensions.

Point to services, instead.
2022-11-30 11:52:33 +01:00
Min RK
ec8e6e2e4a ci: update database image versions
mysql: 8.0
postgres: 15.1
2022-11-30 09:48:54 +01:00
Min RK
f7ce07ee9e changelog for 3.1.0 2022-11-30 09:45:11 +01:00
Min RK
2b70e768e5 Merge pull request #4229 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-11-29 14:59:21 +01:00
Min RK
6d7341b478 clear user before rendering logout page
instead of in clear_login_cookie

ensures current_user is accessible in `handle_logout` hook
2022-11-29 10:04:22 +01:00
pre-commit-ci[bot]
b76e308e71 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/PyCQA/autoflake: v1.7.7 → v2.0.0](https://github.com/PyCQA/autoflake/compare/v1.7.7...v2.0.0)
- [github.com/pre-commit/pre-commit-hooks: v4.3.0 → v4.4.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.3.0...v4.4.0)
- [github.com/PyCQA/flake8: 5.0.4 → 6.0.0](https://github.com/PyCQA/flake8/compare/5.0.4...6.0.0)
2022-11-29 01:55:14 +00:00
Min RK
eac96acadd Merge pull request #4150 from liliyao2022/patch-2
grammar improvements in quickstart.md
2022-11-24 11:26:40 +01:00
Min RK
9992e26a8c Merge pull request #4185 from lumenCodes/instFaq
Edits to institutional FAQ
2022-11-24 11:26:11 +01:00
Min RK
0ec4852800 add 'you will need' to dockerfile readme requirements 2022-11-24 11:25:46 +01:00
Min RK
fdf9fbb65b connect users with infrastructure 2022-11-24 11:23:59 +01:00
Min RK
2f81ea8fb1 Merge pull request #4172 from liliyao2022/patch-10
Deleted unused failRegexEvent
2022-11-24 11:22:40 +01:00
Min RK
cab9c1d9ab Merge pull request #4130 from lumenCodes/tempaltesdoc
refine text in template docs.
2022-11-24 11:20:58 +01:00
Lili Yao
fd172a56e0 grammer improvements in quickstart.md
Modified some grammar issues.
2022-11-24 11:20:23 +01:00
Min RK
6b6946fe8a Merge pull request #4136 from yamakat/Improve-on-documentation-websecurity.md
Update wording in web security docs
2022-11-24 11:18:51 +01:00
Min RK
e97d5c6662 Merge branch 'main' into tempaltesdoc 2022-11-24 11:15:49 +01:00
Min RK
343fe70393 Merge pull request #4072 from ruqayaahh/templates-docs-contributions
[doc] templates: updated obsolete links and made wordings clearer
2022-11-24 11:12:45 +01:00
Min RK
b048bbcd9e Merge pull request #4084 from melissakirabo/patch-1
Refine text in documentation index
2022-11-24 11:07:18 +01:00
Min RK
5639b3a622 Apply suggestions from code review 2022-11-24 11:04:16 +01:00
Min RK
08e6da7584 Merge pull request #4186 from emmanuella194/main
highlight "what is our actual goal" in faq
2022-11-24 10:11:34 +01:00
Min RK
385a4556a4 Merge pull request #4119 from PoorvajaRayas/PoorvajaRayas
Formatting changes to tests.rst
2022-11-24 10:10:00 +01:00
Min RK
40b8393c4b Merge pull request #4094 from Busayo-ojo/busayo-ojo
Fixed typos and added punctuations
2022-11-24 10:09:34 +01:00
Emmanuella Orioma
65464c7029 Updated faq.md
I think the *But what is our actual goal* should be an heading for better reading experience
2022-11-24 10:08:46 +01:00
PoorvajaRayas
869f2dd08d Reviewed documentation and fixed grammatical errors 2022-11-24 10:06:40 +01:00
Min RK
8b471624ee Merge branch 'main' into busayo-ojo 2022-11-24 10:04:08 +01:00
Min RK
51c1ea1f7f restore 'the'
Co-authored-by: Georgiana <georgiana.dolocan@gmail.com>
2022-11-24 10:02:53 +01:00
Min RK
d04c0c28c0 Merge pull request #2641 from ericdill/copyediting
Some suggestions from reading through the docs
2022-11-24 09:46:29 +01:00
pre-commit-ci[bot]
33fa9b953b [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-11-24 08:41:13 +00:00
Min RK
de5fb1e7ce Merge branch 'main' into copyediting 2022-11-24 09:40:21 +01:00
Min RK
1cf13bea66 Merge pull request #4210 from ArafatAbdussalam/patch-3
grammar in security-basics.rst
2022-11-24 09:21:13 +01:00
pre-commit-ci[bot]
abe7150ffe [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-11-23 10:22:56 +00:00
Erik Sundell
95e5a5dea8 Merge pull request #4227 from consideRatio/pr/docs-cleanup
docs: refresh conf.py, add opengraph and rediraffe extensions
2022-11-23 10:45:42 +01:00
YuviPanda
f05778a1ae Add comment clarifying why we freeze time 2022-11-22 14:23:21 -08:00
YuviPanda
06fb211283 Make duration be a label on the metric
- Stops ambiguous wording on 'monthly', use more precise '30d'
- Add a 7d active users metric
- Allows us to make this configurable in the future if needed
2022-11-22 14:18:15 -08:00
Erik Sundell
f877588e52 docs: fix rST syntax error for italics 2022-11-22 17:47:37 +01:00
Erik Sundell
bfe0186ad2 docs: add rediraffe sphinx extension
This extension helps us restructure our documentation without creating
dead links. It requires us to explicitly declare what should be
redirected where though.

It seems better to have it in place ahead of time than to be something
we ask a contributor add just in time when its needed.
2022-11-22 17:47:37 +01:00
Erik Sundell
d23e095106 docs: add opengraph sphinx extension
This extension helps add metadata etc to the rendered HTML documentation
to help for example links on discourse.jupyter.org look good.
2022-11-22 17:47:37 +01:00
Erik Sundell
96d4486ae5 docs: refresh conf.py for readability 2022-11-22 17:47:37 +01:00
Erik Sundell
98710dbc8b Merge pull request #4223 from consideRatio/pr/requirements-details
maint: add test to extras_require, remove greenlet workaround, test final py311, misc cleanup
2022-11-22 17:24:23 +01:00
pre-commit-ci[bot]
8ac3a8e4e6 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-11-22 12:53:06 +00:00
Erik Sundell
0575022186 docs: install jupyterhub package and remove path setup steps
When we install the jupyterhub package, we don't have to put it on the
path explicitly.
2022-11-22 13:51:28 +01:00
Erik Sundell
1ac9c443b5 maint: add test to extras_require, remove dev-requirements.txt 2022-11-22 13:51:28 +01:00
Erik Sundell
08ed8443f2 maint: install html5lib via beautifulsoup4's extra_requires 2022-11-22 13:45:57 +01:00
Erik Sundell
0cdaa833c4 maint: remove unused urllib3 from test requirements 2022-11-22 13:45:57 +01:00
Erik Sundell
87ce2a9b2f maint: add jsonschema to test requirements and cleanup attrs constraint 2022-11-22 13:45:57 +01:00
Erik Sundell
f26b43f209 maint: remove no longer needed py311 greenlet workaround 2022-11-22 13:45:55 +01:00
Erik Sundell
e6e84eabb3 ci: focus tests towards py311 over py310 2022-11-22 13:43:11 +01:00
Erik Sundell
4fadfd42da Merge pull request #4225 from minrk/selenium-wait
selenium: update next_url after waiting for it to change
2022-11-22 09:56:03 +01:00
Min RK
29d84f4192 selenium: update next_url after waiting for it to change 2022-11-22 09:41:24 +01:00
Min RK
fc7ef39f21 Merge pull request #4211 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-11-21 15:21:02 +01:00
Min RK
d5d9cb204c Merge pull request #4219 from consideRatio/pr/stricter-flake8
pre-commit: add autoflake and make flake8 checks stricter
2022-11-21 15:10:14 +01:00
pre-commit-ci[bot]
9d592fff31 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-11-18 15:43:10 +00:00
Erik Sundell
12594631e0 maint: use __all__ statements where its reasonable to do
Co-authored-by: Simon Li <orpheus+devel@gmail.com>
2022-11-18 16:42:43 +01:00
Min RK
ffbc981bfe Merge pull request #4222 from consideRatio/pr/docs-maintenance
docs: sphinx config cleanup, removing epub build, fix build warnings
2022-11-17 14:43:33 +01:00
Erik Sundell
7f3fd7e3cc docs: fix broken links and formatting errors 2022-11-17 13:38:25 +01:00
Erik Sundell
1c9499e91e docs: remove epub documentation build 2022-11-17 13:09:06 +01:00
Erik Sundell
26e5efeec4 docs: cleanup unused config for htmlhelp, latex, manual 2022-11-17 13:08:17 +01:00
Erik Sundell
90811196d7 docs: remove unused alabaster_jupyterhub requirement 2022-11-17 13:00:22 +01:00
Min RK
a917de258f Merge pull request #4221 from jupyterhub/dependabot/npm_and_yarn/jsx/loader-utils-2.0.4
Bump loader-utils from 2.0.2 to 2.0.4 in /jsx
2022-11-17 09:24:04 +01:00
dependabot[bot]
5d7383278f Bump loader-utils from 2.0.2 to 2.0.4 in /jsx
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 2.0.2 to 2.0.4.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v2.0.4/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v2.0.2...v2.0.4)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-17 04:52:44 +00:00
pre-commit-ci[bot]
865d5f7646 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-11-16 14:53:12 +00:00
Erik Sundell
5a5e0118b8 docs: comment about isort, black, tbump in pyproject.toml 2022-11-16 15:51:26 +01:00
Erik Sundell
b9596b2dee pre-commit: add autoflake 2022-11-16 15:51:26 +01:00
Erik Sundell
3b5b42e620 flake8: manual F408 fix, avoid indirect import of public_host / public_url 2022-11-16 15:51:26 +01:00
Erik Sundell
7a9491c323 flake8: check F408 about unused imports, manual fixes only 2022-11-16 15:51:26 +01:00
Erik Sundell
957fd9cc20 flake8: check F811 about redefinition of unused name 2022-11-16 15:51:26 +01:00
Erik Sundell
eaa096152a flake8: check F403 about import * 2022-11-16 15:51:26 +01:00
Min RK
5ea93add28 Merge pull request #4216 from consideRatio/pr/cleanup-flake8-config
ci: flake8, cleanup unused/redundant config
2022-11-16 09:06:43 +01:00
Erik Sundell
b77e9cbf08 ci: flake8, add back general ignore of pydocstyle warnings 2022-11-16 08:54:23 +01:00
Erik Sundell
24dfa5d228 ci: flake8, cleanup unused/redundant config
- E### warnings were already ignored by E
- Sorting of import warnings won't matter as we have black and isort
- D400: First line should end with a period

  This is not flake8 configuration, but related to `pydocstyle`, which
  isn't used.
2022-11-16 08:16:44 +01:00
Yuvi Panda
98603ef3e4 Merge pull request #4208 from ArafatAbdussalam/patch-1
improved the grammatical structure
2022-11-15 16:09:12 -08:00
YuviPanda
06aded4bce Fix some typos 2022-11-15 16:01:20 -08:00
YuviPanda
a2e80e5d6f Add daily & monthly active users prometheus metrics
These are *extremely useful* for people advocating for
more resources for their JupyterHubs, but a little difficult
to calculate without a full scale log ingestion and analytics
pipeline (such as ELK or equivalent). However, these are easy
to calculate on the JupyterHub side at any given instance -
these are fairly quick SQL queries. Prometheus can capture and
store this as a timeseries, and provide valuble advocacy data
that is hard to get otherwise.

This turns the metrics on by default, but only updates them every
hour - which seems fine for metrics that don't change that often.
This should reduce performance impact. Admins can also turn this
off if needed.

I've had to implement this in many different ways in many different
contexts, and it's also important to be able to *trust* these. Getting
this from other grafana data can be tricky to validate - we had an
experimental one in our grafana dashboards at some point in the past
that we had to kill due to it being hard to validate
(https://github.com/jupyterhub/grafana-dashboards/pull/45). This metric
will provide an authoritative source of truth for this.

Ref https://github.com/2i2c-org/infrastructure/issues/1888
2022-11-15 15:43:01 -08:00
pre-commit-ci[bot]
c993163f0b [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.2.0 → v3.2.2](https://github.com/asottile/pyupgrade/compare/v3.2.0...v3.2.2)
2022-11-15 00:12:51 +00:00
Arafat Abdussalam
e6e890b46c Update security-basics.rst 2022-11-14 11:22:12 +01:00
Arafat Abdussalam
d2c6ae925f modified setup.rst
When I needed to set up Linux on my windows, i found out the easier to do so was through Windows Subsystem for Linux. Hence, I needed to add the guide to the development setup
2022-11-14 10:45:14 +01:00
Arafat Abdussalam
32cddfbdfe Update docs.rst 2022-11-14 10:30:56 +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
Simon Li
730fe5a446 Merge pull request #4204 from minrk/access-servers
[docs] typo in access:servers scope
2022-11-11 08:41:31 +00:00
Min RK
2ed84b0de1 typo in access:servers scope
it's not access:users:servers
2022-11-11 09:23:23 +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
Your Name
de1757bf57 Deleted unused failRegexEvent 2022-11-02 09:23:45 +01:00
Min RK
54c06c33bd Merge pull request #4188 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-11-01 09:05:17 +01:00
Min RK
17119a273f Merge pull request #4187 from consideRatio/main
ci: use non-deprecated codecov uploader
2022-11-01 09:01:22 +01:00
Min RK
7effe53c28 Merge pull request #4139 from Joel-Ando/Joel-Ando-patch-1
highlight note about the docker image scope
2022-11-01 08:50:58 +01:00
Joel-Ando
59f14ad7c0 Update quickstart-docker.rst 2022-11-01 08:50:25 +01:00
pre-commit-ci[bot]
54a5d2c152 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.1.0 → v3.2.0](https://github.com/asottile/pyupgrade/compare/v3.1.0...v3.2.0)
- [github.com/pre-commit/mirrors-prettier: v3.0.0-alpha.3 → v3.0.0-alpha.4](https://github.com/pre-commit/mirrors-prettier/compare/v3.0.0-alpha.3...v3.0.0-alpha.4)
2022-11-01 00:03:21 +00:00
Erik Sundell
b83a6250ba ci: use non-deprecated codecov uploader 2022-10-31 19:36:37 +01:00
pre-commit-ci[bot]
ca6aba7568 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-28 14:55:47 +00:00
lumenCodes
49ec485614 Merge branch 'main' of https://github.com/jupyterhub/jupyterhub into instFaq 2022-10-28 15:51:08 +01:00
lumenCodes
8de25d08a7 I fixed typo errors and structure 2022-10-28 15:50:47 +01:00
Min RK
a7cfc76a82 Merge pull request #4113 from EstherChristopher/patch-2
proofread upgrading docs
2022-10-28 15:14:32 +02:00
Esther Christopher
c19b3b540a Update upgrading.rst
Hopefully, it's all sorted now and gets merged. Sorry for the back and forth.
2022-10-28 13:50:02 +01:00
Chinwendu
5ec1cf86a7 Update docs/source/reference/templates.md
Co-authored-by: Min RK <benjaminrk@gmail.com>
2022-10-27 14:06:45 +01:00
Min RK
2594a7269e Merge pull request #4140 from Joel-Ando/Joel-Ando-patch-2
add link to rbac index from implementation
2022-10-27 15:00:22 +02:00
Min RK
f20021c068 Merge pull request #4173 from liliyao2022/patch-11
jsx: remove unused useState
2022-10-27 14:28:16 +02:00
Min RK
5708de05ff Merge pull request #4129 from lumenCodes/restapidoc
reorder REST API doc
2022-10-27 14:21:12 +02:00
Min RK
28f2ba9df9 Merge pull request #4168 from lumenCodes/proxy
clarify CHP downsides in proxy doc
2022-10-27 14:19:50 +02:00
Min RK
35297ce87f Merge pull request #4167 from lumenCodes/services
Proofread services.md
2022-10-27 14:17:09 +02:00
Min RK
73d97c0a82 Merge pull request #4109 from EstherChristopher/patch-1
Reviewed the documentation
2022-10-27 14:11:37 +02:00
Esther Christopher
f0957ad247 Resolve conflicts in event doc 2022-10-27 14:10:41 +02:00
pre-commit-ci[bot]
777bbe8e92 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-26 18:06:17 +00:00
lumenCodes
3eb6cd302c Applied PR Changes 2022-10-26 19:02:42 +01:00
lumenCodes
438b285670 I effected PR requested changes 2022-10-26 18:44:51 +01:00
pre-commit-ci[bot]
cf2ec324b7 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-26 17:23:20 +00:00
Chinwendu
b33b8772d3 Merge branch 'main' into restapidoc 2022-10-26 18:22:47 +01:00
pre-commit-ci[bot]
6a4078f977 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-26 17:17:20 +00:00
lumenCodes
12de64828c update to the proxy file. 2022-10-26 18:12:23 +01:00
lumenCodes
23506a25e5 applied PR change suggestions 2022-10-26 11:44:13 +01:00
lumenCodes
8ffa07e82d Update to the services.md 2022-10-26 11:44:13 +01:00
Esther Christopher
2019bd2797 Update upgrading.rst
Hi @minrk, I went through the reference files you sent and made the necessary adjustments. I think everything should be fine now. I also added a new correction. Please review and revert.
2022-10-26 11:24:53 +01:00
Min RK
88e2346bf2 Merge pull request #4171 from liliyao2022/patch-9
typos in example readme
2022-10-26 10:02:02 +02:00
Min RK
2bb7594cd1 Merge pull request #4170 from KaluBuikem/patch-2
Updated deployment gallery links
2022-10-26 10:01:12 +02:00
Min RK
36d596a4d3 Merge pull request #4169 from emmanuella194/main
typo in contributing doc
2022-10-26 09:42:05 +02:00
Min RK
d9c36ed725 Merge pull request #4166 from lumenCodes/contributing
Welcome first-time contributors to the forum
2022-10-26 09:39:38 +02:00
Lili Yao
cb5cc8c1b4 Update Groups.jsx
"useState" was not used in this file.
2022-10-26 17:58:26 +11:00
Lili Yao
76f7ff4721 Update README.md
Corrected some spelling errors.
2022-10-26 15:44:52 +11:00
pre-commit-ci[bot]
22d2bbe1ae [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-26 00:51:27 +00:00
Kalu Chibuikem Victor
d215248d8a Updated gallery-jhub-deployments.md
I embedded links into the text and updated minor text errors
2022-10-26 01:50:28 +01:00
Emmanuella Orioma
488331e033 Update docs.rst
I corrected the spelling error in line 21
2022-10-25 23:26:16 +03:00
Chinwendu
cde1b65252 Update docs/source/contributing/community.md
Co-authored-by: Min RK <benjaminrk@gmail.com>
2022-10-25 16:11:52 +01:00
Joel-Ando
5f32abeeba Update tech-implementation.md 2022-10-25 14:55:53 +01:00
Min RK
41cbcc9502 Merge pull request #4021 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-10-25 10:37:38 +02:00
Min RK
297c40195c Merge pull request #4106 from alwasega/server
Edited and restructured `server-api` file
2022-10-25 10:14:10 +02:00
Min RK
209eb4468e Merge pull request #4157 from Uzor13/rest-api-doc
Updated JupyterHub's REST API doc
2022-10-25 09:57:47 +02:00
pre-commit-ci[bot]
7c92902e48 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-24 23:10:47 +00:00
pre-commit-ci[bot]
d5beda293b [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.37.3 → v3.1.0](https://github.com/asottile/pyupgrade/compare/v2.37.3...v3.1.0)
- [github.com/psf/black: 22.6.0 → 22.10.0](https://github.com/psf/black/compare/22.6.0...22.10.0)
- [github.com/pre-commit/mirrors-prettier: v2.7.1 → v3.0.0-alpha.3](https://github.com/pre-commit/mirrors-prettier/compare/v2.7.1...v3.0.0-alpha.3)
2022-10-24 23:08:59 +00:00
pre-commit-ci[bot]
3b4c40e5e0 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-24 18:22:26 +00:00
Uzochukwu Precious
5cfa16dbfd review update 2022-10-24 19:21:43 +01:00
lumenCodes
7a22a2cf93 Addittion to the contributing .md 2022-10-24 17:36:38 +01:00
pre-commit-ci[bot]
eb72067ab3 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-24 14:46:42 +00:00
Allan Wasega
3da4dc66c9 Incorporated suggested edits 2022-10-24 17:44:57 +03:00
Allan Wasega
87c2d545df Merge branch 'jupyterhub:main' into server 2022-10-24 17:00:33 +03:00
Joel-Ando
3e4cc0b869 Update tech-implementation.md 2022-10-24 14:14:48 +01:00
Min RK
de8d1b71f8 Merge pull request #4153 from Teniola-theDev/patch-1
Consistent capitalization of Authenticator
2022-10-24 14:43:30 +02:00
Min RK
af7494c460 Merge pull request #4026 from mouse1203/main
Add browser-based tests with Selenium
2022-10-24 14:41:24 +02:00
Joel-Ando
d0a48c0655 Update tech-implementation.md 2022-10-24 13:28:28 +01:00
Teniola Olowookere
48fc74b9b4 removed extra text 2022-10-24 13:17:52 +01:00
Min RK
54ac5226b3 Merge pull request #4152 from emmanuella194/main
Link back to rbac from use-cases
2022-10-24 14:15:27 +02:00
Emmanuella Orioma
ce9feb5139 Update use-case.md
changed RBAC documentation url to the internal rbac jupyter documentation
2022-10-24 15:09:29 +03:00
Teniola Olowookere
ec0cb70f35 removed duplicate link 2022-10-24 13:08:52 +01:00
Teniola Olowookere
c0af08fabd Merge branch 'jupyterhub:main' into patch-1 2022-10-24 13:07:32 +01:00
Teniola Olowookere
a2e59e6867 Update docs/source/getting-started/authenticators-users-basics.md
Co-authored-by: Min RK <benjaminrk@gmail.com>
2022-10-24 13:03:04 +01:00
Min RK
4859c62381 Merge pull request #4154 from minrk/rm-redundant-roles-target
Remove redundant ref target for roles
2022-10-24 13:44:26 +02:00
mouse1203
9b7a77c36f selenium: added docstrings
added docstrings, parameter for open_url function, removed element function (unused)
2022-10-24 13:09:46 +02:00
Min RK
ab7ec8b33d Merge pull request #4160 from Christiandike/update/configsudo.md
Update/configsudo.md
2022-10-24 12:57:53 +02:00
Min RK
15c691b358 Merge pull request #4162 from liliyao2022/patch-8
Typo in institutional-faq
2022-10-24 12:44:03 +02:00
Christian Dike
1c95d94b96 Update config-sudo.md 2022-10-24 11:38:58 +01:00
Christian Dike
e76e9099c2 Update docs/source/reference/config-sudo.md
Co-authored-by: Min RK <benjaminrk@gmail.com>
2022-10-24 11:33:48 +01:00
Min RK
63cd63ffee Merge pull request #4161 from Christiandike/update/separate-proxy.md
Improve text in proxy docs
2022-10-24 12:33:07 +02:00
Min RK
2c4c5fc6fe Merge pull request #4159 from liliyao2022/patch-7
Update roadmap.md
2022-10-24 11:35:52 +02:00
Min RK
c788d6f087 Merge pull request #4158 from liliyao2022/patch-6
Update README.md
2022-10-24 11:35:14 +02:00
Min RK
a1c94a6e13 Merge pull request #4098 from NPDebs/main
Proofread and Improve security-basics.rst
2022-10-24 11:33:05 +02:00
Min RK
37bf8e0724 Merge pull request #4118 from falyne/main
Capitalization typo in troubleshooting.md
2022-10-24 10:52:39 +02:00
Min RK
56161c2aa6 Merge pull request #4155 from Christiandike/update/oauth.md
Add link to OAuth 2
2022-10-24 10:44:16 +02:00
Min RK
66a86f5db0 Merge pull request #4090 from alwasega/community
Restructured Community communication channels file
2022-10-24 10:28:20 +02:00
Min RK
ea0462de1a Merge pull request #4164 from jupyterhub/dependabot/github_actions/docker/setup-buildx-action-2.2.1
Bump docker/setup-buildx-action from 2.1.0 to 2.2.1
2022-10-24 09:21:51 +02:00
dependabot[bot]
37be9b4a5b Bump docker/setup-buildx-action from 2.1.0 to 2.2.1
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.1.0 to 2.2.1.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](95cb08cb26...8c0edbc76e)

---
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>
2022-10-24 05:27:46 +00:00
Lili Yao
c4d8be22b6 Update institutional-faq.md
Corrected a spelling error.
2022-10-24 12:51:48 +11:00
pre-commit-ci[bot]
ced408c205 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-23 19:18:11 +00:00
Christian Dike
5ce930324c Update separate-proxy.md 2022-10-23 20:16:46 +01:00
Christian Dike
36b15d7ce0 Update separate-proxy.md 2022-10-23 20:11:36 +01:00
Christian Dike
7b636b6f9c Update config-sudo.md 2022-10-23 19:26:24 +01:00
Christian Dike
35b06481e2 Update config-sudo.md 2022-10-23 19:03:32 +01:00
Joel-Ando
18b049e3c9 Update tech-implementation.md 2022-10-23 16:23:35 +01:00
Joel-Ando
6b62fe794e Update tech-implementation.md
did the necessary changes
2022-10-23 16:13:20 +01:00
Lili Yao
ad25ef8f87 Update roadmap.md
It seems that we don't need an "a" here, or should we change it to "an" instead?
2022-10-23 15:42:57 +11:00
Lili Yao
61369ea5da Update README.md
Modified some spelling and grammar errors.
2022-10-23 13:53:02 +11:00
Emmanuella Orioma
a17b4c5801 Updated use-cases.md
Added the RBAC jupyter documentation link
2022-10-22 22:23:26 +03:00
Deborah Udoh
750d36a8f7 Update security-basics.rst 2022-10-22 11:19:27 +01:00
Deborah Udoh
23fc2f42d0 Update security-basics.rst
Co-authored-by: Min RK <benjaminrk@gmail.com>
2022-10-22 10:41:10 +01:00
Deborah Udoh
29ba669c73 Update security-basics.rst 2022-10-22 10:32:16 +01:00
Uzochukwu Precious
eb8f338186 Updated JupyterHub's REST API doc 2022-10-22 10:02:39 +01:00
Melissa Kirabo
76f9cf00c4 Update index.rst 2022-10-22 10:55:50 +03:00
Ngobiri Falyne
fc5f55caf9 Update troubleshooting.md
I replaced the comma, 
adjusted jupyterhub to JuputerHub
and the others as adiced
2022-10-22 06:53:16 +01:00
Lili Yao
131da596c5 Update README.md 2022-10-22 11:26:18 +11:00
Christian Dike
70bfdd6d00 update oauth.md 2022-10-22 00:51:38 +01:00
Christian Dike
02f33073ad update oauth.md 2022-10-22 00:37:08 +01:00
Esther Christopher
411189e54c Update upgrading.rst 2022-10-22 00:32:18 +01:00
Allan Wasega
9f5f19cb26 Fixed minor errors 2022-10-22 01:06:56 +03:00
Allan Wasega
9d93df6baf Fixed a minor error 2022-10-22 00:57:04 +03:00
pre-commit-ci[bot]
39eb1f055f [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-21 21:40:42 +00:00
Allan Wasega
74b0ebefe9 Fixed minor issues in community communication channels file 2022-10-22 00:34:23 +03:00
pre-commit-ci[bot]
28867760a4 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-21 21:05:16 +00:00
Allan Wasega
7a0b98d9ce Updated the server-api file with all comments 2022-10-22 00:04:37 +03:00
Allan Wasega
14e9155eb8 Merge branch 'jupyterhub:main' into server 2022-10-21 23:53:47 +03:00
pre-commit-ci[bot]
7ce4b13998 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-21 20:41:36 +00:00
Allan Wasega
5a16d770da Updated the server-api file as per review comments 2022-10-21 23:41:06 +03:00
Teniola Olowookere
b741a30dc3 Update docs/source/getting-started/authenticators-users-basics.md
I committed your suggestion about changing the target for the "roles". Thank you!

Co-authored-by: Min RK <benjaminrk@gmail.com>
2022-10-21 20:25:21 +01:00
Min RK
aebe33b62b Remove redundant ref target for roles
it's already addressable at that same target name,
having this here results in ambiguous ref targets in MyST
2022-10-21 15:59:49 +02:00
pre-commit-ci[bot]
794a1aa70f [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-21 13:44:46 +00:00
Teniola Olowookere
4e45b89ed1 Capitalised some words 2022-10-21 14:40:24 +01:00
mtkmtk
cd969c5dc4 Update websecurity.md 2022-10-21 10:31:24 -03:00
mtkmtk
de4117cba9 Update docs/source/reference/websecurity.md
Co-authored-by: Min RK <benjaminrk@gmail.com>
2022-10-21 10:25:09 -03:00
Sarah Gibson
f4c129a649 Merge pull request #4148 from Christiandike/update/spawners.md 2022-10-21 14:08:15 +01:00
Emmanuella Orioma
69e973d53a Update use-case.md
Worked on the documentation page  (jupyterhub/docs/source/rbac/use-case.md)

Added a wikipedia reference to [RBCA framework] and also emphasized on the solution under the *service to cull idle servers*
2022-10-21 13:21:20 +01:00
mtkmtk
f566559f9a Merge branch 'main' into Improve-on-documentation-websecurity.md 2022-10-21 09:17:48 -03:00
Christian Dike
37b82f7c2a Update docs/source/reference/spawners.md
Co-authored-by: Sarah Gibson <44771837+sgibson91@users.noreply.github.com>
2022-10-21 12:05:12 +01:00
Christian Dike
a71f6be001 Update docs/source/reference/spawners.md
Co-authored-by: Sarah Gibson <44771837+sgibson91@users.noreply.github.com>
2022-10-21 12:04:45 +01:00
Min RK
3da7021faa Merge pull request #4147 from Teebarh/mychanges
Added punctuations and capitalized words where necessary.
2022-10-21 10:34:24 +02:00
Melissa Kirabo
7330babc7e Update index.rst 2022-10-21 11:34:12 +03:00
Min RK
eeb0e506f3 Merge pull request #4146 from lumenCodes/spawners-basic
Update to the spawner basic file
2022-10-21 10:31:03 +02:00
Min RK
d59d856fa6 Merge pull request #4145 from softkeldozy/configuration_branch
Added text to documentation for more readability
2022-10-21 10:30:08 +02:00
Min RK
a7df46ead7 Merge pull request #4126 from PoorvajaRayas/patch-1
Update troubleshooting.md
2022-10-21 10:15:25 +02:00
Min RK
cb03c6035a Merge pull request #4116 from Eshy10/main
Upgrading.rst (Fix Duplicate statement)
2022-10-21 10:11:20 +02:00
Melissa Kirabo
037943728f Update docs/source/index.rst
Co-authored-by: Min RK <benjaminrk@gmail.com>
2022-10-21 11:07:44 +03:00
Melissa Kirabo
42918352a8 Update docs/source/index.rst
Co-authored-by: Min RK <benjaminrk@gmail.com>
2022-10-21 11:06:55 +03:00
Melissa Kirabo
ec18f7b65a Update docs/source/index.rst
Co-authored-by: Min RK <benjaminrk@gmail.com>
2022-10-21 11:04:04 +03:00
Christian Dike
69869ee823 update spawners.md 2022-10-21 01:49:36 +01:00
Christian Dike
fedcd22b0c update spawners.md 2022-10-21 01:29:31 +01:00
Esther Christopher
2f4691e692 Merge branch 'main' into patch-2 2022-10-20 21:15:43 +01:00
mtkmtk
aaffb66bef Updating websecurity.md after first review 2022-10-20 16:42:51 -03:00
Esther Christopher
e228b017e9 Merge branch 'main' into patch-1 2022-10-20 20:30:50 +01:00
Toyibat Adele
8e111665cd Added Punctuations and Capitalized words where necessary. 2022-10-20 17:44:56 +01:00
Sarah Gibson
283d2b75b6 Merge pull request #4135 from Christiandike/update/websecurity 2022-10-20 17:37:36 +01:00
Sarah Gibson
3f73671adf Merge pull request #4114 from alexanderchosen/alexanderchosen 2022-10-20 17:36:00 +01:00
Adewale Modupe
459793010b Merge branch 'main' into main 2022-10-20 14:40:03 +01:00
Eshy10
248bf8ef83 chore: remove capitalize word and "This is" after the colon for environments 2022-10-20 14:25:36 +01:00
Kelvin Obidozie
f71388633f Added text to documentation for more readability 2022-10-20 13:38:12 +01:00
PoorvajaRayas
dd8259fb46 Updated the document by making necessary changes 2022-10-20 17:47:13 +05:30
pre-commit-ci[bot]
677895c3eb [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-20 11:55:29 +00:00
Alexander Chosen Okon
9fcaf8df52 further simplified the words in the document
I made changes to some of the words used by simplifying them to ensure that all users can easily understand the document.
2022-10-20 11:55:23 +00:00
PoorvajaRayas
cd3f37f6a6 Update troubleshooting.md 2022-10-20 17:24:55 +05:30
lumenCodes
91f06f49e0 update to the spawner basic file 2022-10-20 12:54:42 +01:00
Christian Dike
145ccfbd4f update websecurity.md 2022-10-20 10:36:59 +01:00
Ngobiri Falyne
141f5ea2b4 Update troubleshooting.md 2022-10-20 10:01:44 +01:00
pre-commit-ci[bot]
c3da12c195 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-20 09:00:35 +00:00
Ngobiri Falyne
439b96978e Update troubleshooting.md 2022-10-20 09:58:37 +01:00
Min RK
8ba57f9309 Merge pull request #4132 from ToobaJamal/edit
update spawners-basics.md
2022-10-20 10:56:15 +02:00
pre-commit-ci[bot]
1ea557c999 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-20 08:44:59 +00:00
Ngobiri Falyne
d5f5d837de Merge branch 'main' into main 2022-10-20 09:44:28 +01:00
Melissa Kirabo
462324bba8 Merge branch 'main' into patch-1 2022-10-20 11:42:10 +03:00
Min RK
1dd848e560 Merge pull request #4124 from AdrianaHelga/AdrianaHelga-patch-1
Update services-basics.md
2022-10-20 10:28:07 +02:00
Min RK
864f7dc0c1 Merge pull request #4111 from zeelyha/docs
Typo in templates.md
2022-10-20 10:00:19 +02:00
Min RK
817f6e9c35 Merge pull request #4095 from Goodiec/patch-2
Update config-proxy.md
2022-10-20 09:11:24 +02:00
Min RK
85c67dd05c Merge pull request #4088 from ToobaJamal/main
Grammatical/link fixes in upgrading doc
2022-10-20 09:05:15 +02:00
Min RK
b0c2dd01a1 Merge pull request #4097 from Mackenzie-OO7/fix-typos
Modifications to URLs docs
2022-10-20 09:03:20 +02:00
Christian Dike
281658ccce update websecurity.md
Delete erroneous text from merge conflict
2022-10-20 07:48:52 +01:00
pre-commit-ci[bot]
c14d8e3446 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-20 03:28:21 +00:00
Joel-Ando
d956563ff4 Merge branch 'main' into Joel-Ando-patch-2 2022-10-20 04:27:19 +01:00
pre-commit-ci[bot]
e389e7f6d4 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-19 20:35:22 +00:00
mtkmtk
634bd26ad4 Update websecurity.md 2022-10-19 17:32:58 -03:00
Levai Mackenzie Ágbàrà
e82bd5a96b Merge branch 'jupyterhub:main' into fix-typos 2022-10-19 18:43:22 +01:00
pre-commit-ci[bot]
9c044e863a [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-19 13:33:49 +00:00
Alexander Chosen Okon
0340e9d6ad Merge branch 'main' into alexanderchosen 2022-10-19 13:33:11 +00:00
pre-commit-ci[bot]
ecf486d678 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-19 11:59:10 +00:00
Christian Dike
587059da11 Merge branch 'main' into update/websecurity 2022-10-19 12:57:48 +01:00
Alexander Chosen Okon
6f25abac2e Update config-user-env.md
I made a few changes to the spacing used.
2022-10-19 11:49:55 +00:00
Christian Dike
7d73d5774e update websecurity.md
- fix typos/edit text
- add important links
2022-10-19 12:37:13 +01:00
Georgiana
30e652f59e Merge pull request #4081 from Christiandike/Update/docs
Migrate community channels to markdown, update text
2022-10-19 11:59:43 +02:00
Georgiana
00cc149b0d Merge pull request #4089 from Christiandike/update/tech-implementation.md
Update rbac tech-implementation docs
2022-10-19 11:51:58 +02:00
pre-commit-ci[bot]
d407c96ee8 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-19 09:47:27 +00:00
Christian Dike
84e1216dda Update docs/source/contributing/community.md
Co-authored-by: Georgiana <georgiana.dolocan@gmail.com>
2022-10-19 10:45:49 +01:00
Christian Dike
c8aae0ea1c Update docs/source/contributing/community.md
Co-authored-by: Georgiana <georgiana.dolocan@gmail.com>
2022-10-19 10:44:41 +01:00
Christian Dike
313623256f Update docs/source/contributing/community.md
Co-authored-by: Georgiana <georgiana.dolocan@gmail.com>
2022-10-19 10:44:15 +01:00
Georgiana
da7ac11605 Merge pull request #4069 from chicken-biryani/main
Update the testing docs
2022-10-19 11:29:36 +02:00
Goodness Chris-Ugari
eaeef65560 Update config-proxy.md
Update comment
2022-10-19 09:34:42 +01:00
Alexander Chosen okon
a4597a1c50 alexanderchosen 2022-10-18 23:47:20 +00:00
Alexander Chosen okon
390efc1c5a removed the logo image and resolved some conflicts 2022-10-18 23:24:53 +00:00
Goodness Chris-Ugari
853f8accf5 Update config-proxy.md
update
2022-10-18 15:09:44 +01:00
Goodness Chris-Ugari
1f66237a5a Merge branch 'jupyterhub:main' into patch-2 2022-10-18 15:04:47 +01:00
Georgiana
0881514988 Merge pull request #4096 from Christiandike/update/config-ghoauth
Link reference to github oauth config with jupyter
2022-10-18 15:03:04 +02:00
Georgiana
975a841cdc Merge pull request #4093 from Achele/Achele
fixed some typos and technical terms
2022-10-18 15:01:30 +02:00
Sarah Gibson
ef0a627e28 Merge pull request #4133 from Teniola-theDev/spawner/editone
I capitalized cli and added y to jupterhub
2022-10-18 12:22:22 +01:00
Teniola Olowookere
504ebe9012 capitalized cli and added y to jupterhub 2022-10-18 10:09:31 +01:00
Tooba Jamal
895d713370 update spawners-basics.md 2022-10-18 12:01:13 +05:00
Tooba Jamal
d1ad045335 update index.rst 2022-10-18 11:55:48 +05:00
Tooba Jamal
1041bc53b1 fix typo 2022-10-18 11:21:50 +05:00
lumenCodes
2636a9fff5 added section refrence 2022-10-18 03:26:36 +01:00
lumenCodes
b1dfac546d fix: typo errors 2022-10-18 03:20:34 +01:00
pre-commit-ci[bot]
28de35facd [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-18 01:25:28 +00:00
lumenCodes
10c54353da Rest Api doc update 2022-10-18 02:19:33 +01:00
pre-commit-ci[bot]
b890a7486d [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-17 20:33:17 +00:00
PoorvajaRayas
97c72dd779 Update troubleshooting.md
Improved the documentation to make it clearer
2022-10-18 02:01:50 +05:30
Christian Dike
ae833d4a51 Add link to gh oauth
Co-authored-by: Georgiana <georgiana.dolocan@gmail.com>
2022-10-17 18:09:49 +01:00
Shloka
15b8857728 Update docs/source/contributing/tests.rst
Co-authored-by: Min RK <benjaminrk@gmail.com>
2022-10-17 22:30:55 +05:30
Shloka
79ea4038e5 Update docs/source/contributing/tests.rst
Co-authored-by: Min RK <benjaminrk@gmail.com>
2022-10-17 22:30:47 +05:30
Sarah Gibson
e7284b65ad Merge pull request #4092 from Temidayo32/announcement 2022-10-17 17:33:52 +01:00
Ojoachele Onuh
deaccdc668 Resolved and updated corrections from previous pull request 2022-10-17 17:27:09 +01:00
pre-commit-ci[bot]
838719e7ab [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-17 15:11:38 +01:00
Christian Dike
6ca5c1a276 Update documentation
Fix structure of documentation to aid readability and flow.
2022-10-17 15:09:40 +01:00
dependabot[bot]
d3facd93f1 Merge pull request #4121 from jupyterhub/dependabot/github_actions/docker/setup-buildx-action-2.1.0 2022-10-17 12:46:35 +00:00
Simon Li
8d2a987c81 remove out of date commented tag version 2022-10-17 13:29:25 +01:00
Christian Dike
e7a325ed24 Update docs/source/rbac/tech-implementation.md
update text

Co-authored-by: Min RK <benjaminrk@gmail.com>
2022-10-17 13:20:37 +01:00
Christian Dike
fc6d93bbe3 Update docs/source/rbac/tech-implementation.md
Replace URLs with internal markdown link

Co-authored-by: Min RK <benjaminrk@gmail.com>
2022-10-17 13:20:02 +01:00
Goodness Chris-Ugari
e9f8459681 Merge branch 'jupyterhub:main' into patch-2 2022-10-17 13:06:29 +01:00
Min RK
8785ecd810 Merge pull request #4086 from ArafatAbdussalam/branch2
Updated log messages
2022-10-17 13:45:16 +02:00
Min RK
147f029bf6 Merge pull request #4091 from Goodiec/patch-1
Update config-user-env.md
2022-10-17 13:44:21 +02:00
Min RK
cd440b0f7d Merge pull request #4085 from Goodiec/Goodiec-troubleshooting-doc
Update troubleshooting.md
2022-10-17 13:43:41 +02:00
Min RK
0a9d2b7f76 Merge branch 'main' into branch2 2022-10-17 13:42:02 +02:00
Min RK
658a1fccfe Merge pull request #4083 from ArafatAbdussalam/branch1
updated websecirity.md
2022-10-17 13:10:40 +02:00
dependabot[bot]
ee578dd7b5 Merge pull request #4122 from jupyterhub/dependabot/github_actions/docker/build-push-action-3.2.0 2022-10-17 11:10:16 +00:00
Min RK
d2d9ce9d02 Merge pull request #4074 from ToobaJamal/edit
Update index.rst
2022-10-17 13:05:14 +02:00
Min RK
93529d11bc Merge pull request #4065 from chicken-biryani/community-channels
Modification in community channels docs
2022-10-17 13:01:00 +02:00
dependabot[bot]
9d630add9a Bump docker/setup-buildx-action from 2.0.0 to 2.1.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.0.0 to 2.1.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](dc7b9719a9...95cb08cb26)

---
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>
2022-10-17 10:53:28 +00:00
dependabot[bot]
ea88427b7f Bump docker/build-push-action from 3.1.1 to 3.2.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3.1.1 to 3.2.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](c84f382811...c56af95754)

---
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>
2022-10-17 10:53:28 +00:00
Simon Li
cc4a3da32c Merge pull request #4123 from jupyterhub/dependabot/github_actions/docker/setup-qemu-action-2.1.0
Bump docker/setup-qemu-action from 2.0.0 to 2.1.0
2022-10-17 11:52:42 +01:00
Goodness Chris-Ugari
c7f14eec14 Update troubleshooting.md
Removed static header items
2022-10-17 11:07:39 +01:00
Goodness Chris-Ugari
cf1dcd6f3a Update config-user-env.md
update
2022-10-17 10:59:20 +01:00
dependabot[bot]
bcaaaa2d35 Bump docker/setup-qemu-action from 2.0.0 to 2.1.0
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 2.0.0 to 2.1.0.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](8b122486ce...e81a89b173)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-17 05:20:46 +00:00
AdrianaHelga
7462cfa6fd Update services-basics.md 2022-10-16 11:01:21 +03:00
Arafat Abdussalam
a785b8d38a I made the correction to the PR
I resolved my previous commit as suggested
2022-10-14 02:59:34 -07:00
Arafat Abdussalam
714b5925f6 Correction of previous commit
I made a correction to my previous commit as suggested. I will def try to avoid such mistakes.
2022-10-14 02:51:40 -07:00
Ngobiri Falyne
de3210536f Update troubleshooting.md
Adjusted the Heading sudospawner - Sudospawner to suite sentence case
Under proxy Settings, i adjusted the sentence "a organization to an organization" also singleuser to single-user
under Toree intergration, the sentence is not clear so I adjusted to Toree kernel will raise and issue when running with jupyterHub,
2022-10-14 04:53:09 +01:00
Eshy10
e6e1e90386 chore: captitalize the first letter on explation of hub environment 2022-10-14 03:04:08 +01:00
Eshy10
0667451584 chore: remove duplicate version statement and add color to environments title 2022-10-14 02:55:27 +01:00
Alexander Chosen okon
35d26e75f4 Documentation reviewed, made concise & image added 2022-10-13 23:20:10 +00:00
pre-commit-ci[bot]
9f62c76a8e [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-13 22:41:04 +00:00
Esther Christopher
72096b5166 Edited for Clarity
Edited for sentence restructuring, sentence clarity, change of grammar, grammatical punctuation errors, and grammatical correctness.
2022-10-13 17:00:49 +01:00
Zeelyha
88906c2e1b Update templates.md
Fixed a typo
2022-10-13 15:13:30 +01:00
Esther Christopher
67b62db524 Reviewed the documentation
1. Edited the topic of the documentation to Pascal Case.
2. Completed a sentence for clarity
2022-10-13 13:04:42 +01:00
Allan Wasega
f9dbfd7275 Edited and restructured server-api file 2022-10-13 08:58:42 +03:00
Deborah Udoh
b15d56432d Proofread and improve security-basics.rst 2022-10-12 16:21:07 +01:00
Chidinma Udo
a10879f493 Modifications to URLs docs 2022-10-12 16:20:18 +01:00
Tooba Jamal
c2d1a21d32 update spawners-basics.md 2022-10-12 20:18:18 +05:00
Tooba Jamal
8060003fd6 update spawners-basics.md 2022-10-12 20:12:20 +05:00
Shloka
5018c13b81 Fixes 2022-10-12 19:31:04 +05:30
Tooba Jamal
99255b04ac fix typo 2022-10-12 18:59:56 +05:00
Christian Dike
2e6949c6e1 add reference for github oauth config with jupyter
add link to the reference documentation for github oauth configuration with jupyterhub. Fix typos
2022-10-12 14:59:31 +01:00
Tooba Jamal
0f5f0f0df9 update index.rst
Made the requested changes
2022-10-12 18:58:28 +05:00
Goodness Chris-Ugari
da302f5206 Update config-proxy.md
This PR improves the proxy configuration doc and is part of [issue 41](https://github.com/jupyterhub/outreachy/issues/41)
2022-10-12 14:51:22 +01:00
Shloka
b0f90a0f4b Update docs/source/contributing/tests.rst
Co-authored-by: Simon Li <orpheus+devel@gmail.com>
2022-10-12 19:08:01 +05:30
Shloka
7a915533a6 Update docs/source/contributing/tests.rst
Co-authored-by: Simon Li <orpheus+devel@gmail.com>
2022-10-12 19:07:50 +05:30
Shloka
733e018bdc Update docs/source/contributing/tests.rst
Co-authored-by: Simon Li <orpheus+devel@gmail.com>
2022-10-12 19:07:43 +05:30
Busayo-ojo
4380d1c15a Fixed typos and added punctuations 2022-10-12 14:33:58 +01:00
pre-commit-ci[bot]
a87872e7aa [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-12 13:28:00 +00:00
Shloka
578c78397a Modifications 2022-10-12 18:56:30 +05:30
Shloka
0820f4cfa1 Modifications 2022-10-12 18:52:58 +05:30
Ojoachele Onuh
f386da1b7a fixed some typos and technical terms 2022-10-12 13:12:08 +01:00
Goodness Chris-Ugari
71ce37b834 Update troubleshooting.md
Implement suggested changes.
2022-10-12 13:02:12 +01:00
Goodness Chris-Ugari
64965b7a2e Merge branch 'jupyterhub:main' into Goodiec-troubleshooting-doc 2022-10-12 12:53:25 +01:00
pre-commit-ci[bot]
ef7545fc75 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-12 11:34:19 +00:00
pre-commit-ci[bot]
af95d643b1 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-12 11:33:54 +00:00
Goodness Chris-Ugari
67bca186b4 Update config-user-env.md
This PR improves the 'Configuring user environments' doc and is part of [issue 41](https://github.com/jupyterhub/outreachy/issues/41)
2022-10-12 12:31:44 +01:00
Temidayo
08a125489d fixed a typo 2022-10-12 12:29:07 +01:00
Temidayo
1050dadda4 modified announcement README and config.py 2022-10-12 12:27:57 +01:00
Min RK
5997614f45 Merge pull request #4073 from ikeadeoyin/quickstart-docker-guide
improved the quickstart docker guide
2022-10-12 12:40:08 +02:00
Georgiana
7e78394eb2 Merge pull request #4079 from mahamtariq58/documentation
Improve the documentation about log messages
2022-10-12 12:39:53 +02:00
Min RK
fd2717c5ce Merge pull request #4071 from NPDebs/main
Improve Documentation
2022-10-12 12:35:09 +02:00
Tooba Jamal
dcd4e689aa update index.rst 2022-10-12 12:09:57 +05:00
Tooba Jamal
6ef8120f94 fix grammatical error 2022-10-12 10:58:13 +05:00
Joel-Ando
a697c80475 Update tech-implementation.md 2022-10-12 01:10:09 +01:00
mahamtariq58
c675c29fce Update docs/source/admin/log-messages.md
Co-authored-by: Georgiana <georgiana.dolocan@gmail.com>
2022-10-12 02:53:58 +05:00
mahamtariq58
9b44eec7f7 Update docs/source/admin/log-messages.md
Co-authored-by: Georgiana <georgiana.dolocan@gmail.com>
2022-10-12 02:53:43 +05:00
mahamtariq58
9cb4173042 Update docs/source/admin/log-messages.md
Co-authored-by: Georgiana <georgiana.dolocan@gmail.com>
2022-10-12 02:53:24 +05:00
Christian Dike
916a83a954 Update tech-implementation.md
Fix typos and grammatical errors. Improve sentence structure. Use appropriate technical terms.
2022-10-11 19:03:21 +01:00
mahamtariq58
6933e8fb33 Update docs/source/admin/log-messages.md
Co-authored-by: Georgiana <georgiana.dolocan@gmail.com>
2022-10-11 19:57:11 +05:00
Tooba Jamal
8f30f4afd9 update upgrading.rst 2022-10-11 19:40:15 +05:00
Tooba Jamal
d5790ce386 update upgrading.rst 2022-10-11 19:38:36 +05:00
Tooba Jamal
6b4c5e4bce update upgrading.rst 2022-10-11 19:36:04 +05:00
Tooba Jamal
15cf30156d update upgrading.rst 2022-10-11 19:12:03 +05:00
Georgiana
dff0f054d0 Merge pull request #4068 from Goodiec/Goodiec-improve-setup-doc-apge
Update setup.rst
2022-10-11 14:33:27 +02:00
Goodness Chris-Ugari
45b5a249c6 Update setup.rst
Corrected JupyterHub capitalization
2022-10-11 13:02:10 +01:00
Georgiana
e3a25a883f Merge pull request #4070 from Mackenzie-OO7/mackenzie-oo7
Update the Technical Overview Docs
2022-10-11 14:00:19 +02:00
pre-commit-ci[bot]
3ee21cc967 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-11 09:17:46 +00:00
Arafat Abdussalam
941e8c928a Updated log messages
I improved the log message subsection of the documentation by making the page more user friendly
2022-10-11 10:14:03 +01:00
pre-commit-ci[bot]
5d5a424aea [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-11 08:40:40 +00:00
Goodness Chris-Ugari
f2059c0d03 Update troubleshooting.md
This PR improves the troubleshooting doc and is part of [issue 41](https://github.com/jupyterhub/outreachy/issues/41)
2022-10-11 09:37:54 +01:00
Goodness Chris-Ugari
20f6b13e86 Merge branch 'jupyterhub:main' into Goodiec-improve-setup-doc-apge 2022-10-11 09:14:54 +01:00
Melissa Kirabo
eb6bf3f698 Update index.rst
I have made some changes to the flow of the documentation, added descriptions, and corrected grammatical errors
2022-10-11 10:06:24 +03:00
Arafat Abdussalam
b87b8c52d3 updated websecirity.md
I have the grammatical errors written on the page such as improving the abbreviated words with apostrophes and other typos
2022-10-11 07:21:19 +01:00
pre-commit-ci[bot]
a2852b1b2b [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-10 22:41:59 +00:00
mahamtariq58
b98e981e6a Merge branch 'jupyterhub:main' into documentation 2022-10-11 03:38:52 +05:00
Maham Tariq
d223c0edff Fixed some confused Lines 2022-10-11 02:58:19 +05:00
pre-commit-ci[bot]
53bf7a18ae [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-10 17:03:46 +00:00
Deborah Udoh
835fe8be8f Update roles.md in line with review 2022-10-10 18:03:13 +01:00
Deborah Udoh
ed71aead2b Update roles.md
Co-authored-by: Min RK <benjaminrk@gmail.com>
2022-10-10 17:56:35 +01:00
Georgiana
5713e56fd1 Merge pull request #4067 from Uzor13/uzor-dev
Fixed some typos and add missing links
2022-10-10 14:39:24 +02:00
Uzochukwu Precious
eb65bd7dd6 role link added to note 2022-10-10 12:34:14 +01:00
Tooba Jamal
aa101a7aff Update index.rst 2022-10-10 15:36:10 +05:00
ikeadeoyin
743406e60d made the necessary changes 2022-10-10 10:50:49 +01:00
Chidinma Udo
7f191ea5e8 Applied suggestions from code review
Co-authored-by: Min RK <benjaminrk@gmail.com>
2022-10-10 10:41:57 +01:00
Tooba Jamal
915fab2d26 Update index.rst 2022-10-10 12:55:16 +05:00
ikeadeoyin
b961925bbc improved the quickstart docker guide 2022-10-10 08:48:43 +01:00
Tooba Jamal
3425269cb2 Update index.rst 2022-10-10 12:34:09 +05:00
Min RK
9280621ca8 Merge pull request #4063 from minrk/resolve-excluded-scopes
Fully resolve requested scopes in oauth
2022-10-10 09:24:43 +02:00
ruqayaahh
2661eab54b updated obsolete links and made wordings clearer 2022-10-10 06:07:38 +01:00
pre-commit-ci[bot]
18b1df8bc6 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-09 19:07:30 +00:00
Deborah Udoh
674c441935 Improve documentation 2022-10-09 19:37:59 +01:00
Uzochukwu Precious
e324d89f8a review update 2022-10-09 17:44:32 +01:00
Chidinma Udo
433bb09e9e fixed broken link 2022-10-09 17:13:53 +01:00
Chidinma Udo
facf8039c3 fixed some typos and embedded links 2022-10-09 17:02:27 +01:00
Shloka
395b1a5681 Modifications is testing docs 2022-10-09 19:07:20 +05:30
Goodness Chris-Ugari
65caf37d71 Update setup.rst
This PR improves the setup page and is part of issue #41
2022-10-09 12:37:52 +01:00
Uzochukwu Precious
f5cb617ce7 fixed some typos and also added links #41 2022-10-08 23:16:44 +01:00
pre-commit-ci[bot]
204bfaf8f4 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-08 17:13:41 +00:00
Shloka
f0c825cc1e Modification in community channels 2022-10-08 22:40:22 +05:30
Erik Sundell
fd5705b74b Align test variables' naming with tested function's terminology 2022-10-08 17:03:50 +02:00
Min RK
7585026f81 consistent naming, docstrings for disallowed scopes 2022-10-07 10:45:14 -07:00
Min RK
a4fd0980a3 Back off removal of read:servers -> read:users:name
Only remove it when using the !server filter, which doesn't make sense for read:users:name
2022-10-07 10:29:48 -07:00
Erik Sundell
c126cc3f9b Merge pull request #4064 from minrk/oauth-deprecado
set stacklevel for oauth_scopes deprecation warning
2022-10-06 12:51:04 +02:00
Min RK
f70b11af11 resolve full scope intersection for oauth
allows subset filters in oauth (e.g. server requests scope!server while user has scope!user)
2022-10-05 19:53:54 -07:00
Min RK
6024a9780f remove implicit grant of read:users:name from read:servers
results in weird extra permission that aren't needed
2022-10-05 19:53:54 -07:00
Min RK
63c391641a set stacklevel for oauth_scopes deprecation warning
so it's visible where the deprecated API is called
2022-10-05 18:49:32 -07:00
Erik Sundell
7a6c2038d8 Merge pull request #4061 from Temidayo32/main
modified the contributing documentation
2022-10-03 16:12:37 +02:00
Temidayo
83fb49e7cf Merge branch 'jupyterhub:main' into main 2022-10-02 14:52:24 +01:00
Temidayo
15bf61df2a modified the contributing documentation 2022-10-02 14:39:51 +01:00
Min RK
387e983543 Merge pull request #4053 from danilopeixoto/callable-named-server-limit
Set named_server_limit_per_user type as integer or callable
2022-09-30 09:44:15 +02:00
Danilo Peixoto
37d35953bc Set named_server_limit_per_user type as integer or callable 2022-09-30 09:28:04 +02:00
Min RK
666b3cb36e Merge pull request #4054 from jupyterhub/dependabot/github_actions/char0n/swagger-editor-validate-1.3.2
Bump char0n/swagger-editor-validate from 1.3.1 to 1.3.2
2022-09-30 09:24:41 +02: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
dependabot[bot]
2c897a7ca3 Bump char0n/swagger-editor-validate from 1.3.1 to 1.3.2
Bumps [char0n/swagger-editor-validate](https://github.com/char0n/swagger-editor-validate) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/char0n/swagger-editor-validate/releases)
- [Commits](https://github.com/char0n/swagger-editor-validate/compare/v1.3.1...v1.3.2)

---
updated-dependencies:
- dependency-name: char0n/swagger-editor-validate
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-26 05:27:06 +00:00
Min RK
1a0b46a5c8 Merge pull request #4046 from Neeraj-Natu/main
mentioning limitations of spawner.environment
2022-09-23 13:32:50 +02:00
pre-commit-ci[bot]
596f9669d7 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-09-23 11:25:40 +00:00
neerajnatu
55fbb0b5fe review comments address 2022-09-23 16:54:53 +05:30
Min RK
a3795ad672 Merge pull request #4035 from manics/docker-yarn
setup.py: require npm, check that NPM CSS JSX commands succeed
2022-09-23 10:49:44 +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
Min RK
38afbcc0d0 Merge pull request #4045 from miwig/fix_crash_when_removing_scopes
Fix crash when removing scopes attribute from an existing role
2022-09-22 15:08:27 +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
mouse1203
08b71e7f56 adding asyncio.sleep into test_invalid_credantials
added asyncio.sleep into test_invalid_credantials
2022-09-19 16:28:33 +02:00
mouse1203
9d90496549 updating regarding to the review
removed time.sleep(), removed inrelevant comments, removed unused packages, added few explanations for some functions (in progress), documenting  in progress, added to conftest.py package with Options class
2022-09-19 15:18:07 +02:00
Simon Li
df222de915 verify sdist can be installed without npm/yarn 2022-09-18 17:14:05 +01:00
pre-commit-ci[bot]
01e4f2b974 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-09-17 10:27:34 +00:00
neerajnatu
bffdf690d9 adding to contributor list 2022-09-17 15:49:26 +05:30
neerajnatu
0f06c9376a mentioning limitations of spawner.environment 2022-09-17 15:17:23 +05:30
pre-commit-ci[bot]
99eb8d6a2a [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-09-16 12:43:30 +00:00
Michael Wigard
3bb0d57e35 Fix crash when removing scopes attribute from an existing role 2022-09-16 14:27:12 +02:00
Min RK
29ffb23d67 Merge pull request #4039 from hjoliver/fix-launch-instance 2022-09-13 17:05:11 +02:00
Min RK
729099f87d test coverage for launch_instance(argv) 2022-09-13 12:02:02 +02:00
Hilary James Oliver
daf395c2c3 Pass launch_instance args on correctly. 2022-09-13 09:27:49 +12:00
Simon Li
8b68286486 setup.py: require npm, check that NPM CSS JSX commands succeed 2022-09-10 17:59:53 +01:00
Erik Sundell
ad44b16104 Merge pull request #4034 from manics/docker-yarn
Fix Dockerfile yarn JSX build
2022-09-10 16:42:04 +02:00
Simon Li
fa33faeefa Dockerfile: check static/js/admin-react.js exists 2022-09-10 12:31:27 +01:00
Simon Li
a3b20bb220 Dockerfile: install yarn with npm 2022-09-10 12:24:17 +01:00
Simon Li
b644052cb4 Dockerfile: Use python -m build to match release workflow 2022-09-10 12:12:58 +01:00
Min RK
02dead8ab1 Bump to 3.1.0.dev 2022-09-09 08:37:18 +02:00
Min RK
24506888ea Bump to 3.0.0 2022-09-09 08:32:58 +02:00
Min RK
457ad3ec85 Merge pull request #4029 from consideRatio/pr/update-changelog-for-3.0.0
Update changelog for 3.0.0
2022-09-09 08:16:24 +02:00
Min RK
75e8274a7b date for 3.0.0 2022-09-09 08:16:07 +02:00
Min RK
dd69213a3c [capacity doc]: add concurrent user section 2022-09-07 12:42:41 +02:00
Min RK
1aafdb1d1b doc: More suggestions from review
- add costs, links
- labels for use cases
- literal math formatting
2022-09-07 12:29:09 +02:00
pre-commit-ci[bot]
9a84b9d9a1 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-09-07 09:56:00 +00:00
Min RK
bf6786c55b Apply suggestions from code review
Co-authored-by: Chris Holdgraf <choldgraf@gmail.com>
2022-09-07 11:55:33 +02:00
Erik Sundell
2a3ceff29f Update changelog for 3.0.0 2022-09-07 09:58:17 +02:00
Min RK
1e9614b218 Add capacity planning doc 2022-09-06 12:25:39 +02:00
Erik Sundell
5e29605341 Merge pull request #4018 from minrk/reset-offset
reset offset to 0 on name filter change
2022-09-05 18:46:08 +02:00
Min RK
34b6bc3a3f call reducers in some tests
allows testing reducer functionality

workaround bug preventing mocked useSelector from behaving realistically
2022-09-05 15:09:11 +02:00
Min RK
485190e5af make selenium tests opt-in
avoids running them over and over again
2022-09-02 14:00:19 +02:00
Min RK
b90200667f fix headless firefox option 2022-09-02 14:00:19 +02:00
mouse1203
5885f88d79 Update jupyterhub/tests/selenium/conftest.py
Co-authored-by: Min RK <benjaminrk@gmail.com>
2022-09-02 13:43:20 +02:00
mouse1203
b87561d396 remove conditional for FireFox
removing conditionals for FF
2022-09-02 13:32:11 +02:00
mouse1203
10aba2c038 Merge branch 'main' of https://github.com/jupyterhub/jupyterhub 2022-09-02 13:14:28 +02:00
mouse1203
09c4fee780 add selenium tests 2022-09-02 13:12:31 +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
Erik Sundell
7a48da1916 Merge pull request #4022 from possiblyMikeB/token-template-correction
Use correct expiration labels in drop-down menu on token page.
2022-08-24 20:01:20 +02:00
possiblyMikeB
5eaf59dd72 correct token expiration time labels 2022-08-23 18:29:15 -04:00
Simon Li
73a33ed5fc Merge pull request #4019 from minrk/sync-groups-repeat
avoid database error on repeated group name in sync_groups
2022-08-19 16:54:06 +01: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
Min RK
0b9ae96a96 avoid database error on repeated group name in sync_groups 2022-08-19 10:53:21 +02:00
Min RK
2c9653bc0d reset offset to 0 on name filter change
move offset to redux state, rather than independent,
since it can come from two places (user_page and pagination footer). Keeps things in sync.

Adds reducers for setting offset, name filter explicitly.
2022-08-19 10:25:17 +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
Erik Sundell
71e86f3064 Merge pull request #4016 from minrk/edituser-validate
admin: avoid redundant client-side username validation in edit-user
2022-08-16 14:13:49 +02:00
Min RK
8a1110f2c0 admin: avoid redundant client-side username validation
username validation is the server-side's responsibility
2022-08-16 13:48:36 +02:00
Min RK
bb52351a6e Merge pull request #4013 from minrk/test-311
Test 3.11
2022-08-10 11:36:14 +02:00
Min RK
87c745d3bf mock greenlet needs to raise ImportError 2022-08-10 11:02:53 +02:00
Min RK
374c6c848b it's actually greenlet 2022-08-10 10:45:57 +02:00
Min RK
af31ee8c94 condition brackets
Co-authored-by: Erik Sundell <erik.i.sundell@gmail.com>
2022-08-10 10:28:30 +02:00
Min RK
26a9883b93 add mock-gevent to allow install on Python 3.11
gevent is not actually required, but sqlalchemy lists it as a dependency (on linux only)
2022-08-10 10:08:08 +02:00
Min RK
bda3e0c931 test on Python 3.11.0-rc.1 2022-08-10 10:06:37 +02:00
Min RK
f3d17eb77e Merge pull request #4012 from minrk/doc-oauth-no-confirm
document oauth_no_confirm in services
2022-08-10 09:30:48 +02:00
Erik Sundell
5f92cfcc0e Merge pull request #4011 from minrk/trim-form-input
restore trimming of username input
2022-08-10 09:05:34 +02:00
Min RK
b55eaae51f document oauth_no_confirm in services 2022-08-10 08:57:35 +02:00
Min RK
c9e6d6afa3 restore trimming of username input
continue to not trim password or custom fields

trailing/leading space is explicitly forbidden in validate_username
2022-08-10 08:45:50 +02:00
Erik Sundell
2f1d340c42 Merge pull request #4006 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-08-09 08:09:29 +02:00
pre-commit-ci[bot]
2ba99656c1 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/PyCQA/flake8: 5.0.2 → 5.0.4](https://github.com/PyCQA/flake8/compare/5.0.2...5.0.4)
2022-08-08 22:58:55 +00:00
Erik Sundell
635f63c1cd Merge pull request #4005 from jupyterhub/dependabot/github_actions/docker/build-push-action-3.1.1
Bump docker/build-push-action from 3.1.0 to 3.1.1
2022-08-08 09:50:23 +02:00
dependabot[bot]
b9b49ff306 Bump docker/build-push-action from 3.1.0 to 3.1.1
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](1cb9d22b93...c84f382811)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-08 05:29:25 +00:00
Min RK
5640a1506e Merge pull request #4002 from naatebarber/admin-with-pagination-api
Integrate Pagination API into Admin JSX
2022-08-05 12:07:12 +02:00
vpopescu
d4532c64aa fixed base.py 2022-08-04 17:59:06 +02:00
pre-commit-ci[bot]
4767cfa4e9 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-08-04 14:18:27 +00:00
Nathan Barber
309d687c26 Update jsx/src/components/Groups/Groups.jsx
Co-authored-by: Min RK <benjaminrk@gmail.com>
2022-08-04 10:17:43 -04:00
Nathan Barber
df25c09962 Update jsx/src/components/PaginationFooter/PaginationFooter.jsx
Co-authored-by: Min RK <benjaminrk@gmail.com>
2022-08-04 10:17:35 -04: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
Nathan Barber
09d0909878 Update unit tests to spec 2022-08-03 12:50:29 -04:00
Nathan Barber
72db4624e0 Move user/group queries from app to component uE's 2022-08-03 12:28:05 -04:00
Nathan Barber
e9eca22e3b add useEffect, new pagination style 2022-08-03 12:18:28 -04:00
Nathan Barber
33d4f382d5 Use data.items to display users 2022-08-03 10:59:38 -04: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
Min RK
562a24b651 Bump to 3.0.0b1 2022-08-02 15:10:28 +02:00
Simon Li
9318eb3fb2 Merge pull request #3994 from minrk/3.0-changelog
3.0 changelog
2022-08-02 14:05:38 +01:00
Min RK
0590b76cd0 3.0: refresh changelog entries 2022-08-02 14:42:33 +02:00
Min RK
8aac18c96d More documentation for 3.0 role/scope changes
a few more outdated `versionchanged` notes
2022-08-02 14:39:03 +02:00
Erik Sundell
6a6b8567c0 Merge pull request #3909 from minrk/include_stopped_servers
include stopped servers in user model
2022-08-02 14:31:14 +02:00
Min RK
78438bdfcc Begin 3.0 changelog
had to manually remove already-backported PRs
2022-08-02 14:29:16 +02:00
Erik Sundell
2096c956db Merge pull request #3877 from minrk/oauth_config
store scopes on oauth clients, too
2022-08-02 14:12:15 +02:00
Min RK
dfc2d4d4f1 Merge remote-tracking branch 'origin/main' into oauth_config 2022-08-02 13:53:51 +02:00
Min RK
5f57b72d6e fix version change in comment now that it's 3.0 2022-08-02 13:37:33 +02:00
Min RK
6a470b44e7 explicitly support async oauth_client_allowed_scopes 2022-08-02 13:37:32 +02:00
Min RK
a35a2ec8b7 less space
Co-authored-by: Erik Sundell <erik.i.sundell@gmail.com>
2022-08-02 13:34:42 +02:00
Min RK
978b71c8bb Merge pull request #4001 from minrk/info-table-sort
admin: format user/server-info tables
2022-08-02 13:18:06 +02:00
Min RK
f3b328a4d8 format user/server-info tables
- sort keys for consistent presentation
- use text list for roles, groups, which aren't well rendered by the table-formatter (number index isn't helpful)
- render timestamps
- leave empty name for default server, instead of '[MAIN]' which isn't terminology used anywhere else
2022-08-02 12:28:13 +02:00
Min RK
9da78880e6 Merge pull request #4000 from minrk/jsx-deps
[admin] update, clean jsx deps
2022-08-02 12:27:12 +02:00
Vlad Vifor
4d38087fa8 Merge branch 'jupyterhub:main' into group_property_feature 2022-08-02 11:58:16 +02:00
Min RK
f2871cfc3c update to maintained recompose fork 2022-08-02 11:58:01 +02:00
Min RK
24efd12ab5 jsx: move dev dependencies to devDependencies
doesn't really make a difference since it's not a real package, but cleaner.

updates webpack-dev-server
2022-08-02 11:05:42 +02:00
Erik Sundell
9b2e6b1c1d Merge pull request #3992 from minrk/avoid-deprecated-clear-current-singleuser
Avoid IOLoop.current in singleuser mixins
2022-08-02 10:06:43 +02:00
Erik Sundell
9f62d83568 Merge pull request #3998 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-08-02 08:54:33 +02:00
pre-commit-ci[bot]
7eb3575502 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.37.2 → v2.37.3](https://github.com/asottile/pyupgrade/compare/v2.37.2...v2.37.3)
- [github.com/PyCQA/flake8: 4.0.1 → 5.0.2](https://github.com/PyCQA/flake8/compare/4.0.1...5.0.2)
2022-08-01 23:15:08 +00:00
Min RK
6afa0d6311 include stopped servers in user model
opt-in, behind ?include_stopped_servers

Adds `stopped` field to server model to more easily select stopped servers
2022-08-01 15:47:36 +02:00
Erik Sundell
d170601678 Merge pull request #3997 from minrk/inaccurate-cookie
Remove outdated cookie-secret note in security docs
2022-08-01 14:20:20 +02:00
Min RK
01a33d150f Remove outdated cookie-secret note in security docs
this was true when we used shared cookie auth long ago
2022-08-01 13:28:13 +02:00
Simon Li
28b11d2165 Merge pull request #3969 from consideRatio/pr/set-announcement-properly
Fix disabling of individual page template announcements
2022-07-30 17:38:47 +01:00
Erik Sundell
83b5e8f3da Only blank strings to disable a specific page's announcement
Co-authored-by: Min RK <benjaminrk@gmail.com>
2022-07-30 11:53:00 +02:00
Min RK
e4e4bf5ff4 next release is 3.0, not 2.4 2022-07-29 15:35:08 +02:00
Min RK
ab3a01b9f6 even latest jupyter-server requires current event loop
for nbconvert handler lock
2022-07-29 15:31:50 +02:00
Min RK
8548472b6e Avoid IOLoop.current in singleuser mixins
- define our own init_ioloop
- call it ASAP
- put init_httpserver in IOLoop.run_sync because instantiating a server accesses the current loop
- run cleanup via asyncio.run
2022-07-29 14:51:30 +02:00
Erik Sundell
ab776e3989 Merge pull request #3974 from minrk/avoid-deprecated-clear-current
Avoid deprecated 'IOLoop.current' method
2022-07-29 12:03:52 +02:00
Min RK
b0b7378e2b Avoid deprecated 'IOLoop.current' method
Deprecated in tornado 6.2, only access running loop from inside coroutines
2022-07-29 11:30:39 +02:00
Erik Sundell
75e03ef1d9 Merge pull request #3976 from minrk/bump-versions
Require Python 3.7
2022-07-29 10:42:15 +02:00
Min RK
986de0b5db use str-format for ssl.Purposes
rather than default, which is a weird repr
2022-07-29 09:26:21 +02:00
Min RK
6959c9dde3 Merge pull request #3985 from jupyterhub/dependabot/npm_and_yarn/jsx/terser-5.14.2
Bump terser from 5.12.1 to 5.14.2 in /jsx
2022-07-29 08:30:05 +02:00
Min RK
53087e50e4 Merge pull request #3989 from rpwagner/patch-1
bump moment.js 2.29.4
2022-07-29 08:27:46 +02:00
Erik Sundell
dee830a56f Merge pull request #3975 from minrk/dockerfile-base
Bump Dockerfile base image to 22.04
2022-07-27 20:38:42 +02:00
Rick Wagner
45179c53b7 bump moment.js 2.29.4 2022-07-26 10:21:55 -07:00
Erik Sundell
6c7cb65224 Merge pull request #3988 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-07-26 10:30:45 +02:00
pre-commit-ci[bot]
0038b3c2e8 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.37.1 → v2.37.2](https://github.com/asottile/pyupgrade/compare/v2.37.1...v2.37.2)
2022-07-25 22:16:38 +00:00
Erik Sundell
17bb8a9ba4 Unpin Dockerfile's ubuntu base image 2022-07-25 15:27:50 +02:00
Erik Sundell
9756c13f13 Merge pull request #3987 from jupyterhub/dependabot/github_actions/docker/build-push-action-3.1.0
Bump docker/build-push-action from 3.0.0 to 3.1.0
2022-07-25 10:03:26 +02:00
dependabot[bot]
be84b06ca6 Bump docker/build-push-action from 3.0.0 to 3.1.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](e551b19e49...1cb9d22b93)

---
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>
2022-07-25 05:30:44 +00:00
dependabot[bot]
3ee88d99da Bump terser from 5.12.1 to 5.14.2 in /jsx
Bumps [terser](https://github.com/terser/terser) from 5.12.1 to 5.14.2.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-20 22:58:57 +00:00
Erik Sundell
16b0a2ac3b Merge pull request #3978 from minrk/warn-stacklevel
Increase stacklevel for decorated warnings
2022-07-15 08:44:12 +02:00
Min RK
a82d2e4903 Merge pull request #3977 from minrk/unpin-nbclassic
unpin nbclassic
2022-07-14 21:16:54 -07:00
Min RK
cef241a80b test: handle possibility that notebook is unavailable
no longer a strict dependency of other test deps
2022-07-14 21:07:57 -07:00
Min RK
eab6a1a112 typo in jinja env name
use loop variable, not hardcoded string
2022-07-14 20:34:07 -07:00
Min RK
827bfc99ec Merge pull request #3962 from manics/ConfigurableHTTPProxy-log_level
Add ConfigurableHTTPProxy.log_level
2022-07-14 20:22:41 -07:00
Min RK
b5bd307999 urllib.quote doesn't escape ~ starting with Python 3.7
3.7 adds ~ to the 'unreserved' (always safe) set,
but it's not safe in domain names.
so do it ourselves. Formalize in a `_dns_quote` private function,
with notes about issues.

The only usernames that change in this PR are those containing `_` or `/`,
the latter of which would have failed.
2022-07-14 20:19:50 -07:00
Min RK
d02d029e88 adjust Python test order 2022-07-14 16:02:01 -07:00
Min RK
e41885c458 Increase stacklevel for decorated warnings
otherwise warning just shows as being triggered in the decorator function
2022-07-14 16:00:27 -07:00
Simon Li
78ac9946e3 Use CaselessStrEnum instead of Enum 2022-07-14 21:51:14 +01:00
Simon Li
bd8e8eaa09 Add ConfigurableHTTPProxy.log_level 2022-07-14 21:51:12 +01:00
Min RK
a2a01755ec simplify make_ssl_context
pass ssl.Purpose explicitly, deprecate verify/check_hostname

3.10 disallows 'purpose=SERVER_AUTH' from creating server sockets.
Instead:

- pass purpose directly
- always verify
- no need to set check_hostname, already covered by purpose defaults
2022-07-14 11:02:44 -07:00
Min RK
a593c6187f can't test 3.11 yet because greenlet cannot be installed
sqlalchemy requires greenlet on linux, even though we don't use it
2022-07-14 10:10:58 -07:00
Min RK
b159cbfeef unpin nbclassic
0.4.3 is out, see if it fixes things
2022-07-14 09:09:25 -07:00
Min RK
a7cced506b Remove 3.6 compatibility shims
- asyncio.all_tasks/current_task
- pytest-asyncio 0.17
- contextmanager.nullcontext
2022-07-14 09:05:01 -07:00
Min RK
e8469af763 fixup: remove redundant check 2022-07-14 09:05:01 -07:00
Min RK
d2c6b23bf9 update python versions in test matrix 2022-07-14 09:05:01 -07:00
Min RK
c657498d75 require Python 3.7
drops support for Python 3.6
2022-07-14 09:05:01 -07:00
Min RK
001d0c9af1 call legacy notebook matrix entry legacy_notebook
instead of nbclassic, which is explicitly classic nb ui on jupyter-server (the opposite of these tests)
2022-07-14 09:05:01 -07:00
Min RK
0d0368c042 Bump Dockerfile base image to 22.04 2022-07-14 09:03:53 -07:00
Min RK
6fdd0ff7c5 Merge pull request #3967 from minrk/validate-extra-routes
validate proxy.extra_routes
2022-07-14 09:01:12 -07:00
Vlad Vifor
6a8b1be940 Merge branch 'jupyterhub:main' into group_property_feature 2022-07-14 12:23:08 +02:00
Min RK
dee671b640 Merge pull request #3883 from minrk/async-hub-auth
allow HubAuth to be async
2022-07-13 20:38:36 -07:00
Min RK
c289a422c3 validate proxy.extra_routes
- add trailing slash if missing, and warn
- raise if leading slash is wrong (must not be present with host routing, must be present otherwise)
2022-07-13 20:33:39 -07:00
Erik Sundell
fa47529cf1 Merge pull request #3971 from minrk/nbclassic-renamed
nbclassic extension name has been renamed
2022-07-12 08:06:29 +02:00
Erik Sundell
6769de5b01 Merge pull request #3970 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-07-12 08:03:49 +02:00
Min RK
c8a8892292 nbclassic extension name has been renamed
our patches to the jinja env need updating to find the new env
2022-07-11 20:37:29 -07:00
pre-commit-ci[bot]
273b25cb6f [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.34.0 → v2.37.1](https://github.com/asottile/pyupgrade/compare/v2.34.0...v2.37.1)
2022-07-11 21:54:26 +00:00
Erik Sundell
71e06a4cd7 Merge pull request #3958 from minrk/autocomplete-annotation
add correct autocomplete fields for login form
2022-07-10 12:11:04 +02:00
Erik Sundell
827310aca6 Fix disabling of individual page template announcements 2022-07-10 12:05:48 +02:00
Min RK
b9c83cf7ab allow HubAuth to be async
Switches requests to tornado AsyncHTTPClient instead of requests

For backward-compatibility, use opt-in `sync=False` arg for all public methods that _may_ be async

When sync=True (default), async functions still used, but blocking via ThreadPool + asyncio run_until_complete
2022-07-09 16:45:41 -07:00
Min RK
8a44748324 Bump to 2.4.0.dev 2022-07-09 16:44:24 -07:00
Min RK
e4f469ef73 Merge pull request #3968 from minrk/test-nbclassic
pin nbclassic in dev requirements
2022-07-09 16:41:27 -07:00
Min RK
4cf4566fff pin nbclassic < 0.4
0.4 doesn't actually load at all
2022-07-09 10:05:15 -07:00
Min RK
55c866f340 note why we depend on nbclassic
Co-authored-by: Erik Sundell <erik.i.sundell@gmail.com>
2022-07-08 12:15:41 -07:00
Min RK
fd550e223e add nbclassic to dev requirements
ensures `/tree/` handler is present
2022-07-08 10:32:13 -07:00
Min RK
225ace636a call client-allowed scopes JUPYTERHUB_OAUTH_CLIENT_ALLOWED_SCOPES 2022-07-08 10:18:59 -07:00
Erik Sundell
ee4c8b835b Merge pull request #3964 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-07-05 10:56:02 +02:00
pre-commit-ci[bot]
f43ad0c176 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 22.3.0 → 22.6.0](https://github.com/psf/black/compare/22.3.0...22.6.0)
2022-07-04 22:34:28 +00:00
Min RK
95de2618a3 Merge pull request #3960 from cqzlxl/cqzlxl-patch-1
Fix GET /api/proxy with pagination
2022-06-30 21:18:09 +02:00
Min RK
48c9f6ca50 Test proxy API endpoint with pagination 2022-06-30 12:09:20 -07:00
cqzlxl
2d56bb74eb FIX a bug
it's an obvious bug.
2022-06-27 22:42:33 +08:00
Min RK
42cc3cae8e add correct autocomplete fields for login form 2022-06-24 10:37:50 +02:00
Min RK
02da11e06e Merge pull request #3955 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-06-21 09:58:36 +02:00
pre-commit-ci[bot]
eb1061a910 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-prettier: v2.6.2 → v2.7.1](https://github.com/pre-commit/mirrors-prettier/compare/v2.6.2...v2.7.1)
2022-06-20 21:02:45 +00:00
Vlad Vifor
5d9967d3bd Merge branch 'jupyterhub:main' into group_property_feature 2022-06-17 13:59:31 +02:00
Min RK
d852d9e37c Merge pull request #3953 from silenius/freebsd_pw
FreeBSD, missing -n for pw useradd
2022-06-16 11:33:06 +02:00
Julien Cigar
1392aee195 -n is required 2022-06-15 17:23:13 +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
Erik Sundell
63b7defe1a Merge pull request #3950 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-06-14 00:43:29 +02:00
pre-commit-ci[bot]
00803f039a [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.32.1 → v2.34.0](https://github.com/asottile/pyupgrade/compare/v2.32.1...v2.34.0)
- [github.com/pre-commit/pre-commit-hooks: v4.2.0 → v4.3.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.2.0...v4.3.0)
2022-06-13 22:29:26 +00:00
Erik Sundell
2b1c246c13 Merge pull request #3947 from jupyterhub/dependabot/github_actions/char0n/swagger-editor-validate-8829b79e438e100191c1e6ec1519daf0b66fed34
Bump char0n/swagger-editor-validate from 182d1a5d26ff5c2f4f452c43bd55e2c7d8064003 to 1.3.1
2022-06-13 13:48:53 +02:00
Erik Sundell
4f6dd69cb1 Merge pull request #3949 from jupyterhub/dependabot/github_actions/actions/setup-python-4
Bump actions/setup-python from 2 to 4
2022-06-13 13:48:43 +02:00
Erik Sundell
4fde1d2b65 Apply suggestions from code review 2022-06-13 13:48:21 +02:00
Erik Sundell
ccceebe257 Merge pull request #3948 from jupyterhub/dependabot/github_actions/actions/upload-artifact-3
Bump actions/upload-artifact from 2 to 3
2022-06-13 13:47:09 +02:00
Erik Sundell
499dac9ee2 ci: fix typo in test-docs workflow triggers 2022-06-13 13:46:09 +02:00
Erik Sundell
1d26e61f7e Apply suggestions from code review 2022-06-13 13:46:09 +02:00
dependabot[bot]
c40e20a3e3 Bump actions/setup-python from 2 to 4
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 4.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-13 11:38:08 +00:00
dependabot[bot]
549b2b8e95 Bump actions/upload-artifact from 2 to 3
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-13 11:38:04 +00:00
Erik Sundell
15665c0363 Merge pull request #3944 from jupyterhub/dependabot/github_actions/actions/setup-node-3
Bump actions/setup-node from 1 to 3
2022-06-13 13:38:01 +02:00
dependabot[bot]
226f993e7d Bump char0n/swagger-editor-validate
Bumps [char0n/swagger-editor-validate](https://github.com/char0n/swagger-editor-validate) from 182d1a5d26ff5c2f4f452c43bd55e2c7d8064003 to 1.3.1. This release includes the previously tagged commit.
- [Release notes](https://github.com/char0n/swagger-editor-validate/releases)
- [Commits](182d1a5d26...8829b79e43)

---
updated-dependencies:
- dependency-name: char0n/swagger-editor-validate
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-13 11:38:00 +00:00
dependabot[bot]
9081265dab Bump actions/setup-node from 1 to 3
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 1 to 3.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v1...v3)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-13 11:37:44 +00:00
Erik Sundell
de14f18be8 Merge pull request #3946 from consideRatio/pr/weekly-05
ci: run dependabot updates weekly monday 05:00 UTC+0 time
2022-06-13 13:37:39 +02:00
Erik Sundell
da276f0c6b Merge pull request #3945 from jupyterhub/dependabot/github_actions/actions/checkout-3
Bump actions/checkout from 2 to 3
2022-06-13 13:36:59 +02:00
Erik Sundell
5a3c98a849 Merge pull request #3943 from jupyterhub/dependabot/github_actions/docker/setup-qemu-action-2
Bump docker/setup-qemu-action from 1.0.2 to 2
2022-06-13 13:35:53 +02:00
Erik Sundell
51fa0af3fe Merge pull request #3942 from jupyterhub/dependabot/github_actions/docker/setup-buildx-action-2
Bump docker/setup-buildx-action from 1.1.2 to 2
2022-06-13 13:35:37 +02:00
Erik Sundell
fcdce01ae6 Merge pull request #3941 from jupyterhub/dependabot/github_actions/docker/build-push-action-3
Bump docker/build-push-action from 2.4.0 to 3
2022-06-13 13:35:19 +02:00
dependabot[bot]
9af9a7bff7 Bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-13 11:32:36 +00:00
dependabot[bot]
1eef021704 Bump docker/setup-qemu-action from 1.0.2 to 2
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 1.0.2 to 2.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](25f0500ff2...8b122486ce)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-13 11:32:27 +00:00
dependabot[bot]
a308a0c9b4 Bump docker/setup-buildx-action from 1.1.2 to 2
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 1.1.2 to 2.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](2a4b53665e...dc7b9719a9)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-13 11:32:23 +00:00
dependabot[bot]
726b8243eb Bump docker/build-push-action from 2.4.0 to 3
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 2.4.0 to 3.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](e1b7f96249...e551b19e49)

---
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>
2022-06-13 11:32:17 +00:00
Erik Sundell
88cea51561 Run updates weekly monday 05:00 UTC+0 time 2022-06-13 13:32:12 +02:00
Erik Sundell
ec0bcb1f1b Merge pull request #3940 from turrisxyz/Dependabot-GitHub-Actions
chore: add dependabot config for github actions
2022-06-13 13:31:32 +02:00
naveen
2df1808c4e chore: Included githubactions in the dependabot config
This should help with keeping the GitHub actions updated on new releases. This will also help with keeping it secure.

Dependabot helps in keeping the supply chain secure https://docs.github.com/en/code-security/dependabot

GitHub actions up to date https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot

https://github.com/ossf/scorecard/blob/main/docs/checks.md#dependency-update-tool
Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
2022-06-13 01:30:37 +00:00
Erik Sundell
c85e90a71b Merge pull request #3939 from turrisxyz/Pinned-Dependencies-GitHub
chore: Set permissions for GitHub actions
2022-06-12 10:19:14 +02:00
naveen
1013a49db2 chore: Set permissions for GitHub actions
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
2022-06-12 00:30:04 +00:00
Erik Sundell
f6eec29aa2 Merge pull request #3937 from minrk/importlib
switch to importlib_metadata for entrypoints
2022-06-08 15:23:54 +02:00
Min RK
64b99d5587 switch to importlib_metadata for entrypoints
standalone entrypoints package is deprecated
now that similar functionality is in the stdlib

need importlib_metadata >= 3.6 backport on Python < 3.10
2022-06-08 15:14:50 +02:00
Erik Sundell
75b07fc0d6 Merge pull request #3936 from minrk/add-user-validate
admin: Hub is responsible for username validation
2022-06-08 14:55:52 +02:00
Erik Sundell
d64068da66 Merge pull request #3935 from minrk/spawn-page-url
admin: Fix spawn page link for default server
2022-06-08 14:51:26 +02:00
Min RK
62b38934e5 store scopes on oauth clients, too
rather than roles, matching tokens

because oauth clients are mostly involved with issuing tokens,
they don't have roles themselves (their owners do).

This deprecates the `oauth_roles` config on Spawners and Services, in favor of `oauth_allowed_scopes`.

The ambiguously named `oauth_scopes` is renamed to `oauth_access_scopes`.
2022-06-08 12:26:48 +02:00
Min RK
14d8e23135 trim user input forms 2022-06-08 12:09:11 +02:00
Min RK
0908a15848 Server is responsible for username validation
Don't reimplement in the client
2022-06-08 11:06:33 +02:00
Min RK
2e878fb5ca fix spawn page link 2022-06-08 10:48:04 +02:00
Min RK
62d24341ca fix static url in admin page 2022-06-08 10:47:14 +02:00
Yuvi Panda
f2085fdf0f Merge pull request #3931 from consideRatio/pr/add-changelog-to-main
Add changelog for 2.3.0 and 2.3.1
2022-06-06 19:53:56 +05:30
Erik Sundell
a19c211612 Add changelog for 2.3.1 2022-06-06 16:18:03 +02:00
Min RK
9bbcf594ea One more in the changelog 2022-06-06 16:17:55 +02:00
Min RK
da89155503 changelog for 2.3 2022-06-06 16:17:54 +02:00
Min RK
3b59c4861f Merge pull request #3904 from manics/named-servers-escape
Escape named server name
2022-06-03 17:09:58 +02:00
Min RK
6f5764fd3d Merge pull request #3921 from manics/pages-unreachable
pages.py: Remove unreachable code
2022-06-03 16:58:33 +02:00
Simon Li
3c059f3acf Need to escape URLs in spawn-pending too 2022-06-02 19:56:52 +01:00
Simon Li
3a022f1ae3 pages.py: Remove unreachable code 2022-06-02 19:13:25 +01:00
Min RK
049a59f2ed Merge pull request #3920 from jupyterhub/dependabot/npm_and_yarn/jsx/eventsource-1.1.1
Bump eventsource from 1.1.0 to 1.1.1 in /jsx
2022-06-02 09:51:36 +02:00
Min RK
ed9ea4e6cc Merge pull request #3914 from manics/setuppy-yarn-jsx
Build admin app in setup.py
2022-06-02 09:51:22 +02:00
dependabot[bot]
c415be2db3 Bump eventsource from 1.1.0 to 1.1.1 in /jsx
Bumps [eventsource](https://github.com/EventSource/eventsource) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/EventSource/eventsource/releases)
- [Changelog](https://github.com/EventSource/eventsource/blob/master/HISTORY.md)
- [Commits](https://github.com/EventSource/eventsource/compare/v1.1.0...v1.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-01 22:51:13 +00:00
Simon Li
2bc5061e22 Don't escape servername in json blobs 2022-06-01 22:21:00 +01:00
pre-commit-ci[bot]
cedf12baeb [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-06-01 20:28:55 +00:00
Simon Li
b403c41c15 Remove old comment, include description in servername error
Co-authored-by: Min RK <benjaminrk@gmail.com>
2022-06-01 21:28:24 +01:00
Simon Li
acd75d85c7 Move installed data file check to script 2022-06-01 20:44:40 +01:00
Simon Li
5e5dad9512 check sdist files in release workflow 2022-06-01 20:43:28 +01:00
Simon Li
95e343395d Ensure jsx is in sdist 2022-06-01 20:43:02 +01:00
Yuvi Panda
6a29e5193b Merge pull request #3919 from minrk/jupyter-server-templates
ensure custom template is loaded with jupyter-server notebook extension
2022-06-01 22:59:33 +05:30
Min RK
1cb7177597 ensure custom template is loaded with jupyter-server notebook extension
our patches to page.html didn't affect nbclassic,
which gets its own jinja environment

regression test included
2022-06-01 16:13:10 +02:00
Yuvi Panda
50e863ca52 Merge pull request #3910 from minrk/optimize-prefix-lookup
use equality to filter token prefixes
2022-06-01 19:05:45 +05:30
Yuvi Panda
8cdd7ca2d2 Merge pull request #3918 from minrk/default-url-priority
set default_url via config
2022-06-01 19:04:55 +05:30
Min RK
6fbf8411ec Merge pull request #3915 from manics/contrib-docs
Update Contributing documentation
2022-05-31 19:52:30 +02:00
Min RK
fa200fed98 set default_url via config
avoids accidental overrides of `@default('default_url')` in subclasses,
e.g. SingleUserLabApp
2022-05-31 17:05:58 +02:00
Simon Li
7d7d30bcae Don't build admin app on readthedocs 2022-05-29 19:23:57 +01:00
Simon Li
85a4bbc28e Update Contributing documentation
Adds yarn, moves most of CONTRIBUTING.md into https://jupyterhub.readthedocs.io/en/stable/contributing/index.html to reduce duplication
2022-05-29 19:11:57 +01:00
Simon Li
0b161627c2 yarn: allow jlpm to be used instead 2022-05-29 17:14:14 +01:00
Simon Li
36e7898ed4 Update CI so that setup.py can build admin app 2022-05-29 16:52:24 +01:00
Simon Li
3537722208 Include generated admin-react.js.LICENSE.txt 2022-05-29 16:52:24 +01:00
Simon Li
dfcaa29c8a Build react admin app in setup.py 2022-05-29 16:52:20 +01:00
Simon Li
92c6d69bc8 Remove share/jupyterhub/static/js/admin-react.js jsx/build 2022-05-29 16:12:29 +01:00
Simon Li
7b8a2ae57b Escape server-name in URLs returned by API 2022-05-27 23:06:55 +01:00
Simon Li
b444fe478c Ensure server-name is escaped in proxy add_route 2022-05-27 22:44:09 +01:00
Simon Li
50fb1a016c Move server-name / check to higher up, add test 2022-05-27 22:06:19 +01:00
Min RK
e229c63e11 use equality to filter token prefixes
otherwise, index isn't used

note: this means changing the token prefix size requires revoking all tokens,
where before only _increasing_ the token prefix size required doing that.
2022-05-25 15:54:34 +02:00
Erik Sundell
9649a57e34 Merge pull request #3908 from minrk/fail-fail-auth-state
allow auth_state_hook to halt spawn
2022-05-25 12:43:39 +02:00
Erik Sundell
ac85d63013 Merge pull request #3907 from minrk/bump-moment
bump moment.js 2.29.2
2022-05-25 12:39:34 +02:00
Min RK
4b2ba1f6c0 allow auth_state_hook to halt spawn
hooks prior to start should raise and stop the whole thing

only hooks during cleanup need to be passed over
2022-05-25 11:36:32 +02:00
Min RK
886d15b622 bump moment.js 2.29.2 2022-05-25 11:32:06 +02:00
Min RK
d517ce37e7 Merge pull request #3906 from fabianbaier/patch-1
Force add existing certificates
2022-05-25 11:23:58 +02:00
Min RK
85f0cec33e Merge pull request #3903 from manics/jupyter-troubleshoot
`jupyter troubleshooting` ➡️  `jupyter troubleshoot`
2022-05-25 11:18:35 +02:00
pre-commit-ci[bot]
5c37569b2a [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-05-25 05:04:07 +00:00
Fabian Baier
956b96967e Update app.py to fix certipy.CertExistsError 2022-05-24 21:58:33 -07:00
Simon Li
f51faa25ed Ban / from server-name 2022-05-24 17:46:08 +01:00
Simon Li
aa8c85f404 Test explicitly escaped servername from client 2022-05-24 17:08:21 +01:00
Simon Li
98540f0f6d Need to escape server name in part of proxy 2022-05-24 16:56:15 +01:00
Simon Li
841c89769a Add test for special chars in named servers 2022-05-24 16:55:48 +01:00
Simon Li
84cb9761e8 Escape named servers when used in URL paths 2022-05-22 23:31:47 +01:00
Simon Li
178e340223 jupyter troubleshooting ➡️ jupyter troubleshoot 2022-05-22 15:18:42 +01:00
Min RK
b18a05c2c8 Merge pull request #3895 from yuvipanda/document-display
Document the 'display' attribute of services
2022-05-13 11:56:58 +02:00
Min RK
3466de1473 Merge pull request #3899 from manics/admin_access_deprecated
`admin_access` no longer works as it is overridden by RBAC scopes
2022-05-13 11:53:58 +02:00
Simon Li
4be4e41fa7 admin_access no longer works as it is overridden by RBAC scopes
The `admin_access` variable is still referenced elsewhere and I considered removing it, but I couldn't work out exactly how/if it's used so this is just a docs change for now.
2022-05-12 12:31:50 +01:00
YuviPanda
3264463366 Document the 'display' attribute of services
Ref https://github.com/2i2c-org/infrastructure/issues/1301
2022-05-11 19:04:58 +05:30
Simon Li
8252504dad Merge pull request #3885 from minrk/deprecate-db
Deprecate Authenticator.db, Spawner.db
2022-05-10 17:48:20 +01:00
Min RK
ac3ef1efc1 Deprecate Authenticator.db, Spawner.db
These objects should not access the shared db session;
add a warning pointing to Issue about their removal if it is accessed
2022-05-10 10:24:32 +02:00
Min RK
54cb259882 Merge pull request #3891 from bbrauns/main
remove apache NE flag as it prevents opening folders and renaming fil…
2022-05-10 10:22:01 +02:00
Min RK
04d0291fa0 Merge pull request #3889 from johnkpark/jp--remove-admin-table-head
admin: make user-info table selectable
2022-05-10 10:21:06 +02:00
Erik Sundell
c8d6700406 Merge pull request #3892 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-05-10 07:01:25 +02:00
pre-commit-ci[bot]
e61f2d74a8 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.32.0 → v2.32.1](https://github.com/asottile/pyupgrade/compare/v2.32.0...v2.32.1)
2022-05-09 20:54:37 +00:00
Björn Braunschweig
a0b9a1fe86 remove apache NE flag as it prevents opening folders and renaming files with whitespace characters. apache returns Bad Request 2022-05-09 11:36:14 +02:00
John Park
27d2e95c43 add regeneratorRuntime back in 2022-05-06 14:03:05 -07:00
John Park
819e59292d yarn lint / place 2022-05-05 16:34:28 -07:00
John Park
f3ef16b948 remove admin-table-head class 2022-05-05 16:21:29 -07:00
Simon Li
5e1e44057d Merge pull request #3886 from minrk/cleanup-api-shutdown
Cleanup everything on API shutdown
2022-05-05 20:16:43 +01:00
Min RK
bf2e322c22 Cleanup everything on API shutdown
via app.stop()
2022-05-05 12:53:21 +02:00
Min RK
585b47051f Merge pull request #3882 from yuvipanda/mo-exceptions
Use log.exception when logging exceptions
2022-05-05 11:37:42 +02:00
Min RK
5ca96fa758 Merge pull request #3878 from minrk/admin-ui-scope
add 'admin-ui' scope for access to the admin ui
2022-05-03 11:20:23 +02:00
YuviPanda
aba6eb962f Use log.exception when logging exceptions
This provides the stack trace in the log file, incredibly
useful when debugging
2022-05-02 17:36:31 -07:00
Georgiana Elena
107dc02fd0 Merge pull request #3876 from minrk/disallow-next-check
don't confuse :// in next_url query params for a redirect hostname
2022-04-29 13:13:21 +03:00
Min RK
debac715bf add 'admin-ui' scope for access to the admin ui 2022-04-29 11:54:02 +02:00
Min RK
c6ed41e322 don't confuse :// in next_url query params for a redirect hostname 2022-04-28 13:35:37 +02:00
Min RK
ec2c90c73f Merge pull request #3874 from code-review-doctor/fix-probably-meant-fstring
Missing `f` prefix on f-strings fix
2022-04-26 15:15:55 +02:00
Min RK
6c2c5e5a90 Don't let spawner._log_name fail when running without user in tests 2022-04-26 14:27:39 +02:00
code-review-doctor
f0b2d8c4eb Fix issue probably-meant-fstring found at https://codereview.doctor 2022-04-24 17:30:49 +01:00
Min RK
a588a0bfa3 Merge pull request #3851 from minrk/service-filter
!service and !server filters
2022-04-21 12:32:31 +02:00
Simon Li
c07358a526 Merge pull request #3869 from jupyterhub/dependabot/npm_and_yarn/jsx/async-2.6.4
Bump async from 2.6.3 to 2.6.4 in /jsx
2022-04-15 21:06:19 +01:00
dependabot[bot]
9058fa42dd Bump async from 2.6.3 to 2.6.4 in /jsx
Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md)
- [Commits](https://github.com/caolan/async/compare/v2.6.3...v2.6.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-15 19:08:43 +00:00
Min RK
55d7ebe006 Merge pull request #3867 from consideRatio/pr/black-detail
ci: update black configuration
2022-04-15 21:08:07 +02:00
Erik Sundell
6edbfdad89 ci: update black configuration 2022-04-15 19:16:51 +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
Erik Sundell
715a4a25cf Merge pull request #3864 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-04-12 11:04:12 +01:00
pre-commit-ci[bot]
e15447c8b8 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.31.1 → v2.32.0](https://github.com/asottile/pyupgrade/compare/v2.31.1...v2.32.0)
- [github.com/pre-commit/pre-commit-hooks: v4.1.0 → v4.2.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.1.0...v4.2.0)
2022-04-11 21:25:48 +00:00
Min RK
ab8eec164c Merge pull request #3863 from NarekA/narek/fix-search-bar
[Bug Fix] Search bar disabled on admin dashboard
2022-04-11 11:15:05 +02:00
Narek Amirbekian
b1177cd2ce Improve user search tests 2022-04-08 12:23:27 -07:00
Narek Amirbekian
40d95dc142 Fix search bar in admin dashboard 2022-04-08 11:27:41 -07:00
Min RK
d78bd42cfc call owner_name user_name since it's only defined when the owner is a user 2022-04-08 20:17:12 +02:00
Min RK
b6210dc225 add !service and !server scope filters
allows oauth clients to issue scopes that only grant access to the issuing service

e.g. access:service!service or access:servers!server

especially useful with custom scopes
2022-04-08 20:10:23 +02:00
Erik Sundell
b05a89a3e0 Merge pull request #3862 from cmd-ntrf/readme-rest-api
Fix typo in [rest api] link in README.md
2022-04-08 17:21:31 +02:00
Félix-Antoine Fortin
13e99b904b Fix typo in [rest api] link 2022-04-08 09:56:18 -04:00
Simon Li
01a4b9c4b4 Merge pull request #3859 from minrk/get_env_modify
Do not store Spawner.ip/port on spawner.server during get_env
2022-04-07 22:03:14 +01:00
Min RK
d6df1be272 Merge pull request #3850 from minrk/cache-scopes
memoize some scope functions
2022-04-07 12:56:19 +02:00
Min RK
85ef5cf807 Do not store Spawner.ip/port on spawner.server
This was part of an attempt to get the url from self.server.bind_url that didn't end up getting used

shouldn't mutate db state when getting the environment
2022-04-07 10:56:49 +02:00
Min RK
ff020cb5a4 needs_db typo
Co-authored-by: Simon Li <orpheus+devel@gmail.com>
2022-04-07 09:42:25 +02:00
Min RK
5c54ac9aa1 Merge pull request #3853 from jwclark/patch-1
Fix xsrf_cookie_kwargs ValueError
2022-04-05 20:28:03 +02:00
Erik Sundell
e48662423a Merge pull request #3856 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-04-05 01:00:08 +02:00
pre-commit-ci[bot]
f124f06c2d [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 22.1.0 → 22.3.0](https://github.com/psf/black/compare/22.1.0...22.3.0)
- [github.com/pre-commit/mirrors-prettier: v2.6.1 → v2.6.2](https://github.com/pre-commit/mirrors-prettier/compare/v2.6.1...v2.6.2)
2022-04-04 20:23:56 +00:00
Joseph Clark
f2faf0ee43 Fix ValueError
Fixes ValueError: too many values to unpack (expected 2)
2022-04-01 15:44:28 -06:00
Min RK
ab2913008e more docs, comments, asserts about immutable scope functions 2022-04-01 11:54:32 +02:00
Min RK
eebc0f485d Apply suggestions from code review
Co-authored-by: Simon Li <orpheus+devel@gmail.com>
2022-04-01 11:36:06 +02:00
Min RK
bb6427ea9b Add FrozenDict for caching parsed_scopes dicts
Since we need them to be immutable
2022-04-01 11:36:05 +02:00
Min RK
29b73563dc cache common scope operations
we expand/parse the same scopes _a lot_.
We can save time with some caching.

Main change: cached functions must return immutable frozenset instead of mutable set,
to avoid mutating the result of subsequent returns.

Some functions can only be cached _sometimes_ (e.g. group lookups in db cannot be cached),
for which we have a DoNotCache(result) exception
2022-04-01 11:35:05 +02:00
Erik Sundell
aa0ce1c88a Merge pull request #3852 from minrk/isort
Use isort for import formatting
2022-04-01 11:07:28 +02:00
Min RK
7a9778249f run pre-commit with isort 2022-03-31 12:33:26 +02:00
Min RK
c41b732fbd switch to isort for import formatting
isort produces nicer imports without wasting a huge amount of space
2022-03-31 12:32:11 +02:00
Vlad Vifor
6ede428990 Merge branch 'jupyterhub:main' into group_property_feature 2022-03-30 11:25:53 +02:00
Erik Sundell
d9b85a819e Merge pull request #3849 from huage1994/patch-1
The word `used` is duplicated in upgrade.md
2022-03-30 08:26:08 +02:00
nihua
6d00eb501a Update upgrade.md 2022-03-30 14:20:30 +08:00
Erik Sundell
318c95342d Merge pull request #3833 from minrk/token-scopes
Tokens have scopes instead of roles
2022-03-29 23:49:35 +02:00
Erik Sundell
cde0f12f07 Merge pull request #3848 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-03-28 22:41:22 +02:00
pre-commit-ci[bot]
6668fb39f9 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-prettier: v2.6.0 → v2.6.1](https://github.com/pre-commit/mirrors-prettier/compare/v2.6.0...v2.6.1)
2022-03-28 19:36:33 +00:00
Min RK
4691fae90a Merge pull request #3845 from jupyterhub/dependabot/npm_and_yarn/jsx/minimist-1.2.6
Bump minimist from 1.2.5 to 1.2.6 in /jsx
2022-03-28 09:03:51 +02:00
Min RK
0fccbc69ff Merge pull request #3834 from NarekA/narek/server-details-in-dashboard
Admin Dashboard - Collapsible Details View
2022-03-28 09:03:26 +02:00
dependabot[bot]
d699f794ac Bump minimist from 1.2.5 to 1.2.6 in /jsx
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-26 13:42:02 +00:00
Min RK
29a9ca18fe Merge pull request #3841 from minrk/asyncio-mode
adopt pytest-asyncio asyncio_mode='auto'
2022-03-26 14:41:29 +01:00
Erik Sundell
72ae21d6dc Merge pull request #3843 from minrk/doc-typos
Some typos in docs
2022-03-24 16:25:47 +01:00
Min RK
310d9621e5 limit server->read:users:name filter to read: scopes
it shouldn't be included in _access_ scopes, for instance
2022-03-24 16:13:57 +01:00
Min RK
0f4258d00c update more test expectations 2022-03-24 15:47:02 +01:00
Min RK
78b5aa150c avoid always-adding identify scope to everything
add it to token permissions _before_ intersecting with owner
2022-03-24 15:36:56 +01:00
Min RK
3cfb14b9e5 rerender rest-api 2022-03-24 15:16:21 +01:00
Min RK
7e22614a4e [squash me] token progress
tokens have scopes

    instead of roles, which allow tokens to change permissions over time

    This is mostly a low-level change,
    with little outward-facing effects.

    - on upgrade, evaluate all token role assignments to their current scopes,
      and store those scopes on the tokens
    - assigning roles to tokens still works, but scopes are evaluated and validated immediately,
      rather than lazily stored as roles
    - no longer need to check for role permission changes on startup, because token permissions aren't affected
    - move a few scope utilities from roles to scopes
    - oauth allows specifying scopes, not just roles.
      But these are still at the level specified in roles,
      not fully-resolved scopes.
    - more granular APIs for working with scopes and roles

    Still to do later:

    - expose scopes config for Spawner/service
    - compute 'full' intersection of requested scopes, rather than on the 'raw' scope list in roles
2022-03-24 15:05:50 +01:00
Min RK
66ecaf472a fix some outdated references to 'all' metascope
it is called 'inherit', but not all docs were updated
2022-03-24 14:06:05 +01:00
Min RK
3ba262f6f6 fix heading level in changelog
sphinx has started to error with this
2022-03-24 14:06:04 +01: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
Min RK
b935190da8 adopt pytest-asyncio asyncio_mode
removes need for our own implementation of the same behavior

but keep it around while we still support Python 3.6,
since the version (0.17) introducing asyncio_mode drops support for Python 3.6
2022-03-23 09:25:22 +01:00
Erik Sundell
7cd5c1c12b Merge pull request #3840 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-03-22 06:35:53 +01:00
pre-commit-ci[bot]
4708fce4f8 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-prettier: v2.5.1 → v2.6.0](https://github.com/pre-commit/mirrors-prettier/compare/v2.5.1...v2.6.0)
2022-03-21 23:39:32 +00:00
Narek Amirbekian
93fda7c96b Change layout 2022-03-21 13:05:56 -07:00
Erik Sundell
912e0ad53f Merge pull request #3839 from yuvipanda/log-docs-1
Document version mismatch log message
2022-03-21 11:40:49 +01:00
YuviPanda
3e9ce8bc03 Document version mismatch log message 2022-03-19 14:10:24 -07:00
Min RK
a08aa3398c ensure literal_binds is set in order
Co-authored-by: Erik Sundell <erik.i.sundell@gmail.com>
2022-03-18 15:25:46 +01:00
Min RK
3076845927 tokens have scopes
instead of roles, which allow tokens to change permissions over time

This is mostly a low-level change,
with little outward-facing effects.

- on upgrade, evaluate all token role assignments to their current scopes,
  and store those scopes on the tokens
- assigning roles to tokens still works, but scopes are evaluated and validated immediately,
  rather than lazily stored as roles
- no longer need to check for role permission changes on startup, because token permissions aren't affected
- move a few scope utilities from roles to scopes
- oauth allows specifying scopes, not just roles.
  But these are still at the level specified in roles,
  not fully-resolved scopes.
- more granular APIs for working with scopes and roles
2022-03-18 14:13:16 +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
Erik Sundell
cb25d29b0b Merge pull request #3837 from minrk/fix-import-error
ensure _import_error is set when JUPYTERHUB_SINGLEUSER_APP is unavailable
2022-03-18 10:03:18 +01:00
Min RK
2e8d303ad8 ensure _import_error is set when JUPYTERHUB_SINGLEUSER_APP is unavailable 2022-03-18 09:24:22 +01:00
Erik Sundell
a754d56433 Merge pull request #3835 from minrk/rm-distutils
remove lingering reference to distutils
2022-03-17 13:28:43 +01:00
Min RK
775a16dc50 remove lingering reference to distutils 2022-03-17 12:16:44 +01:00
Narek Amirbekian
16824dcadb Use .toHaveClass instead of .contains 2022-03-16 16:42:17 -07:00
Narek Amirbekian
f949cda227 Add test for details view 2022-03-16 16:36:34 -07:00
Erik Sundell
454e356e4d Merge pull request #3713 from minrk/custom-scopes
allow user-defined custom scopes
2022-03-16 08:52:55 +01:00
Min RK
9a87b59e84 improve custom scope docstrings 2022-03-16 08:44:52 +01:00
Narek Amirbekian
93d82a9012 Fix tests 2022-03-15 17:09:26 -07:00
Narek Amirbekian
564458b106 Set defaults for name_filter 2022-03-15 15:13:04 -07:00
Narek Amirbekian
b38e9c45bf Improved layout 2022-03-15 13:40:44 -07:00
Narek Amirbekian
85d4c5bd7a Remove unused state object 2022-03-15 12:14:38 -07:00
Narek Amirbekian
6a9d27ceb4 Server details in server dashboard 2022-03-15 12:01:22 -07:00
Min RK
d2eaf90df2 authorize subsets of roles
- oauth clients can request a list of roles
- authorization will proceed with the _subset_ of those roles held by the user
- in the future, this subsetting will be refined to the scope level
2022-03-15 11:54:42 +01:00
Min RK
fdf23600c0 allow custom scopes
defined with

    c.JupyterHub.custom_scopes = {
        'custom:scope': {'description': "text shown on oauth confirm"}
    }

Allows injecting custom scopes to roles,
allowing extension of granular permissions to service-defined custom scopes.

Custom scopes:

- MUST start with `custom:`
- MUST only contain ascii lowercase, numbers, colon, hyphen, asterisk, underscore
- MUST define a `description`
- MAY also define `subscopes` list(s), each of which must also be explicitly defined

HubAuth can be used to retrieve and check for custom scopes to authorize requests.
2022-03-11 11:37:26 +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
Eric Dill
e243812745 Some suggestions from reading through the docs
Thanks to @willingc, @minrk and @manics for the review so far.
This commit is the PR so far rebased onto master and squashed.
2019-07-17 11:51:20 -04:00
311 changed files with 23157 additions and 14703 deletions

View File

@@ -3,14 +3,9 @@
# E: style errors
# W: style warnings
# C: complexity
# F401: module imported but unused
# F403: import *
# F811: redefinition of unused `name` from line `N`
# D: docstring warnings (unused pydocstyle extension)
# F841: local variable assigned but never used
# E402: module level import not at top of file
# I100: Import statements are in the wrong order
# I101: Imported names are in the wrong order. Should be
ignore = E, C, W, F401, F403, F811, F841, E402, I100, I101, D400
ignore = E, C, W, D, F841
builtins = c, get_config
exclude =
.cache,

16
.github/dependabot.yaml vendored Normal file
View File

@@ -0,0 +1,16 @@
# 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
# https://github.com/jupyterhub/jupyterhub/network/updates.
#
version: 2
updates:
# Maintain dependencies in our GitHub Workflows
- package-ecosystem: github-actions
directory: /
labels: [ci]
schedule:
interval: monthly
time: "05:00"
timezone: Etc/UTC

View File

@@ -32,17 +32,18 @@ jobs:
build-release:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: "3.9"
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: "14"
- name: install build package
- name: install build requirements
run: |
npm install -g yarn
pip install --upgrade pip
pip install build
pip freeze
@@ -52,28 +53,21 @@ jobs:
python -m build --sdist --wheel .
ls -l dist
- name: verify wheel
- name: verify sdist
run: |
cd dist
pip install ./*.whl
# verify data-files are installed where they are found
cat <<EOF | python
import os
from jupyterhub._data import DATA_FILES_PATH
print(f"DATA_FILES_PATH={DATA_FILES_PATH}")
assert os.path.exists(DATA_FILES_PATH), DATA_FILES_PATH
for subpath in (
"templates/page.html",
"static/css/style.min.css",
"static/components/jquery/dist/jquery.js",
):
path = os.path.join(DATA_FILES_PATH, subpath)
assert os.path.exists(path), path
print("OK")
EOF
./ci/check_sdist.py dist/jupyterhub-*.tar.gz
- name: verify data-files are installed where they are found
run: |
pip install dist/*.whl
./ci/check_installed_data.py
- name: verify sdist can be installed without npm/yarn
run: |
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@v2
- uses: actions/upload-artifact@v3
with:
name: jupyterhub-${{ github.sha }}
path: "dist/*"
@@ -90,6 +84,7 @@ jobs:
publish-docker:
runs-on: ubuntu-20.04
timeout-minutes: 20
services:
# So that we can test this in PRs/branches
@@ -108,16 +103,16 @@ jobs:
echo "REGISTRY=localhost:5000/" >> $GITHUB_ENV
fi
- uses: actions/checkout@v2
- uses: actions/checkout@v3
# 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@25f0500ff22e406f7191a2a8ba8cda16901ca018 # associated tag: v1.0.2
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx (for multi-arch builds)
uses: docker/setup-buildx-action@2a4b53665e15ce7d7049afb11ff1f70ff1610609 # associated tag: v1.1.2
uses: docker/setup-buildx-action@v2
with:
# Allows pushing to registry on localhost:5000
driver-opts: network=host
@@ -155,7 +150,7 @@ jobs:
branchRegex: ^\w[\w-.]*$
- name: Build and push jupyterhub
uses: docker/build-push-action@e1b7f96249f2e4c8e4ac1519b9608c0d48944a1f
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
platforms: linux/amd64,linux/arm64
@@ -176,7 +171,7 @@ jobs:
branchRegex: ^\w[\w-.]*$
- name: Build and push jupyterhub-onbuild
uses: docker/build-push-action@e1b7f96249f2e4c8e4ac1519b9608c0d48944a1f
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
build-args: |
BASE_IMAGE=${{ fromJson(steps.jupyterhubtags.outputs.tags)[0] }}
@@ -197,7 +192,7 @@ jobs:
branchRegex: ^\w[\w-.]*$
- name: Build and push jupyterhub-demo
uses: docker/build-push-action@e1b7f96249f2e4c8e4ac1519b9608c0d48944a1f
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
build-args: |
BASE_IMAGE=${{ fromJson(steps.onbuildtags.outputs.tags)[0] }}
@@ -221,7 +216,7 @@ jobs:
branchRegex: ^\w[\w-.]*$
- name: Build and push jupyterhub/singleuser
uses: docker/build-push-action@e1b7f96249f2e4c8e4ac1519b9608c0d48944a1f
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
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

@@ -15,15 +15,13 @@ on:
- "docs/**"
- "jupyterhub/_version.py"
- "jupyterhub/scopes.py"
- ".github/workflows/*"
- "!.github/workflows/test-docs.yml"
- ".github/workflows/test-docs.yml"
push:
paths:
- "docs/**"
- "jupyterhub/_version.py"
- "jupyterhub/scopes.py"
- ".github/workflows/*"
- "!.github/workflows/test-docs.yml"
- ".github/workflows/test-docs.yml"
branches-ignore:
- "dependabot/**"
- "pre-commit-ci-update-config"
@@ -40,25 +38,70 @@ jobs:
validate-rest-api-definition:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Validate REST API definition
uses: char0n/swagger-editor-validate@182d1a5d26ff5c2f4f452c43bd55e2c7d8064003
uses: char0n/swagger-editor-validate@v1.3.2
with:
definition-file: docs/source/_static/rest-api.yml
test-docs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- 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"
- name: Install requirements
run: |
pip install -r docs/requirements.txt pytest -e .
pip install -r docs/requirements.txt pytest
- 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

@@ -19,6 +19,9 @@ on:
- "**"
workflow_dispatch:
permissions:
contents: read
jobs:
# The ./jsx folder contains React based source code files that are to compile
# to share/jupyterhub/static/js/admin-react.js. The ./jsx folder includes
@@ -29,8 +32,8 @@ jobs:
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "14"
@@ -47,62 +50,3 @@ jobs:
run: |
cd jsx
yarn test
# The ./jsx folder contains React based source files that are to compile to
# share/jupyterhub/static/js/admin-react.js. This job makes sure that whatever
# we have in jsx/src matches the compiled asset that we package and
# distribute.
#
# This job's purpose is to make sure we don't forget to compile changes and to
# verify nobody sneaks in a change in the hard to review compiled asset.
#
# NOTE: In the future we may want to stop version controlling the compiled
# artifact and instead generate it whenever we package JupyterHub. If we
# do this, we are required to setup node and compile the source code
# more often, at the same time we could avoid having this check be made.
#
compile-jsx-admin-react:
runs-on: ubuntu-20.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "14"
- name: Install yarn
run: |
npm install -g yarn
- name: yarn
run: |
cd jsx
yarn
- name: yarn build
run: |
cd jsx
yarn build
- name: yarn place
run: |
cd jsx
yarn place
- name: Verify compiled jsx/src matches version controlled artifact
run: |
if [[ `git status --porcelain=v1` ]]; then
echo "The source code in ./jsx compiles to something different than found in ./share/jupyterhub/static/js/admin-react.js!"
echo
echo "Please re-compile the source code in ./jsx with the following commands:"
echo
echo "yarn"
echo "yarn build"
echo "yarn place"
echo
echo "See ./jsx/README.md for more details."
exit 1
else
echo "Compilation of jsx/src to share/jupyterhub/static/js/admin-react.js didn't lead to changes."
fi

View File

@@ -28,7 +28,10 @@ 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
jobs:
# Run "pytest jupyterhub/tests" in various configurations
@@ -53,9 +56,9 @@ jobs:
# Tests everything when JupyterHub works against a dedicated mysql or
# postgresql server.
#
# nbclassic:
# legacy_notebook:
# Tests everything when the user instances are started with
# notebook instead of jupyter_server.
# the legacy notebook server instead of jupyter_server.
#
# ssl:
# Tests everything using internal SSL connections instead of
@@ -68,21 +71,36 @@ jobs:
# NOTE: Since only the value of these parameters are presented in the
# GitHub UI when the workflow run, we avoid using true/false as
# values by instead duplicating the name to signal true.
# Python versions available at:
# https://github.com/actions/python-versions/blob/HEAD/versions-manifest.json
include:
- python: "3.6"
- python: "3.7"
oldest_dependencies: oldest_dependencies
nbclassic: nbclassic
- python: "3.6"
subdomain: subdomain
- python: "3.7"
db: mysql
- python: "3.7"
ssl: ssl
legacy_notebook: legacy_notebook
- python: "3.8"
db: postgres
- python: "3.8"
nbclassic: nbclassic
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"
subdomain: subdomain
noextension: noextension
subset: singleuser
- python: "3.11"
ssl: ssl
noextension: noextension
subset: singleuser
- python: "3.11"
browser: browser
- python: "3.11"
main_dependencies: main_dependencies
steps:
@@ -96,7 +114,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
@@ -107,32 +125,35 @@ 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@v2
# NOTE: actions/setup-node@v1 make use of a cache within the GitHub base
- uses: actions/checkout@v3
# NOTE: actions/setup-node@v3 make use of a cache within the GitHub base
# environment and setup in a fraction of a second.
- name: Install Node v14
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: "14"
- name: Install Node dependencies
- name: Install Javascript dependencies
run: |
npm install
npm install -g configurable-http-proxy
npm install -g configurable-http-proxy yarn
npm list
# NOTE: actions/setup-python@v2 make use of a cache within the GitHub base
# NOTE: actions/setup-python@v4 make use of a cache within the GitHub base
# environment and setup in a fraction of a second.
- name: Install Python ${{ matrix.python }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
python-version: "${{ matrix.python }}"
- name: Install Python dependencies
run: |
pip install --upgrade pip
pip install --upgrade . -r dev-requirements.txt
pip install -e ".[test]"
if [ "${{ matrix.oldest_dependencies }}" != "" ]; then
# take any dependencies in requirements.txt such as tornado>=5.0
@@ -143,18 +164,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.nbclassic }}" != "" ]; then
if [ "${{ matrix.legacy_notebook }}" != "" ]; then
pip uninstall jupyter_server --yes
pip install notebook
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
@@ -199,25 +229,31 @@ jobs:
DB=postgres bash ci/init-db.sh
fi
- name: Configure browser tests
if: matrix.browser
run: echo "PYTEST_ADDOPTS=$PYTEST_ADDOPTS -m browser" >> "${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
- name: Submit codecov report
run: |
codecov
pytest -k "${{ matrix.subset }}" --maxfail=2 --cov=jupyterhub jupyterhub/tests
- uses: codecov/codecov-action@v3
docker-build:
runs-on: ubuntu-20.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- 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

5
.gitignore vendored
View File

@@ -9,16 +9,21 @@ 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
# but not sub-dirs
/jupyterhub_config.py
jupyterhub_cookie_secret
jupyterhub.sqlite
jupyterhub.sqlite*
package-lock.json
share/jupyterhub/static/components
share/jupyterhub/static/css/style.min.css
share/jupyterhub/static/css/style.min.css.map
share/jupyterhub/static/js/admin-react.js*
*.egg-info
MANIFEST
.coverage

View File

@@ -8,37 +8,50 @@
# - 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: v2.31.1
rev: v3.4.0
hooks:
- id: pyupgrade
args:
- --py36-plus
- --py37-plus
# Autoformat: Python code
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.0.1
- repo: https://github.com/PyCQA/autoflake
rev: v2.1.1
hooks:
- id: reorder-python-imports
- id: autoflake
# args ref: https://github.com/PyCQA/autoflake#advanced-usage
args:
- --in-place
# Autoformat: Python code
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
# Autoformat: Python code
- repo: https://github.com/psf/black
rev: 22.1.0
rev: 23.3.0
hooks:
- id: black
args: [--target-version=py36]
# Autoformat: markdown, yaml, javascript (see the file .prettierignore)
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.5.1
rev: v3.0.0-alpha.9-for-vscode
hooks:
- id: prettier
# Autoformat and linting, misc. details
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.4.0
hooks:
- id: end-of-file-fixer
exclude: share/jupyterhub/static/js/admin-react.js
@@ -48,6 +61,6 @@ repos:
# Linting: Python code (see the file .flake8)
- repo: https://github.com/PyCQA/flake8
rev: "4.0.1"
rev: "6.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

@@ -1,3 +1,7 @@
# Configuration on how ReadTheDocs (RTD) builds our documentation
# ref: https://readthedocs.org/projects/jupyterhub/
# ref: https://docs.readthedocs.io/en/stable/config-file/v2.html
#
version: 2
sphinx:
@@ -11,10 +15,11 @@ build:
python:
install:
- method: pip
path: .
- requirements: docs/requirements.txt
formats:
# Adding htmlzip enables a Downloads section in the rendered website's RTD
# menu where the html build can be downloaded. This doesn't require any
# additional configuration in docs/source/conf.py.
#
- htmlzip
- epub

View File

@@ -6,134 +6,9 @@ you can follow the [Jupyter contributor guide](https://jupyter.readthedocs.io/en
Make sure to also follow [Project Jupyter's Code of Conduct](https://github.com/jupyter/governance/blob/HEAD/conduct/code_of_conduct.md)
for a friendly and welcoming collaborative environment.
## Setting up a development environment
Please see our documentation on
<!--
https://jupyterhub.readthedocs.io/en/stable/contributing/setup.html
contains a lot of the same information. Should we merge the docs and
just have this page link to that one?
-->
- [Setting up a development install](https://jupyterhub.readthedocs.io/en/latest/contributing/setup.html)
- [Testing JupyterHub and linting code](https://jupyterhub.readthedocs.io/en/latest/contributing/tests.html)
JupyterHub requires Python >= 3.5 and nodejs.
As a Python project, a development install of JupyterHub follows standard practices for the basics (steps 1-2).
1. clone the repo
```bash
git clone https://github.com/jupyterhub/jupyterhub
```
2. do a development install with pip
```bash
cd jupyterhub
python3 -m pip install --editable .
```
3. install the development requirements,
which include things like testing tools
```bash
python3 -m pip install -r dev-requirements.txt
```
4. install configurable-http-proxy with npm:
```bash
npm install -g configurable-http-proxy
```
5. set up pre-commit hooks for automatic code formatting, etc.
```bash
pre-commit install
```
You can also invoke the pre-commit hook manually at any time with
```bash
pre-commit run
```
## Contributing
JupyterHub has adopted automatic code formatting so you shouldn't
need to worry too much about your code style.
As long as your code is valid,
the pre-commit hook should take care of how it should look.
You can invoke the pre-commit hook by hand at any time with:
```bash
pre-commit run
```
which should run any autoformatting on your code
and tell you about any errors it couldn't fix automatically.
You may also install [black integration](https://github.com/psf/black#editor-integration)
into your text editor to format code automatically.
If you have already committed files before setting up the pre-commit
hook with `pre-commit install`, you can fix everything up using
`pre-commit run --all-files`. You need to make the fixing commit
yourself after that.
## Testing
It's a good idea to write tests to exercise any new features,
or that trigger any bugs that you have fixed to catch regressions.
You can run the tests with:
```bash
pytest -v
```
in the repo directory. If you want to just run certain tests,
check out the [pytest docs](https://pytest.readthedocs.io/en/latest/usage.html)
for how pytest can be called.
For instance, to test only spawner-related things in the REST API:
```bash
pytest -v -k spawn jupyterhub/tests/test_api.py
```
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)
To read more about fixtures check out the
[pytest docs](https://docs.pytest.org/en/latest/fixture.html)
for how to use the existing fixtures, and how to create new ones.
When in doubt, feel free to [ask](https://gitter.im/jupyterhub/jupyterhub).
If you need some help, feel free to ask on [Gitter](https://gitter.im/jupyterhub/jupyterhub) or [Discourse](https://discourse.jupyter.org/).

View File

@@ -21,81 +21,116 @@
# your jupyterhub_config.py will be added automatically
# from your docker directory.
ARG BASE_IMAGE=ubuntu:focal-20200729
FROM $BASE_IMAGE AS builder
######################################################################
# 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/
USER root
ARG BASE_IMAGE=ubuntu:22.04
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 wheel
&& 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 setup.py bdist_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,6 +8,7 @@ include *requirements.txt
include Dockerfile
graft onbuild
graft jsx
graft jupyterhub
graft scripts
graft share
@@ -18,6 +19,10 @@ graft ci
graft docs
prune docs/node_modules
# Intermediate javascript files
prune jsx/node_modules
prune jsx/build
# prune some large unused files from components
prune share/jupyterhub/static/components/bootstrap/dist/css
exclude share/jupyterhub/static/components/bootstrap/dist/fonts/*.svg

View File

@@ -8,15 +8,6 @@
---
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)
@@ -59,7 +50,7 @@ JupyterHub also provides a
[REST API][]
for administration of the Hub and its users.
[rest api]: https://juptyerhub.readthedocs.io/en/latest/reference/rest-api.html
[rest api]: https://jupyterhub.readthedocs.io/en/latest/reference/rest-api.html
## Installation
@@ -127,7 +118,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)
@@ -190,7 +181,7 @@ this a good choice for **testing JupyterHub on your desktop or laptop**.
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 by using a ssl enabled proxy.
configuration or by using an ssl enabled proxy.
[Mounting volumes](https://docs.docker.com/engine/admin/volumes/volumes/) will
allow you to **store data outside the docker image (host system) so it will be persistent**, even when you start
@@ -239,9 +230,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

@@ -1,39 +1,42 @@
# How to make a release
`jupyterhub` is a package [available on
PyPI](https://pypi.org/project/jupyterhub/) and
[conda-forge](https://conda-forge.org/).
These are instructions on how to make a release on PyPI.
The PyPI release is done automatically by CI when a tag is pushed.
`jupyterhub` is a package available on [PyPI][] and [conda-forge][].
These are instructions on how to make a release.
For you to follow along according to these instructions, you need:
## Pre-requisites
- To have push rights to the [jupyterhub GitHub
repository](https://github.com/jupyterhub/jupyterhub).
- Push rights to [jupyterhub/jupyterhub][]
- Push rights to [conda-forge/jupyterhub-feedstock][]
## Steps to make a release
1. Create a PR updating `docs/source/changelog.md` with [github-activity][] and
continue only when its merged.
```shell
pip install github-activity
github-activity --heading-level=3 jupyterhub/jupyterhub
```
1. Checkout main and make sure it is up to date.
```shell
ORIGIN=${ORIGIN:-origin} # set to the canonical remote, e.g. 'upstream' if 'origin' is not the official repo
git checkout main
git fetch $ORIGIN main
git reset --hard $ORIGIN/main
git fetch origin main
git reset --hard origin/main
```
1. Make sure `docs/source/changelog.md` is up-to-date.
[github-activity][] can help with this.
1. Update the version with `tbump`.
You can see what will happen without making any changes with `tbump --dry-run ${VERSION}`
1. Update the version, make commits, and push a git tag with `tbump`.
```shell
pip install tbump
tbump --dry-run ${VERSION}
tbump ${VERSION}
```
This will tag and publish a release,
which will be finished on CI.
Following this, the [CI system][] will build and publish a release.
1. Reset the version back to dev, e.g. `2.1.0.dev` after releasing `2.0.0`
@@ -42,9 +45,11 @@ For you to follow along according to these instructions, you need:
```
1. Following the release to PyPI, an automated PR should arrive to
[conda-forge/jupyterhub-feedstock][],
check for the tests to succeed on this PR and then merge it to successfully
update the package for `conda` on the conda-forge channel.
[conda-forge/jupyterhub-feedstock][] with instructions.
[github-activity]: https://github.com/choldgraf/github-activity
[pypi]: https://pypi.org/project/jupyterhub/
[conda-forge]: https://anaconda.org/conda-forge/jupyterhub
[jupyterhub/jupyterhub]: https://github.com/jupyterhub/jupyterhub
[conda-forge/jupyterhub-feedstock]: https://github.com/conda-forge/jupyterhub-feedstock
[github-activity]: https://github.com/executablebooks/github-activity
[ci system]: https://github.com/jupyterhub/jupyterhub/actions/workflows/release.yml

36
ci/check_installed_data.py Executable file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/env python
# Check that installed package contains everything we expect
from pathlib import Path
import jupyterhub
from jupyterhub._data import 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/spawn.html",
"static/css/style.min.css",
"static/components/jquery/dist/jquery.js",
"static/js/admin-react.js",
):
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")

27
ci/check_sdist.py Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env python
# Check that sdist contains everything we expect
import sys
import tarfile
expected_files = [
"docs/requirements.txt",
"jsx/package.json",
"package.json",
"README.md",
]
assert len(sys.argv) == 2, "Expected one file"
print(f"Checking {sys.argv[1]}")
tar = tarfile.open(name=sys.argv[1], mode="r:gz")
try:
# Remove leading jupyterhub-VERSION/
filelist = {f.partition('/')[2] for f in tar.getnames()}
finally:
tar.close()
for e in expected_files:
assert e in filelist, f"{e} not found"
print("OK")

View File

@@ -22,7 +22,7 @@ if [[ "$DB" == "mysql" ]]; then
# ref server: https://hub.docker.com/_/mysql/
# ref client: https://dev.mysql.com/doc/refman/5.7/en/setting-environment-variables.html
#
DOCKER_RUN_ARGS="-p 3306:3306 --env MYSQL_ALLOW_EMPTY_PASSWORD=1 mysql:5.7"
DOCKER_RUN_ARGS="-p 3306:3306 --env MYSQL_ALLOW_EMPTY_PASSWORD=1 mysql:8.0"
READINESS_CHECK="mysql --user root --execute \q"
elif [[ "$DB" == "postgres" ]]; then
# Environment variables can influence both the postgresql server in the
@@ -36,7 +36,7 @@ elif [[ "$DB" == "postgres" ]]; then
# used by the postgresql client psql, so we configure the user based on how
# we want to connect.
#
DOCKER_RUN_ARGS="-p 5432:5432 --env "POSTGRES_USER=${PGUSER}" --env "POSTGRES_PASSWORD=${PGPASSWORD}" postgres:9.5"
DOCKER_RUN_ARGS="-p 5432:5432 --env "POSTGRES_USER=${PGUSER}" --env "POSTGRES_PASSWORD=${PGPASSWORD}" postgres:15.1"
READINESS_CHECK="psql --command \q"
else
echo '$DB must be mysql or postgres'

View File

@@ -19,8 +19,9 @@ else
fi
# Configure a set of databases in the database server for upgrade tests
# this list must be in sync with versions in test_db.py:test_upgrade
set -x
for SUFFIX in '' _upgrade_100 _upgrade_122 _upgrade_130; do
for SUFFIX in '' _upgrade_110 _upgrade_122 _upgrade_130 _upgrade_150 _upgrade_211; do
$SQL_CLIENT "DROP DATABASE jupyterhub${SUFFIX};" 2>/dev/null || true
$SQL_CLIENT "CREATE DATABASE jupyterhub${SUFFIX} ${EXTRA_CREATE_DATABASE_ARGS:-};"
done

View File

@@ -1,21 +0,0 @@
-r requirements.txt
# temporary pin of attrs for jsonschema 0.3.0a1
# seems to be a pip bug
attrs>=17.4.0
beautifulsoup4
codecov
coverage
cryptography
html5lib # needed for beautifulsoup
jupyterlab >=3
mock
pre-commit
pytest>=3.3
pytest-asyncio
pytest-cov
requests-mock
tbump
# blacklist urllib3 releases affected by https://github.com/urllib3/urllib3/issues/1683
# I *think* this should only affect testing, not production
urllib3!=1.25.4,!=1.25.5
virtualenv

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,20 +0,0 @@
## What is Dockerfile.alpine
Dockerfile.alpine contains base image for jupyterhub. It does not work independently, but only as part of a full jupyterhub cluster
## How to use it?
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 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

@@ -4,6 +4,11 @@ from jupyterhub._data import DATA_FILES_PATH
print(f"DATA_FILES_PATH={DATA_FILES_PATH}")
for sub_path in ("templates", "static/components", "static/css/style.min.css"):
for sub_path in (
"templates",
"static/components",
"static/css/style.min.css",
"static/js/admin-react.js",
):
path = os.path.join(DATA_FILES_PATH, sub_path)
assert os.path.exists(path), path

View File

@@ -1,209 +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
source/rbac/scope-table.md: source/rbac/generate-scope-table.py
python3 source/rbac/generate-scope-table.py
# Manually added targets - related to code generation
# ----------------------------------------------------------------------------
# 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,8 +1,6 @@
import os
from os.path import join
from pytablewriter import RstSimpleTableWriter
from pytablewriter.style import Style
from pytablewriter import MarkdownTableWriter
import jupyterhub.metrics
@@ -12,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):
@@ -34,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

@@ -1,12 +1,21 @@
-r ../requirements.txt
# We install the jupyterhub package to help autodoc-traits inspect it and
# generate documentation.
#
# FIXME: If there is a way for this requirements.txt file to pass a flag that
# the build system can intercept to not build the javascript artifacts,
# then do so so. That would mean that installing the documentation can
# avoid needing node/npm installed.
#
--editable .
alabaster_jupyterhub
autodoc-traits
myst-parser
jupyterhub-sphinx-theme
myst-parser>=0.19
pre-commit
pydata-sphinx-theme
pytablewriter>=0.56
ruamel.yaml
sphinx>=1.7
sphinx>=4
sphinx-copybutton
sphinx-jsonschema
sphinxext-opengraph
sphinxext-rediraffe

View File

@@ -6,7 +6,7 @@ info:
description: The REST API for JupyterHub
license:
name: BSD-3-Clause
version: 2.3.0.dev
version: 4.0.1
servers:
- url: /hub/api
security:
@@ -139,6 +139,16 @@ paths:
If unspecified, use api_page_default_limit.
schema:
type: number
- name: include_stopped_servers
in: query
description: |
Include stopped servers in user model(s).
Added in JupyterHub 3.0.
Allows retrieval of information about stopped servers,
such as activity and state fields.
schema:
type: boolean
allowEmptyValue: true
responses:
200:
description: The Hub's user list
@@ -560,7 +570,19 @@ paths:
description: A note attached to the token for future bookkeeping
roles:
type: array
description: A list of role names that the token should have
description: |
A list of role names from which to derive scopes.
This is a shortcut for assigning collections of scopes;
Tokens do not retain role assignment.
(Changed in 3.0: roles are immediately resolved to scopes
instead of stored on roles.)
items:
type: string
scopes:
type: array
description: |
A list of scopes that the token should have.
(new in JupyterHub 3.0).
items:
type: string
required: false
@@ -793,6 +815,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
@@ -1147,9 +1202,13 @@ components:
description: Timestamp of last-seen activity from the user
format: date-time
servers:
type: array
description: The active servers for this user.
items:
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.
additionalProperties:
$ref: "#/components/schemas/Server"
auth_state:
type: object
@@ -1170,6 +1229,15 @@ components:
description: |
Whether the server is ready for traffic.
Will always be false when any transition is pending.
stopped:
type: boolean
description: |
Whether the server is stopped. Added in JupyterHub 3.0,
and only useful when using the `?include_stopped_servers`
request parameter.
Now that stopped servers may be included (since JupyterHub 3.0),
this is the simplest way to select stopped servers.
Always equivalent to `not (ready or pending)`.
pending:
type: string
description: |
@@ -1254,6 +1322,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
@@ -1314,7 +1391,16 @@ components:
description: The service that owns the token (undefined of owned by a user)
roles:
type: array
description: The names of roles this token has
description:
Deprecated in JupyterHub 3, always an empty list. Tokens have
'scopes' starting from JupyterHub 3.
items:
type: string
scopes:
type: array
description:
List of scopes this token has been assigned. New in JupyterHub
3. In JupyterHub 2.x, tokens were assigned 'roles' insead of scopes.
items:
type: string
note:
@@ -1370,6 +1456,9 @@ components:
inherit:
Everything that the token-owning entity can access _(metascope
for tokens)_
admin-ui:
Access the admin page. Permission to take actions via the admin
page granted separately.
admin:users:
Read, write, create and delete users and their authentication
state, not including their servers or tokens.

View File

@@ -1,37 +0,0 @@
# Common log messages emitted by JupyterHub
When debugging errors and outages, looking at the logs emitted by
JupyterHub is very helpful. This document tries to document some common
log messages, and what they mean.
## Failing suspected API request to not-running server
### Example
Your logs might be littered with lines that might look slightly scary
```
[W 2022-03-10 17:25:19.774 JupyterHub base:1349] Failing suspected API request to not-running server: /hub/user/<user-name>/api/metrics/v1
```
### Most likely cause
This likely means is that the user's server has stopped running but they
still have a browser tab open. For example, you might have 3 tabs open, and shut
your server down via one. Or you closed your laptop, your server was
culled for inactivity, and then you reopen your laptop again! The
client side code (JupyterLab, Classic Notebook, etc) does not know
yet that the server is dead, and continues to make some API requests.
JupyterHub's architecture means that the proxy routes all requests that
don't go to a running user server to the hub process itself. The hub
process then explicitly returns a failure response, so the client knows
that the server is not running anymore. This is used by JupyterLab to
tell you your server is not running anymore, and offer you the option
to let you restart it.
Most commonly, you'll see this in reference to the `/api/metrics/v1`
URL, used by [jupyter-resource-usage](https://github.com/jupyter-server/jupyter-resource-usage).
### Actions you can take
This log message is benign, and there is usually no action for you to take.

View File

@@ -1,157 +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
document is if you have set up your own JupyterHub without using a
distribution.
It is long because is pretty detailed! Most likely, upgrading
JupyterHub is painless, quick and with minimal user interruption.
Read the Changelog
==================
The `changelog <../changelog.html>`_ 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 authenticators & spawners you are using, so
read the changelogs for those too!
Notify your users
=================
If you are using 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 are using a different proxy, or running ``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
nor 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 are using sqlite (the default), you
should backup the ``jupyterhub.sqlite`` file.
#. Your ``jupyterhub_config.py`` file.
#. Your user's home directories. This is unlikely to be affected directly by
a JupyterHub upgrade, but we recommend a backup since user data is very
critical.
Shutdown JupyterHub
===================
Shutdown the JupyterHub process. This would vary depending on how you
have set up JupyterHub to run. Most likely, it is 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*, which is 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*. This is 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 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>
Where ``<version>`` is the version of JupyterHub you are upgrading to.
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 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 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 config file, or login using an external
authentication provider (Google, GitHub, LDAP, etc)
- user servers are stopped during upgrade
- don't mind causing users to login again after 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

@@ -1,70 +1,80 @@
# Configuration file for Sphinx to build our documentation to HTML.
#
# Configuration reference: https://www.sphinx-doc.org/en/master/usage/configuration.html
#
import contextlib
import datetime
import io
import os
import sys
import subprocess
# Set paths
sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ------------------------------------------------
# Minimal Sphinx version
needs_sphinx = '1.4'
# Sphinx extension modules
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.napoleon',
'autodoc_traits',
'sphinx_copybutton',
'sphinx-jsonschema',
'myst_parser',
]
myst_heading_anchors = 2
myst_enable_extensions = [
'colon_fence',
'deflist',
]
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'JupyterHub'
copyright = '2016, Project Jupyter team'
author = 'Project Jupyter team'
# Autopopulate version
from os.path import dirname
docs = dirname(dirname(__file__))
root = dirname(docs)
sys.path.insert(0, root)
import jupyterhub
# The short X.Y version.
version = '%i.%i' % jupyterhub.version_info[:2]
# The full version, including alpha/beta/rc tags.
release = jupyterhub.__version__
language = None
exclude_patterns = []
pygments_style = 'sphinx'
todo_include_todos = False
# Set the default role so we can use `foo` instead of ``foo``
default_role = 'literal'
# -- Config -------------------------------------------------------------
from jupyterhub.app import JupyterHub
from docutils import nodes
from sphinx.directives.other import SphinxDirective
from contextlib import redirect_stdout
from io import StringIO
# create a temp instance of JupyterHub just to get the output of the generate-config
# and help --all commands.
import jupyterhub
from jupyterhub.app import JupyterHub
# -- Project information -----------------------------------------------------
# ref: https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
#
project = "JupyterHub"
author = "Project Jupyter Contributors"
copyright = f"{datetime.date.today().year}, {author}"
# -- General Sphinx configuration --------------------------------------------
# ref: https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
#
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"autodoc_traits",
"sphinx_copybutton",
"sphinx-jsonschema",
"sphinxext.opengraph",
"sphinxext.rediraffe",
"jupyterhub_sphinx_theme",
"myst_parser",
]
root_doc = "index"
source_suffix = [".md"]
# default_role let's use use `foo` instead of ``foo`` in rST
default_role = "literal"
# -- MyST configuration ------------------------------------------------------
# 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
#
# We define custom directives to help us generate documentation using Python on
# demand when referenced from our documentation files.
#
# Create a temp instance of JupyterHub for use by two separate directive classes
# to get the output from using the "--generate-config" and "--help-all" CLI
# flags respectively.
#
jupyterhub_app = JupyterHub()
@@ -81,8 +91,8 @@ class ConfigDirective(SphinxDirective):
# The generated configuration file for this version
generated_config = jupyterhub_app.generate_config_file()
# post-process output
home_dir = os.environ['HOME']
generated_config = generated_config.replace(home_dir, '$HOME', 1)
home_dir = os.environ["HOME"]
generated_config = generated_config.replace(home_dir, "$HOME", 1)
par = nodes.literal_block(text=generated_config)
return [par]
@@ -98,160 +108,140 @@ class HelpAllDirective(SphinxDirective):
def run(self):
# The output of the help command for this version
buffer = StringIO()
with redirect_stdout(buffer):
jupyterhub_app.print_help('--help-all')
buffer = io.StringIO()
with contextlib.redirect_stdout(buffer):
jupyterhub_app.print_help("--help-all")
all_help = buffer.getvalue()
# post-process output
home_dir = os.environ['HOME']
all_help = all_help.replace(home_dir, '$HOME', 1)
home_dir = os.environ["HOME"]
all_help = all_help.replace(home_dir, "$HOME", 1)
par = nodes.literal_block(text=all_help)
return [par]
def setup(app):
app.add_css_file('custom.css')
app.add_directive('jupyterhub-generate-config', ConfigDirective)
app.add_directive('jupyterhub-help-all', HelpAllDirective)
app.add_css_file("custom.css")
app.add_directive("jupyterhub-generate-config", ConfigDirective)
app.add_directive("jupyterhub-help-all", HelpAllDirective)
source_suffix = ['.rst', '.md']
# source_encoding = 'utf-8-sig'
# -- Read The Docs -----------------------------------------------------------
#
# Since RTD runs sphinx-build directly without running "make html", we run the
# pre-requisite steps for "make html" from here if needed.
#
if os.environ.get("READTHEDOCS"):
docs = os.path.dirname(os.path.dirname(__file__))
subprocess.check_call(["make", "metrics", "scopes"], cwd=docs)
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages.
html_theme = 'pydata_sphinx_theme'
# -- Spell checking ----------------------------------------------------------
# ref: https://sphinxcontrib-spelling.readthedocs.io/en/latest/customize.html#configuration-options
#
# The "sphinxcontrib.spelling" extension is optionally enabled if its available.
#
try:
import sphinxcontrib.spelling # noqa
except ImportError:
pass
else:
extensions.append("sphinxcontrib.spelling")
spelling_word_list_filename = "spelling_wordlist.txt"
html_logo = '_static/images/logo/logo.png'
html_favicon = '_static/images/logo/favicon.ico'
# Paths that contain custom static files (such as style sheets)
html_static_path = ['_static']
htmlhelp_basename = 'JupyterHubdoc'
# -- Options for HTML output -------------------------------------------------
# ref: https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
#
html_logo = "_static/images/logo/logo.png"
html_favicon = "_static/images/logo/favicon.ico"
html_static_path = ["_static"]
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,
"navbar_align": "left",
}
html_context = {
"github_user": "jupyterhub",
"github_repo": "jupyterhub",
"github_version": "main",
"doc_path": "docs",
"doc_path": "docs/source",
}
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# 'papersize': 'letterpaper',
# 'pointsize': '10pt',
# 'preamble': '',
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(
master_doc,
'JupyterHub.tex',
'JupyterHub Documentation',
'Project Jupyter team',
'manual',
)
# -- Options for linkcheck builder -------------------------------------------
# ref: https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-the-linkcheck-builder
#
linkcheck_ignore = [
r"(.*)github\.com(.*)#", # javascript based anchors
r"(.*)/#%21(.*)/(.*)", # /#!forum/jupyter - encoded anchor edge case
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://jupyter.chameleoncloud.org", # FIXME: ignore (presumably) short-term SSL issue
]
linkcheck_anchors_ignore = [
"/#!",
"/#%21",
]
# latex_logo = None
# latex_use_parts = False
# latex_show_pagerefs = False
# latex_show_urls = False
# latex_appendices = []
# latex_domain_indices = True
# -- manual page output -------------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, 'jupyterhub', 'JupyterHub Documentation', [author], 1)]
# man_show_urls = False
# -- Texinfo output -----------------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(
master_doc,
'JupyterHub',
'JupyterHub Documentation',
author,
'JupyterHub',
'One line description of project.',
'Miscellaneous',
)
]
# texinfo_appendices = []
# texinfo_domain_indices = True
# texinfo_show_urls = 'footnote'
# texinfo_no_detailmenu = False
# -- Epub output --------------------------------------------------------
# Bibliographic Dublin Core info.
epub_title = project
epub_author = author
epub_publisher = author
epub_copyright = copyright
# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']
# -- Intersphinx ----------------------------------------------------------
# -- 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),
"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),
}
# -- Read The Docs --------------------------------------------------------
# -- Options for the opengraph extension -------------------------------------
# ref: https://github.com/wpilibsuite/sphinxext-opengraph#options
#
# ogp_site_url is set automatically by RTD
ogp_image = "_static/logo.png"
ogp_use_first_image = True
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if on_rtd:
# readthedocs.org uses their theme by default, so no need to specify it
# build both metrics and rest-api, since RTD doesn't run make
from subprocess import check_call as sh
sh(['make', 'metrics', 'scopes'], cwd=docs)
# -- Options for the rediraffe extension -------------------------------------
# ref: https://github.com/wpilibsuite/sphinxext-rediraffe#readme
#
# 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.
#
# 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"
# -- Spell checking -------------------------------------------------------
# allow 80% match for autogenerated redirects
rediraffe_auto_redirect_perc = 80
try:
import sphinxcontrib.spelling
except ImportError:
pass
else:
extensions.append("sphinxcontrib.spelling")
spelling_word_list_filename = 'spelling_wordlist.txt'
# rediraffe_redirects = {
# "old-file": "new-folder/new-file-name",
# }

View File

@@ -0,0 +1,27 @@
# Community communication channels
We use different channels of communication for different purposes. Whichever one you use will depend on what kind of communication you want to engage in.
## Discourse (recommended)
We use [Discourse](https://discourse.jupyter.org) for online discussions and support questions.
You can ask questions here if you are a first-time contributor to the JupyterHub project.
Everyone in the Jupyter community is welcome to bring ideas and questions there.
We recommend that you first use our Discourse as all past and current discussions on it are archived and searchable. Thus, all discussions remain useful and accessible to the whole community.
## Gitter
We use [our Gitter channel](https://gitter.im/jupyterhub/jupyterhub) for online, real-time text chat; a place for more ephemeral discussions. When you're not on Discourse, you can stop here to have other discussions on the fly.
## Github Issues
[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](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}
Our community is distributed across the world in various timezones, so please be patient if you do not get a response immediately!
```

View File

@@ -1,30 +0,0 @@
.. _contributing/community:
================================
Community communication channels
================================
We use `Discourse <https://discourse.jupyter.org>` for online discussion.
Everyone in the Jupyter community is welcome to bring ideas and questions there.
In addition, we use `Gitter <https://gitter.im>`_ for online, real-time text chat,
a place for more ephemeral discussions.
The primary Gitter channel for JupyterHub is `jupyterhub/jupyterhub <https://gitter.im/jupyterhub/jupyterhub>`_.
Gitter isn't archived or searchable, so we recommend going to discourse first
to make sure that discussions are most useful and accessible to the community.
Remember that our community is distributed across the world in various
timezones, so be patient if you do not get an answer immediately!
GitHub issues are used for most long-form project discussions, bug reports
and feature requests. Issues related to a specific authenticator or
spawner should be directed to 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 can not
find a repository to open your issue in, do not worry! Create it in the `main
JupyterHub repository <https://github.com/jupyterhub/jupyterhub/>`_ and our
community will help you figure it out.
A `mailing list <https://groups.google.com/forum/#!forum/jupyter>`_ for all
of Project Jupyter exists, along with one for `teaching with Jupyter
<https://groups.google.com/forum/#!forum/jupyter-education>`_.

View File

@@ -120,3 +120,4 @@ contribution on JupyterHub:
- yuvipanda
- zoltan-fedor
- zonca
- Neeraj Natu

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,78 +0,0 @@
.. _contributing/docs:
==========================
Contributing Documentation
==========================
Documentation is often more important than code. This page helps
you get set up on how to contribute documentation to JupyterHub.
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 successfuly 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 as you should 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 macOS, you can open a file from the terminal with ``open <path-to-file>``.
On Linux, you can do the same with ``xdg-open <path-to-file>``.
.. _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

@@ -4,7 +4,7 @@ This roadmap collects "next steps" for JupyterHub. It is about creating a
shared understanding of the project's vision and direction amongst
the community of users, contributors, and maintainers.
The goal is to communicate priorities and upcoming release plans.
It is not a aimed at limiting contributions to what is listed here.
It is not aimed at limiting contributions to what is listed here.
## Using the roadmap

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,188 +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.5 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
--------------
``configurable-http-proxy``, the default proxy implementation for
JupyterHub, is written in Javascript to run on `NodeJS
<https://nodejs.org/en/>`_. 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``.
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 need to make changes to the code & see
their effects quickly. You need to do a developer install to make that
happen.
.. note:: This guide does not attempt to dictate *how* development
environements 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.5.
.. code:: bash
npm -v
This should return a version number greater than or equal to 5.0.
3. Install ``configurable-http-proxy``. This is required to run
JupyterHub.
.. code:: bash
npm install -g configurable-http-proxy
If you get an error that says ``Error: EACCES: permission denied``,
you might need to prefix the command with ``sudo``. If you do not
have access to sudo, you may instead run the following commands:
.. code:: bash
npm install configurable-http-proxy
export PATH=$PATH:$(pwd)/node_modules/.bin
The second line needs to be run every time you open a new terminal.
4. Install the python packages required for JupyterHub development.
.. code:: bash
python3 -m pip install -r dev-requirements.txt
python3 -m pip install -r requirements.txt
5. Setup 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. Install the development version of JupyterHub. 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 .
7. You are now ready to start JupyterHub!
.. code:: bash
jupyterhub
8. You can access JupyterHub from your browser at
``http://localhost:8000`` now.
Happy developing!
Using DummyAuthenticator & SimpleLocalProcessSpawner
====================================================
To simplify testing of JupyterHub, its 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

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,68 +0,0 @@
.. _contributing/tests:
==================
Testing JupyterHub
==================
Unit test help 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 our tests. You
can find them under ``jupyterhub/tests`` directory in the git repository.
Running the tests
==================
#. Make sure you have completed :ref:`contributing/setup`. You should be able
to start ``jupyterhub`` from the commandline & 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
Troubleshooting Test Failures
=============================
All the tests are failing
-------------------------
Make sure you have completed all the steps in :ref:`contributing/setup` successfully, and
can launch ``jupyterhub`` from the terminal.

View File

@@ -1,46 +0,0 @@
Eventlogging 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
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

@@ -0,0 +1,308 @@
# Capacity planning
General capacity planning advice for JupyterHub is hard to give,
because it depends almost entirely on what your users are doing,
and what JupyterHub users do varies _wildly_ in terms of resource consumption.
**There is no single answer to "I have X users, what resources do I need?" or "How many users can I support with this machine?"**
Here are three _typical_ Jupyter use patterns that require vastly different resources:
- **Learning**: negligible resources because computation is mostly idle,
e.g. students learning programming for the first time
- **Production code**: very intense, sustained load, e.g. training machine learning models
- **Bursting**: _mostly_ idle, but needs a lot of resources for short periods of time
(interactive research often looks like this)
But just because there's no single answer doesn't mean we can't help.
So we have gathered here some useful information to help you make your decisions
about what resources you need based on how your users work,
including the relative invariants in terms of resources that JupyterHub itself needs.
## JupyterHub infrastructure
JupyterHub consists of a few components that are always running.
These take up very little resources,
especially relative to the resources consumed by users when you have more than a few.
As an example, an instance of mybinder.org (running JupyterHub 1.5.0),
running with typically ~100-150 users has:
| Component | CPU (mean/peak) | Memory (mean/peak) |
| --------- | --------------- | ------------------ |
| Hub | 4% / 13% | (230 MB / 260 MB) |
| Proxy | 6% / 13% | (47 MB / 65 MB) |
So it would be pretty generous to allocate ~25% of one CPU core
and ~500MB of RAM to overall JupyterHub infrastructure.
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
JupyterHub component resource usage for mybinder.org.
```
## Factors to consider
### Static vs elastic resources
A big factor in planning resources is:
**how much does it cost to change your mind?**
If you are using a single shared machine with local storage,
migrating to a new one because it turns out your users don't fit might be very costly.
You will have to get a new machine, set it up, and maybe even migrate user data.
On the other hand, if you are using ephemeral resources,
such as node pools in Kubernetes,
changing resource types costs close to nothing
because nodes can automatically be added or removed as needed.
Take that cost into account when you are picking how much memory or cpu to allocate to users.
Static resources (like [the-littlest-jupyterhub][]) provide for more **stable, predictable costs**,
but elastic resources (like [zero-to-jupyterhub][]) tend to provide **lower overall costs**
(especially when deployed with monitoring allowing cost optimizations over time),
but which are **less predictable**.
[the-littlest-jupyterhub]: https://the-littlest-jupyterhub.readthedocs.io
[zero-to-jupyterhub]: https://z2jh.jupyter.org
(limits-requests)=
### Limit vs Request for resources
Many scheduling tools like Kubernetes have two separate ways of allocating resources to users.
A **Request** or **Reservation** describes how much resources are _set aside_ for each user.
Often, this doesn't have any practical effect other than deciding when a given machine is considered 'full'.
If you are using expandable resources like an autoscaling Kubernetes cluster,
a new node must be launched and added to the pool if you 'request' more resources than fit on currently running nodes (a cluster **scale-up event**).
If you are running on a single VM, this describes how many users you can run at the same time, full stop.
A **Limit**, on the other hand, enforces a limit to how much resources any given user can consume.
For more information on what happens when users try to exceed their limits, see [](oversubscription).
In the strictest, safest case, you can have these two numbers be the same.
That means that each user is _limited_ to fit within the resources allocated to it.
This avoids **[oversubscription](oversubscription)** of resources (allowing use of more than you have available),
at the expense (in a literal, this-costs-money sense) of reserving lots of usually-idle capacity.
However, you often find that a small fraction of users use more resources than others.
In this case you may give users limits that _go beyond the amount of resources requested_.
This is called **oversubscribing** the resources available to users.
Having a gap between the request and the limit means you can fit a number of _typical_ users on a node (based on the request),
but still limit how much a runaway user can gobble up for themselves.
(oversubscription)=
### Oversubscribed CPU is okay, running out of memory is bad
An important consideration when assigning resources to users is: **What happens when users need more than I've given them?**
A good summary to keep in mind:
> When tasks don't get enough CPU, things are slow.
> When they don't get enough memory, things are broken.
This means it's **very important that users have enough memory**,
but much less important that they always have exclusive access to all the CPU they can use.
This relates to [Limits and Requests](limits-requests),
because these are the consequences of your limits and/or requests not matching what users actually try to use.
A table of mismatched resource allocation situations and their consequences:
| issue | consequence |
| -------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| Requests too high | Unnecessarily high cost and/or low capacity. |
| CPU limit too low | Poor performance experienced by users |
| CPU oversubscribed (too-low request + too-high limit) | Poor performance across the system; may crash, if severe |
| Memory limit too low | Servers killed by Out-of-Memory Killer (OOM); lost work for users |
| Memory oversubscribed (too-low request + too-high limit) | System memory exhaustion - all kinds of hangs and crashes and weird errors. Very bad. |
Note that the 'oversubscribed' problem case is where the request is lower than _typical_ usage,
meaning that the total reserved resources isn't enough for the total _actual_ consumption.
This doesn't mean that _all_ your users exceed the request,
just that the _limit_ gives enough room for the _average_ user to exceed the request.
All of these considerations are important _per node_.
Larger nodes means more users per node, and therefore more users to average over.
It also means more chances for multiple outliers on the same node.
### Example case for oversubscribing memory
Take for example, this system and sampling of user behavior:
- System memory = 8G
- memory request = 1G, limit = 3G
- typical 'heavy' user: 2G
- typical 'light' user: 0.5G
This will assign 8 users to those 8G of RAM (remember: only requests are used for deciding when a machine is 'full').
As long as the total of 8 users _actual_ usage is under 8G, everything is fine.
But the _limit_ allows a total of 24G to be used,
which would be a mess if everyone used their full limit.
But _not_ everyone uses the full limit, which is the point!
This pattern is fine if 1/8 of your users are 'heavy' because _typical_ usage will be ~0.7G,
and your total usage will be ~5G (`1 × 2 + 7 × 0.5 = 5.5`).
But if _50%_ of your users are 'heavy' you have a problem because that means your users will be trying to use 10G (`4 × 2 + 4 × 0.5 = 10`),
which you don't have.
You can make guesses at these numbers, but the only _real_ way to get them is to measure (see [](measuring)).
### CPU:memory ratio
Most of the time, you'll find that only one resource is the limiting factor for your users.
Most often it's memory, but for certain tasks, it could be CPU (or even GPUs).
Many cloud deployments have just one or a few fixed ratios of cpu to memory
(e.g. 'general purpose', 'high memory', and 'high cpu').
Setting your secondary resource allocation according to this ratio
after selecting the more important limit results in a balanced resource allocation.
For instance, some of Google Cloud's ratios are:
| node type | GB RAM / CPU core |
| ----------- | ----------------- |
| n2-highmem | 8 |
| n2-standard | 4 |
| n2-highcpu | 1 |
(idleness)=
### Idleness
Jupyter being an interactive tool means people tend to spend a lot more time reading and thinking than actually running resource-intensive code.
This significantly affects how much _cpu_ resources a typical active user needs,
but often does not significantly affect the _memory_.
Ways to think about this:
- More idle users means unused CPU.
This generally means setting your CPU _limit_ higher than your CPU _request_.
- What do your users do when they _are_ running code?
Is it typically single-threaded local computation in a notebook?
If so, there's little reason to set a limit higher than 1 CPU core.
- Do typical computations take a long time, or just a few seconds?
Longer typical computations means it's more likely for users to be trying to use the CPU at the same moment,
suggesting a higher _request_.
- Even with idle users, parallel computation adds up quickly - one user fully loading 4 cores and 3 using almost nothing still averages to more than a full CPU core per user.
- Long-running intense computations suggest higher requests.
Again, using mybinder.org as an example—we run around 100 users on 8-core nodes,
and still see fairly _low_ overall CPU usage on each user node.
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
mybinder.org node CPU usage is low with 50-150 users sharing just 8 cores
```
### Concurrent users and culling idle servers
Related to [][idleness], all of these resource consumptions and limits are calculated based on **concurrently active users**,
not total users.
You might have 10,000 users of your JupyterHub deployment, but only 100 of them running at any given time.
That 100 is the main number you need to use for your capacity planning.
JupyterHub costs scale very little based on the number of _total_ users,
up to a point.
There are two important definitions for **active user**:
- Are they _actually_ there (i.e. a human interacting with Jupyter, or running code that might be )
- Is their server running (this is where resource reservations and limits are actually applied)
Connecting those two definitions (how long are servers running if their humans aren't using them) is an important area of deployment configuration, usually implemented via the [JupyterHub idle culler service][idle-culler].
[idle-culler]: https://github.com/jupyterhub/jupyterhub-idle-culler
There are a lot of considerations when it comes to culling idle users that will depend:
- How much does it save me to shut down user servers? (e.g. keeping an elastic cluster small, or keeping a fixed-size deployment available to active users)
- How much does it cost my users to have their servers shut down? (e.g. lost work if shutdown prematurely)
- How easy do I want it to be for users to keep their servers running? (e.g. Do they want to run unattended simulations overnight? Do you want them to?)
Like many other things in this guide, there are many correct answers leading to different configuration choices.
For more detail on culling configuration and considerations, consult the [JupyterHub idle culler documentation][idle-culler].
## More tips
### Start strict and generous, then measure
A good tip, in general, is to give your users as much resources as you can afford that you think they _might_ use.
Then, use resource usage metrics like prometheus to analyze what your users _actually_ need,
and tune accordingly.
Remember: **Limits affect your user experience and stability. Requests mostly affect your costs**.
For example, a sensible starting point (lacking any other information) might be:
```yaml
request:
cpu: 0.5
mem: 2G
limit:
cpu: 1
mem: 2G
```
(more memory if significant computations are likely - machine learning models, data analysis, etc.)
Some actions
- If you see out-of-memory killer events, increase the limit (or talk to your users!)
- If you see typical memory well below your limit, reduce the request (but not the limit)
- If _nobody_ uses that much memory, reduce your limit
- If CPU is your limiting scheduling factor and your CPUs are mostly idle,
reduce the cpu request (maybe even to 0!).
- If CPU usage continues to be low, increase the limit to 2 or 4 to allow bursts of parallel execution.
(measuring)=
### Measuring user resource consumption
It is _highly_ recommended to deploy monitoring services such as [Prometheus][]
and [Grafana][] to get a view of your users' resource usage.
This is the only way to truly know what your users need.
JupyterHub has some experimental [grafana dashboards][] you can use as a starting point,
to keep an eye on your resource usage.
Here are some sample charts from (again from mybinder.org),
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)
[prometheus]: https://prometheus.io
[grafana]: https://grafana.com
[grafana dashboards]: https://github.com/jupyterhub/grafana-dashboards
### Measuring costs
Measuring costs may be as important as measuring your users activity.
If you are using a cloud provider, you can often use cost thresholds and quotas to instruct them to notify you if your costs are too high,
e.g. "Have AWS send me an email if I hit X spending trajectory on week 3 of the month."
You can then use this information to tune your resources based on what you can afford.
You can mix this information with user resource consumption to figure out if you have a problem,
e.g. "my users really do need X resources, but I can only afford to give them 80% of X."
This information may prove useful when asking your budget-approving folks for more funds.
### Additional resources
There are lots of other resources for cost and capacity planning that may be specific to JupyterHub and/or your cloud provider.
Here are some useful links to other resources
- [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.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

@@ -1,26 +1,26 @@
# JupyterHub and OAuth
JupyterHub uses OAuth 2 internally as a mechanism for authenticating users.
JupyterHub uses [OAuth 2](https://oauth.net/2/) as an internal mechanism for authenticating users.
As such, JupyterHub itself always functions as an OAuth **provider**.
More on what that means [below](oauth-terms).
You can find out more about what that means [below](oauth-terms).
Additionally, JupyterHub is _often_ deployed with [oauthenticator](https://oauthenticator.readthedocs.io),
Additionally, JupyterHub is _often_ deployed with [OAuthenticator](https://oauthenticator.readthedocs.io),
where an external identity provider, such as GitHub or KeyCloak, is used to authenticate users.
When this is the case, there are _two_ nested oauth flows:
an _internal_ oauth flow where JupyterHub is the **provider**,
and and _external_ oauth flow, where JupyterHub is a **client**.
When this is the case, there are _two_ nested OAuth flows:
an _internal_ OAuth flow where JupyterHub is the **provider**,
and an _external_ OAuth flow, where JupyterHub is the **client**.
This means that when you are using JupyterHub, there is always _at least one_ and often two layers of OAuth involved in a user logging in and accessing their server.
Some relevant points:
The following points are noteworthy:
- Single-user servers _never_ need to communicate with or be aware of the upstream provider configured in your Authenticator.
As far as they are concerned, only JupyterHub is an OAuth provider,
As far as the servers are concerned, only JupyterHub is an OAuth provider,
and how users authenticate with the Hub itself is irrelevant.
- When talking to a single-user server,
- When interacting with a single-user server,
there are ~always two tokens:
a token issued to the server itself to communicate with the Hub API,
and a second per-user token in the browser to represent the completed login process and authorized permissions.
first, a token issued to the server itself to communicate with the Hub API,
and second, a per-user token in the browser to represent the completed login process and authorized permissions.
More on this [later](two-tokens).
(oauth-terms)=
@@ -28,66 +28,66 @@ Some relevant points:
## Key OAuth terms
Here are some key definitions to keep in mind when we are talking about OAuth.
You can also read more detail [here](https://www.oauth.com/oauth2-servers/definitions/).
You can also read more in detail [here](https://www.oauth.com/oauth2-servers/definitions/).
- **provider** the entity responsible for managing identity and authorization,
- **provider**: The entity responsible for managing identity and authorization;
always a web server.
JupyterHub is _always_ an oauth provider for JupyterHub's components.
When OAuthenticator is used, an external service, such as GitHub or KeyCloak, is also an oauth provider.
- **client** An entity that requests OAuth **tokens** on a user's behalf,
JupyterHub is _always_ an OAuth provider for JupyterHub's components.
When OAuthenticator is used, an external service, such as GitHub or KeyCloak, is also an OAuth provider.
- **client**: An entity that requests OAuth **tokens** on a user's behalf;
generally a web server of some kind.
OAuth **clients** are services that _delegate_ authentication and/or authorization
to an OAuth **provider**.
JupyterHub _services_ or single-user _servers_ are OAuth **clients** of the JupyterHub **provider**.
When OAuthenticator is used, JupyterHub is itself _also_ an OAuth **client** for the external oauth **provider**, e.g. GitHub.
- **browser** A user's web browser, which makes requests and stores things like cookies
- **token** The secret value used to represent a user's authorization. This is the final product of the OAuth process.
- **code** A short-lived temporary secret that the **client** exchanges
for a **token** at the conclusion of oauth,
in what's generally called the "oauth callback handler."
When OAuthenticator is used, JupyterHub is itself _also_ an OAuth **client** for the external OAuth **provider**, e.g. GitHub.
- **browser**: A user's web browser, which makes requests and stores things like cookies.
- **token**: The secret value used to represent a user's authorization. This is the final product of the OAuth process.
- **code**: A short-lived temporary secret that the **client** exchanges
for a **token** at the conclusion of OAuth,
in what's generally called the "OAuth callback handler."
## One oauth flow
OAuth **flow** is what we call the sequence of HTTP requests involved in authenticating a user and issuing a token, ultimately used for authorized access to a service or single-user server.
OAuth **flow** is what we call the sequence of HTTP requests involved in authenticating a user and issuing a token, ultimately used for authorizing access to a service or single-user server.
A single oauth flow generally goes like this:
A single OAuth flow typically goes like this:
### OAuth request and redirect
1. A **browser** makes an HTTP request to an oauth **client**.
2. There are no credentials, so the client _redirects_ the browser to an "authorize" page on the oauth **provider** with some extra information:
- the oauth **client id** of the client itself
- the **redirect uri** to be redirected back to after completion
1. A **browser** makes an HTTP request to an OAuth **client**.
2. There are no credentials, so the client _redirects_ the browser to an "authorize" page on the OAuth **provider** with some extra information:
- the OAuth **client ID** of the client itself.
- the **redirect URI** to be redirected back to after completion.
- the **scopes** requested, which the user should be presented with to confirm.
This is the "X would like to be able to Y on your behalf. Allow this?" page you see on all the "Login with ..." pages around the Internet.
3. During this authorize step,
the browser must be _authenticated_ with the provider.
This is often already stored in a cookie,
but if not the provider webapp must begin its _own_ authentication process before serving the authorization page.
This _may_ even begin another oauth flow!
This _may_ even begin another OAuth flow!
4. After the user tells the provider that they want to proceed with the authorization,
the provider records this authorization in a short-lived record called an **oauth code**.
5. Finally, the oauth provider redirects the browser _back_ to the oauth client's "redirect uri"
(or "oauth callback uri"),
with the oauth code in a url parameter.
the provider records this authorization in a short-lived record called an **OAuth code**.
5. Finally, the oauth provider redirects the browser _back_ to the oauth client's "redirect URI"
(or "OAuth callback URI"),
with the OAuth code in a URL parameter.
That's the end of the requests made between the **browser** and the **provider**.
That marks the end of the requests made between the **browser** and the **provider**.
### State after redirect
At this point:
- The browser is authenticated with the _provider_
- The user's authorized permissions are recorded in an _oauth code_
- The _provider_ knows that the given oauth client's requested permissions have been granted, but the client doesn't know this yet.
- All requests so far have been made directly by the browser.
No requests have originated at the client or provider.
- The browser is authenticated with the _provider_.
- The user's authorized permissions are recorded in an _OAuth code_.
- The _provider_ knows that the permissions requested by the OAuth client have been granted, but the client doesn't know this yet.
- All the requests so far have been made directly by the browser.
No requests have originated from the client or provider.
### OAuth Client Handles Callback Request
Now we get to finish the OAuth process.
Let's dig into what the oauth client does when it handles
the oauth callback request with the
At this stage, we get to finish the OAuth process.
Let's dig into what the OAuth client does when it handles
the OAuth callback request.
- The OAuth client receives the _code_ and makes an API request to the _provider_ to exchange the code for a real _token_.
This is the first direct request between the OAuth _client_ and the _provider_.
@@ -95,12 +95,12 @@ the oauth callback request with the
makes a second API request to the _provider_
to retrieve information about the owner of the token (the user).
This is the step where behavior diverges for different OAuth providers.
Up to this point, all oauth providers are the same, following the oauth specification.
However, oauth does not define a standard for exchanging tokens for information about their owner or permissions ([OpenID Connect](https://openid.net/connect/) does that),
Up to this point, all OAuth providers are the same, following the OAuth specification.
However, OAuth does not define a standard for issuing tokens in exchange for information about their owner or permissions ([OpenID Connect](https://openid.net/connect/) does that),
so this step may be different for each OAuth provider.
- Finally, the oauth client stores its own record that the user is authorized in a cookie.
- Finally, the OAuth client stores its own record that the user is authorized in a cookie.
This could be the token itself, or any other appropriate representation of successful authentication.
- Last of all, now that credentials have been established,
- Now that credentials have been established,
the browser can be redirected to the _original_ URL where it started,
to try the request again.
If the client wasn't able to keep track of the original URL all this time
@@ -113,24 +113,24 @@ So that's _one_ OAuth process.
## Full sequence of OAuth in JupyterHub
Let's go through the above oauth process in JupyterHub,
with specific examples of each HTTP request and what information is contained.
For bonus points, we are using the double-oauth example of JupyterHub configured with GitHubOAuthenticator.
Let's go through the above OAuth process in JupyterHub,
with specific examples of each HTTP request and what information it contains.
For bonus points, we are using the double-OAuth example of JupyterHub configured with GitHubOAuthenticator.
To disambiguate, we will call the OAuth process where JupyterHub is the **provider** "internal oauth,"
and the one with JupyterHub as a **client** "external oauth."
To disambiguate, we will call the OAuth process where JupyterHub is the **provider** "internal OAuth,"
and the one with JupyterHub as a **client** "external OAuth."
Our starting point:
- a user's single-user server is running. Let's call them `danez`
- jupyterhub is running with GitHub as an oauth provider (this means two full instances of oauth),
- Danez has a fresh browser session with no cookies yet
- Jupyterhub is running with GitHub as an OAuth provider (this means two full instances of OAuth),
- Danez has a fresh browser session with no cookies yet.
First request:
- browser->single-user server running JupyterLab or Jupyter Classic
- `GET /user/danez/notebooks/mynotebook.ipynb`
- no credentials, so single-user server (as an oauth **client**) starts internal oauth process with JupyterHub (the **provider**)
- no credentials, so single-user server (as an OAuth **client**) starts internal OAuth process with JupyterHub (the **provider**)
- response: 302 redirect -> `/hub/api/oauth2/authorize`
with:
- client-id=`jupyterhub-user-danez`
@@ -138,9 +138,9 @@ First request:
Second request, following redirect:
- browser->jupyterhub
- browser->JupyterHub
- `GET /hub/api/oauth2/authorize`
- no credentials, so jupyterhub starts external oauth process _with GitHub_
- no credentials, so JupyterHub starts external OAuth process _with GitHub_
- response: 302 redirect -> `https://github.com/login/oauth/authorize`
with:
- client-id=`jupyterhub-client-uuid`
@@ -154,8 +154,8 @@ c.JupyterHub.authenticator_class = 'github'
```
That means authenticating a request to the Hub itself starts
a _second_, external oauth process with GitHub as a provider.
This external oauth process is optional, though.
a _second_, external OAuth process with GitHub as a provider.
This external OAuth process is optional, though.
If you were using the default username+password PAMAuthenticator,
this redirect would have been to `/hub/login` instead, to present the user
with a login form.
@@ -171,7 +171,7 @@ Here, GitHub prompts for login and asks for confirmation of authorization
After successful authorization
(either by looking up a pre-existing authorization,
or recording it via form submission)
GitHub issues an **oauth code** and redirects to `/hub/oauth_callback?code=github-code`
GitHub issues an **OAuth code** and redirects to `/hub/oauth_callback?code=github-code`
Next request:
@@ -184,7 +184,7 @@ The first:
- JupyterHub->GitHub
- `POST https://github.com/login/oauth/access_token`
- request made with oauth **code** from url parameter
- request made with OAuth **code** from URL parameter
- response includes an access **token**
The second:
@@ -194,9 +194,9 @@ The second:
- request made with access **token** in the `Authorization` header
- response is the user model, including username, email, etc.
Now the external oauth callback request completes with:
Now the external OAuth callback request completes with:
- set cookie on `/hub/` path, recording jupyterhub authentication so we don't need to do external oauth with GitHub again for a while
- set cookie on `/hub/` path, recording jupyterhub authentication so we don't need to do external OAuth with GitHub again for a while
- redirect -> `/hub/api/oauth2/authorize`
🎉 At this point, we have completed our first OAuth flow! 🎉
@@ -211,14 +211,14 @@ Now, we get our first repeated request:
2. automatically accepts authorization (shortcut taken when a user is visiting their own server)
- redirect -> `/user/danez/oauth_callback?code=jupyterhub-code`
Here, we start the same oauth callback process as before, but at Danez's single-user server for the _internal_ oauth
Here, we start the same OAuth callback process as before, but at Danez's single-user server for the _internal_ OAuth.
- browser->single-user server
- `GET /user/danez/oauth_callback`
(in handler)
Inside the internal oauth callback handler,
Inside the internal OAuth callback handler,
Danez's server makes two API requests to JupyterHub:
The first:
@@ -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_
@@ -271,15 +271,15 @@ To handle this, OAuth tokens and the various places they are stored can _expire_
which should have the same effect as no credentials,
and trigger the authorization process again.
In JupyterHub's internal oauth, we have these layers of information that can go stale:
In JupyterHub's internal OAuth, we have these layers of information that can go stale:
- The oauth client has a **cache** of Hub responses for tokens,
- The OAuth client has a **cache** of Hub responses for tokens,
so it doesn't need to make API requests to the Hub for every request it receives.
This cache has an expiry of five minutes by default,
and is governed by the configuration `HubAuth.cache_max_age` in the single-user server.
- The internal oauth token is stored in a cookie, which has its own expiry (default: 14 days),
- The internal OAuth token is stored in a cookie, which has its own expiry (default: 14 days),
governed by `JupyterHub.cookie_max_age_days`.
- The internal oauth token can also itself expire,
- The internal OAuth token itself can also expire,
which is by default the same as the cookie expiry,
since it makes sense for the token itself and the place it is stored to expire at the same time.
This is governed by `JupyterHub.cookie_max_age_days` first,
@@ -317,9 +317,9 @@ triggering the external login process anew before letting a user proceed.
- If the token has expired, but is still in the cookie:
when the token response cache expires,
the next time the server asks the hub about the token,
no user will be identified and the internal oauth process begins again.
no user will be identified and the internal OAuth process begins again.
- If the token _cookie_ expires, the next browser request will be made with no credentials,
and the internal oauth process will begin again.
and the internal OAuth process will begin again.
This will usually have the form of a transparent redirect browsers won't notice.
However, if this occurs on an API request in a long-lived page visit
such as a JupyterLab session, the API request may fail and require
@@ -352,7 +352,7 @@ Logging out of JupyterHub means clearing and revoking many of these credentials:
### A tale of two tokens
**TODO**: discuss API token issued to server at startup ($JUPYTERHUB_API_TOKEN)
and oauth-issued token in the cookie,
and OAuth-issued token in the cookie,
and some details of how JupyterLab currently deals with that.
They are different, and JupyterLab should be making requests using the token from the cookie,
not the token from the server,

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

@@ -1,3 +1,5 @@
(web-security)=
# Security Overview
The **Security Overview** section helps you learn about:
@@ -5,7 +7,7 @@ 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.
- the value of periodic security audits
This overview also helps you obtain a deeper understanding of how JupyterHub
works.
@@ -13,12 +15,12 @@ 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 is not necessarily unsuitable for serving **untrusted** users.
groups_ of **semi-trusted** users. While the design reflects serving
semi-trusted users, JupyterHub can also be suitable for serving **untrusted** users.
Using JupyterHub with **untrusted** users does mean more work by the
administrator. Much care is required to secure a Hub, with extra caution on
protecting users from each other as the Hub is serving untrusted users.
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
@@ -31,9 +33,8 @@ 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. JupyterHub's
authentication setup prevents a user writing arbitrary HTML and serving it to
another user because only the owner of a given single-user notebook server is
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.
@@ -42,15 +43,15 @@ ensure that:
- A user **does not have permission** to modify their single-user notebook server,
including:
- A user **may not** install new packages in the Python environment that runs
their single-user server.
- If the `PATH` is used to resolve the single-user executable (instead of
using an absolute path), a user **may not** create new files in any `PATH`
directory that precedes the directory containing `jupyterhub-singleuser`.
- A user may not modify environment variables (e.g. PATH, PYTHONPATH) for
their single-user server.
- A user **may not** modify the configuration of the notebook server
(the `~/.jupyter` or `JUPYTER_CONFIG_DIR` directory).
- 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).
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_
@@ -58,7 +59,7 @@ If any additional services are run on the same domain as the Hub, the services
## Mitigate security issues
Several approaches to mitigating these issues with configuration
The several approaches to mitigating security issues with configuration
options provided by JupyterHub include:
### Enable subdomains
@@ -69,24 +70,23 @@ desired effect, and user servers and the Hub are protected from each other. A
user's single-user server will be at `username.jupyter.mydomain.com`. This also
requires all user subdomains to point to the same address, which is most easily
accomplished with wildcard DNS. Since this spreads the service across multiple
domains, you will need wildcard SSL, as well. Unfortunately, for many
domains, you will need wildcard SSL as well. Unfortunately, for many
institutional domains, wildcard DNS and SSL are not available. **If you do plan
to serve untrusted users, enabling subdomains is highly encouraged**, as it
resolves the cross-site issues.
### Disable user config
If subdomains are not available or not desirable, JupyterHub provides a
If subdomains are unavailable or undesirable, JupyterHub provides a
configuration option `Spawner.disable_user_config`, which can be set to prevent
the user-owned configuration files from being loaded. After implementing this
option, PATHs and package installation and PATHs are the other things that the
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 care should
be taken to ensure that the Spawner does _not_ evaluate shell configuration
files prior to launching the server.
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 using virtualenv
@@ -101,14 +101,14 @@ pose additional risk to the web application's security.
### Encrypt internal connections with SSL/TLS
By default, all communication on the server, between the proxy, hub, and single
-user notebooks is performed unencrypted. Setting the `internal_ssl` flag in
By default, all communications on the server, 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** (yet) cover the
`zmq tcp` sockets between the Notebook client and kernel. While users cannot
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
@@ -119,8 +119,8 @@ extend to securing the `tcp` sockets as well.
## Security audits
We recommend that you do periodic reviews of your deployment's security. It's
good practice to keep JupyterHub, configurable-http-proxy, and nodejs
versions up to date.
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).
@@ -129,8 +129,8 @@ A handy website for testing your deployment is
## Vulnerability reporting
If you believe youve found a security vulnerability in JupyterHub, or any
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-notebook.readthedocs.io/en/stable/_downloads/ipython_security.asc).
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

@@ -8,10 +8,16 @@ broken down by their roles within organizations.
### Is it appropriate for adoption within a larger institutional context?
Yes! JupyterHub has been used at-scale for large pools of users, as well
as complex and high-performance computing. For example, UC Berkeley uses
JupyterHub for its Data Science Education Program courses (serving over
3,000 students). The Pangeo project uses JupyterHub to provide access
to scalable cloud computing with Dask. JupyterHub is stable and customizable
as complex and high-performance computing.
For example,
- UC Berkeley uses
JupyterHub for its Data Science Education Program courses (serving over
3,000 students).
- The Pangeo project uses JupyterHub to provide access
to scalable cloud computing with Dask.
JupyterHub is stable and customizable
to the use-cases of large organizations.
### I keep hearing about Jupyter Notebook, JupyterLab, and now JupyterHub. Whats the difference?
@@ -26,7 +32,7 @@ Here is a quick breakdown of these three tools:
has several extensions that are tailored for using Jupyter Notebooks, as well as extensions
for other parts of the data science stack.
- **JupyterHub** is an application that manages interactive computing sessions for **multiple users**.
It also connects them with infrastructure those users wish to access. It can provide
It also connects users with infrastructure they wish to access. It can provide
remote access to Jupyter Notebooks and JupyterLab for many people.
## For management
@@ -35,7 +41,7 @@ Here is a quick breakdown of these three tools:
JupyterHub provides a shared platform for data science and collaboration.
It allows users to utilize familiar data science workflows (such as the scientific Python stack,
the R tidyverse, and Jupyter Notebooks) on institutional infrastructure. It also allows administrators
the R tidyverse, and Jupyter Notebooks) on institutional infrastructure. It also gives administrators
some control over access to resources, security, environments, and authentication.
### Is JupyterHub mature? Why should we trust it?
@@ -60,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?
@@ -78,7 +84,7 @@ gives administrators more control over their setup and hardware.
Because JupyterHub is an open-source, community-driven tool, it can be extended and
modified to fit an institution's needs. It plays nicely with the open source data science
stack, and can serve a variety of computing enviroments, user interfaces, and
stack, and can serve a variety of computing environments, user interfaces, and
computational hardware. It can also be deployed anywhere - on enterprise cloud infrastructure, on
High-Performance-Computing machines, on local hardware, or even on a single laptop, which
is not possible with most other tools for shared interactive computing.
@@ -99,12 +105,12 @@ that we currently suggest are:
guide that runs on Kubernetes. Better for larger or dynamic user groups (50-10,000) or more complex
compute/data needs.
- [The Littlest JupyterHub](https://tljh.jupyter.org) is a lightweight JupyterHub that runs on a single
single machine (in the cloud or under your desk). Better for smaller user groups (4-80) or more
machine (in the cloud or under your desk). Better for smaller user groups (4-80) or more
lightweight computational resources.
### Does JupyterHub run well in the cloud?
Yes - most deployments of JupyterHub are run via cloud infrastructure and on a variety of cloud providers.
**Yes** - most deployments of JupyterHub are run via cloud infrastructure and on a variety of cloud providers.
Depending on the distribution of JupyterHub that you'd like to use, you can also connect your JupyterHub
deployment with a number of other cloud-native services so that users have access to other resources from
their interactive computing sessions.
@@ -118,14 +124,15 @@ as more resources are needed - allowing you to utilize the benefits of a flexibl
### Is JupyterHub secure?
The short answer: yes. JupyterHub as a standalone application has been battle-tested at an institutional
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
@@ -134,11 +141,11 @@ in these cases, and the security of your JupyterHub deployment will often depend
If you are worried about security, don't hesitate to reach out to the JupyterHub community in the
[Jupyter Community Forum](https://discourse.jupyter.org/c/jupyterhub). This community of practice has many
individuals with experience running secure JupyterHub deployments.
individuals with experience running secure JupyterHub deployments and will be very glad to help you out.
### Does JupyterHub provide computing or data infrastructure?
No - JupyterHub manages user sessions and can _control_ computing infrastructure, but it does not provide these
**No** - JupyterHub manages user sessions and can _control_ computing infrastructure, but it does not provide these
things itself. You are expected to run JupyterHub on your own infrastructure (local or in the cloud). Moreover,
JupyterHub has no internal concept of "data", but is designed to be able to communicate with data repositories
(again, either locally or remotely) for use within interactive computing sessions.
@@ -191,7 +198,7 @@ complex computing infrastructures from the interactive sessions of a JupyterHub.
This is highly configurable by the administrator. If you wish for your users to have simple
data analytics environments for prototyping and light data exploring, you can restrict their
memory and CPU based on the resources that you have available. If you'd like your JupyterHub
to serve as a gateway to high-performance compute or data resources, you may increase the
to serve as a gateway to high-performance computing or data resources, you may increase the
resources available on user machines, or connect them with computing infrastructures elsewhere.
### Can I customize the look and feel of a JupyterHub?

View File

@@ -1,35 +1,11 @@
(troubleshooting)=
# Troubleshooting
When troubleshooting, you may see unexpected behaviors or receive an error
message. This section provide links for identifying the cause of the
message. This section provides links for identifying the cause of the
problem and how to resolve it.
[_Behavior_](#behavior)
- JupyterHub proxy fails to start
- sudospawner fails to run
- What is the default behavior when none of the lists (admin, allowed,
allowed groups) are set?
- JupyterHub Docker container not accessible at localhost
[_Errors_](#errors)
- 500 error after spawning my single-user server
[_How do I...?_](#how-do-i)
- Use a chained SSL certificate
- Install JupyterHub without a network connection
- I want access to the whole filesystem, but still default users to their home directory
- How do I increase the number of pySpark executors on YARN?
- How do I use JupyterLab's prerelease version with JupyterHub?
- How do I set up JupyterHub for a workshop (when users are not known ahead of time)?
- How do I set up rotating daily logs?
- Toree integration with HDFS rack awareness script
- Where do I find Docker images and Dockerfiles related to JupyterHub?
[_Troubleshooting commands_](#troubleshooting-commands)
## Behavior
### JupyterHub proxy fails to start
@@ -40,9 +16,9 @@ If you have tried to start the JupyterHub proxy and it fails to start:
`c.JupyterHub.ip = '*'`; if it is, try `c.JupyterHub.ip = ''`
- Try starting with `jupyterhub --ip=0.0.0.0`
**Note**: If this occurs on Ubuntu/Debian, check that the you are using a
recent version of node. Some versions of Ubuntu/Debian come with a version
of node that is very old, and it is necessary to update node.
**Note**: If this occurs on Ubuntu/Debian, check that you are using a
recent version of [Node](https://nodejs.org). Some versions of Ubuntu/Debian come with a very old version
of Node and it is necessary to update Node.
### sudospawner fails to run
@@ -61,24 +37,24 @@ to the config file, `jupyterhub_config.py`.
### What is the default behavior when none of the lists (admin, allowed, allowed groups) are set?
When nothing is given for these lists, there will be no admins, and all users
who can authenticate on the system (i.e. all the unix users on the server with
who can authenticate on the system (i.e. all the Unix users on the server with
a password) will be allowed to start a server. The allowed username set lets you limit
this to a particular set of users, and admin_users lets you specify who
among them may use the admin interface (not necessary, unless you need to do
things like inspect other users' servers, or modify the user list at runtime).
things like inspect other users' servers or modify the user list at runtime).
### JupyterHub Docker container not accessible at localhost
### 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`),
it is possible that the IP address itself is not accessible/visible. As a result
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`
### How can I kill ports from JupyterHub managed services that have been orphaned?
### How can I kill ports from JupyterHub-managed services that have been orphaned?
I started JupyterHub + nbgrader on the same host without containers. When I try to restart JupyterHub + nbgrader with this configuration, errors appear that the service accounts cannot start because the ports are being used.
@@ -92,12 +68,12 @@ Where `<service_port>` is the port used by the nbgrader course service. This con
### Why am I getting a Spawn failed error message?
After successfully logging in to JupyterHub with a compatible authenticators, I get a 'Spawn failed' error message in the browser. The JupyterHub logs have `jupyterhub KeyError: "getpwnam(): name not found: <my_user_name>`.
After successfully logging in to JupyterHub with a compatible authenticator, I get a 'Spawn failed' error message in the browser. The JupyterHub logs have `jupyterhub KeyError: "getpwnam(): name not found: <my_user_name>`.
This issue occurs when the authenticator requires a local system user to exist. In these cases, you need to use a spawner
that does not require an existing system user account, such as `DockerSpawner` or `KubeSpawner`.
### How can I run JupyterHub with sudo but use my current env vars and virtualenv location?
### How can I run JupyterHub with sudo but use my current environment variables and virtualenv location?
When launching JupyterHub with `sudo jupyterhub` I get import errors and my environment variables don't work.
@@ -109,25 +85,11 @@ sudo MY_ENV=abc123 \
/srv/jupyterhub/jupyterhub
```
### How can I view the logs for JupyterHub or the user's Notebook servers when using the DockerSpawner?
Use `docker logs <container>` where `<container>` is the container name defined within `docker-compose.yml`. For example, to view the logs of the JupyterHub container use:
docker logs hub
By default, the user's notebook server is named `jupyter-<username>` where `username` is the user's username within JupyterHub's db. So if you wanted to see the logs for user `foo` you would use:
docker logs jupyter-foo
You can also tail logs to view them in real time using the `-f` option:
docker logs -f hub
## Errors
### 500 error after spawning my single-user server
### Error 500 after spawning my single-user server
You receive a 500 error when accessing the URL `/user/<your_name>/...`.
You receive a 500 error while accessing the URL `/user/<your_name>/...`.
This is often seen when your single-user server cannot verify your user cookie
with the Hub.
@@ -153,9 +115,9 @@ If everything is working, the response logged will be similar to this:
You should see a similar 200 message, as above, in the Hub log when you first
visit your single-user notebook server. If you don't see this message in the log, it
may mean that your single-user notebook server isn't connecting to your Hub.
may mean that your single-user notebook server is not connecting to your Hub.
If you see 403 (forbidden) like this, it's likely a token problem:
If you see 403 (forbidden) like this, it is likely a token problem:
```
403 GET /hub/api/authorizations/cookie/jupyterhub-token-name/[secret] (@10.0.1.4) 4.14ms
@@ -185,10 +147,10 @@ If you receive a 403 error, the API token for the single-user server is likely
invalid. Commonly, the 403 error is caused by resetting the JupyterHub
database (either removing jupyterhub.sqlite or some other action) while
leaving single-user servers running. This happens most frequently when using
DockerSpawner, because Docker's default behavior is to stop/start containers
which resets the JupyterHub database, rather than destroying and recreating
DockerSpawner because Docker's default behavior is to stop/start containers
that reset the JupyterHub database, rather than destroying and recreating
the container every time. This means that the same API token is used by the
server for its whole life, until the container is rebuilt.
server for its whole life until the container is rebuilt.
The fix for this Docker case is to remove any Docker containers seeing this
issue (typically all containers created before a certain point in time):
@@ -201,28 +163,28 @@ your server again.
##### Proxy settings (403 GET)
When your whole JupyterHub sits behind a organization proxy (_not_ a reverse proxy like NGINX as part of your setup and _not_ the configurable-http-proxy) the environment variables `HTTP_PROXY`, `HTTPS_PROXY`, `http_proxy` and `https_proxy` might be set. This confuses the jupyterhub-singleuser servers: When connecting to the Hub for authorization they connect via the proxy instead of directly connecting to the Hub on localhost. The proxy might deny the request (403 GET). This results in the singleuser server thinking it has a wrong auth token. To circumvent this you should add `<hub_url>,<hub_ip>,localhost,127.0.0.1` to the environment variables `NO_PROXY` and `no_proxy`.
When your whole JupyterHub sits behind an organization proxy (_not_ a reverse proxy like NGINX as part of your setup and _not_ the configurable-http-proxy) the environment variables `HTTP_PROXY`, `HTTPS_PROXY`, `http_proxy`, and `https_proxy` might be set. This confuses the JupyterHub single-user servers: When connecting to the Hub for authorization they connect via the proxy instead of directly connecting to the Hub on localhost. The proxy might deny the request (403 GET). This results in the single-user server thinking it has the wrong auth token. To circumvent this you should add `<hub_url>,<hub_ip>,localhost,127.0.0.1` to the environment variables `NO_PROXY` and `no_proxy`.
### 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 grading assignments.
- **Grading Assignments**: provide access to shared Jupyter Notebooks that may be used for management tasks such as grading assignments.
- **Private Dashboards**: share dashboards with certain group members.
If possible, try to run the Jupyter Notebook as an externally managed service with one of the provided [jupyter/docker-stacks](https://github.com/jupyter/docker-stacks).
Standard JupyterHub installations include a [jupyterhub-singleuser](https://github.com/jupyterhub/jupyterhub/blob/9fdab027daa32c9017845572ad9d5ba1722dbc53/setup.py#L116) command which is built from the `jupyterhub.singleuser:main` method. The `jupyterhub-singleuser` command is the default command when JupyterHub launches single-user Jupyter Notebooks. One of the goals of this command is to make sure the version of JupyterHub installed within the Jupyter Notebook coincides with the version of the JupyterHub server itself.
If you launch a Jupyter Notebook with the `jupyterhub-singleuser` command directly from the command line the Jupyter Notebook won't have access to the `JUPYTERHUB_API_TOKEN` and will return:
If you launch a Jupyter Notebook with the `jupyterhub-singleuser` command directly from the command line, the Jupyter Notebook won't have access to the `JUPYTERHUB_API_TOKEN` and will return:
```
JUPYTERHUB_API_TOKEN env is required to run jupyterhub-singleuser.
Did you launch it manually?
```
If you plan on testing `jupyterhub-singleuser` independently from JupyterHub, then you can set the api token environment variable. For example, if were to run the single-user Jupyter Notebook on the host, then:
If you plan on testing `jupyterhub-singleuser` independently from JupyterHub, then you can set the API token environment variable. For example, if you were to run the single-user Jupyter Notebook on the host, then:
export JUPYTERHUB_API_TOKEN=my_secret_token
jupyterhub-singleuser
@@ -243,7 +205,7 @@ With a docker container, pass in the environment variable with the run command:
Some certificate providers, i.e. Entrust, may provide you with a chained
certificate that contains multiple files. If you are using a chained
certificate you will need to concatenate the individual files by appending the
chain cert and root cert to your host cert:
chained cert and root cert to your host cert:
cat your_host.crt chain.crt root.crt > your_host-chained.crt
@@ -256,7 +218,7 @@ You would then set in your `jupyterhub_config.py` file the `ssl_key` and
#### Example
Your certificate provider gives you the following files: `example_host.crt`,
`Entrust_L1Kroot.txt` and `Entrust_Root.txt`.
`Entrust_L1Kroot.txt`, and `Entrust_Root.txt`.
Concatenate the files appending the chain cert and root cert to your host cert:
@@ -289,7 +251,7 @@ with npmbox:
python3 -m pip wheel jupyterhub
npmbox configurable-http-proxy
### I want access to the whole filesystem, but still default users to their home directory
### I want access to the whole filesystem and still default users to their home directory
Setting the following in `jupyterhub_config.py` will configure access to
the entire filesystem and set the default to the user's home directory.
@@ -308,7 +270,7 @@ similar to this one:
provides additional information. The [pySpark configuration documentation](https://spark.apache.org/docs/0.9.0/configuration.html)
is also helpful for programmatic configuration examples.
### How do I use JupyterLab's prerelease version with JupyterHub?
### How do I use JupyterLab's pre-release version with JupyterHub?
While JupyterLab is still under active development, we have had users
ask about how to try out JupyterLab with JupyterHub.
@@ -321,7 +283,7 @@ For instance:
python3 -m pip install jupyterlab
jupyter serverextension enable --py jupyterlab --sys-prefix
The important thing is that jupyterlab is installed and enabled in the
The important thing is that JupyterLab is installed and enabled in the
single-user notebook server environment. For system users, this means
system-wide, as indicated above. For Docker containers, it means inside
the single-user docker image, etc.
@@ -334,14 +296,14 @@ notebook servers to default to JupyterLab:
### How do I set up JupyterHub for a workshop (when users are not known ahead of time)?
1. Set up JupyterHub using OAuthenticator for GitHub authentication
2. Configure admin list to have workshop leaders be listed with administrator privileges.
2. Configure the admin list to have workshop leaders listed with administrator privileges.
Users will need a GitHub account to login and be authenticated by the Hub.
Users will need a GitHub account to log in and be authenticated by the Hub.
### How do I set up rotating daily logs?
You can do this with [logrotate](https://linux.die.net/man/8/logrotate),
or pipe to `logger` to use syslog instead of directly to a file.
or pipe to `logger` to use Syslog instead of directly to a file.
For example, with this logrotate config file:
@@ -362,34 +324,9 @@ Or use syslog:
jupyterhub | logger -t jupyterhub
## Troubleshooting commands
The following commands provide additional detail about installed packages,
versions, and system information that may be helpful when troubleshooting
a JupyterHub deployment. The commands are:
- System and deployment information
```bash
jupyter troubleshooting
```
- Kernel information
```bash
jupyter kernelspec list
```
- Debug logs when running JupyterHub
```bash
jupyterhub --debug
```
### Toree integration with HDFS rack awareness script
The Apache Toree kernel will an issue, when running with JupyterHub, if the standard HDFS
rack awareness script is used. This will materialize in the logs as a repeated WARN:
The Apache Toree kernel will have an issue when running with JupyterHub if the standard HDFS rack awareness script is used. This will materialize in the logs as a repeated WARN:
```bash
16/11/29 16:24:20 WARN ScriptBasedMapping: Exception running /etc/hadoop/conf/topology_script.py some.ip.address
@@ -412,8 +349,47 @@ In order to resolve this issue, there are two potential options.
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/)
provides an example single user notebook server for use with DockerSpawner.
provides an example single-user notebook server for use with DockerSpawner.
Additional single user notebook server images can be found at the [Jupyter
Additional single-user notebook server images can be found at the [Jupyter
organization on DockerHub](https://hub.docker.com/r/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?
Use `docker logs <container>` where `<container>` is the container name defined within `docker-compose.yml`. For example, to view the logs of the JupyterHub container use:
docker logs hub
By default, the user's notebook server is named `jupyter-<username>` where `username` is the user's username within JupyterHub's database.
So if you wanted to see the logs for user `foo` you would use:
docker logs jupyter-foo
You can also tail logs to view them in real-time using the `-f` option:
docker logs -f hub
## Troubleshooting commands
The following commands provide additional detail about installed packages,
versions, and system information that may be helpful when troubleshooting
a JupyterHub deployment. The commands are:
- System and deployment information
```bash
jupyter troubleshoot
```
- Kernel information
```bash
jupyter kernelspec list
```
- Debug logs when running JupyterHub
```bash
jupyterhub --debug
```

View File

@@ -1,35 +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,261 +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
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, simply omit the configuration settings
``c.JupyterHub.ssl_key`` and ``c.JupyterHub.ssl_cert``
(setting them to ``None`` does not have the same effect, and is 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 don't set the Proxy authentication token, the Hub will generate a random
key itself, which 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. An example command to generate the
``jupyterhub_cookie_secret`` file is:
.. 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`` or 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 in the configuration file
itself, ``jupyterhub_config.py``, as a binary string:
.. code-block:: python
c.JupyterHub.cookie_secret = bytes.fromhex('64 CHAR HEX STRING')
.. important::
If the cookie secret value changes for the Hub, all single-user notebook
servers must also be restarted.
.. _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. And to avoid a stale cache the cache key is comprised of both
the token and session id.
Resetting the Hub cookie secret effectively revokes this cookie.
This cookie is restricted to the path ``/user/<username>``, so 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 logout of the multiple OAuth cookies.
This cookie is set to ``/`` so all endpoints can receive it, or 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 your 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

@@ -5,15 +5,15 @@ deployment with the following assumptions:
- Running JupyterHub on a single cloud server
- Using SSL on the standard HTTPS port 443
- Using GitHub OAuth (using oauthenticator) for login
- Using GitHub OAuth (using [OAuthenticator](https://oauthenticator.readthedocs.io/en/latest)) for login
- Using the default spawner (to configure other spawners, uncomment and edit
`spawner_class` as well as follow the instructions for your desired spawner)
- Users exist locally on the server
- Users' notebooks to be served from `~/assignments` to allow users to browse
for notebooks within other users' home directories
- You want the landing page for each user to be a `Welcome.ipynb` notebook in
their assignments directory.
- All runtime files are put into `/srv/jupyterhub` and log files in `/var/log`.
their assignments directory
- All runtime files are put into `/srv/jupyterhub` and log files in `/var/log`
The `jupyterhub_config.py` file would have these settings:
@@ -69,7 +69,7 @@ c.Spawner.args = ['--NotebookApp.default_url=/notebooks/Welcome.ipynb']
```
Using the GitHub Authenticator requires a few additional
environment variable to be set prior to launching JupyterHub:
environment variables to be set prior to launching JupyterHub:
```bash
export GITHUB_CLIENT_ID=github_id
@@ -79,3 +79,5 @@ export CONFIGPROXY_AUTH_TOKEN=super-secret
# append log output to log file /var/log/jupyterhub.log
jupyterhub -f /etc/jupyterhub/jupyterhub_config.py &>> /var/log/jupyterhub.log
```
Visit the [Github OAuthenticator reference](https://oauthenticator.readthedocs.io/en/latest/api/gen/oauthenticator.github.html) to see the full list of options for configuring Github OAuth with JupyterHub.

View File

@@ -14,7 +14,7 @@ satisfy the following:
- After testing, the server in question should be able to score at least an A on the
Qualys SSL Labs [SSL Server Test](https://www.ssllabs.com/ssltest/)
Let's start out with needed JupyterHub configuration in `jupyterhub_config.py`:
Let's start out with the needed JupyterHub configuration in `jupyterhub_config.py`:
```python
# Force the proxy to only listen to connections to 127.0.0.1 (on port 8000)
@@ -30,15 +30,15 @@ This can take a few minutes:
openssl dhparam -out /etc/ssl/certs/dhparam.pem 4096
```
## nginx
## Nginx
This **`nginx` config file** is fairly standard fare except for the two
`location` blocks within the main section for HUB.DOMAIN.tld.
To create a new site for jupyterhub in your nginx config, make a new file
To create a new site for jupyterhub in your Nginx config, make a new file
in `sites.enabled`, e.g. `/etc/nginx/sites.enabled/jupyterhub.conf`:
```bash
# top-level http config for websocket headers
# Top-level HTTP config for WebSocket headers
# If Upgrade is defined, Connection = upgrade
# If Upgrade is empty, Connection = close
map $http_upgrade $connection_upgrade {
@@ -51,7 +51,7 @@ server {
listen 80;
server_name HUB.DOMAIN.TLD;
# Tell all requests to port 80 to be 302 redirected to HTTPS
# Redirect the request to HTTPS
return 302 https://$host$request_uri;
}
@@ -75,7 +75,7 @@ server {
ssl_stapling_verify on;
add_header Strict-Transport-Security max-age=15768000;
# Managing literal requests to the JupyterHub front end
# Managing literal requests to the JupyterHub frontend
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header X-Real-IP $remote_addr;
@@ -101,10 +101,10 @@ server {
If `nginx` is not running on port 443, substitute `$http_host` for `$host` on
the lines setting the `Host` header.
`nginx` will now be the front facing element of JupyterHub on `443` which means
`nginx` will now be the front-facing element of JupyterHub on `443` which means
it is also free to bind other servers, like `NO_HUB.DOMAIN.TLD` to the same port
on the same machine and network interface. In fact, one can simply use the same
server blocks as above for `NO_HUB` and simply add line for the root directory
server blocks as above for `NO_HUB` and simply add a line for the root directory
of the site as well as the applicable location call:
```bash
@@ -112,7 +112,7 @@ server {
listen 80;
server_name NO_HUB.DOMAIN.TLD;
# Tell all requests to port 80 to be 302 redirected to HTTPS
# Redirect the request to HTTPS
return 302 https://$host$request_uri;
}
@@ -143,12 +143,12 @@ Now restart `nginx`, restart the JupyterHub, and enjoy accessing
`https://HUB.DOMAIN.TLD` while serving other content securely on
`https://NO_HUB.DOMAIN.TLD`.
### SELinux permissions for nginx
### SELinux permissions for Nginx
On distributions with SELinux enabled (e.g. Fedora), one may encounter permission errors
when the nginx service is started.
when the Nginx service is started.
We need to allow nginx to perform network relay and connect to the jupyterhub port. The
We need to allow Nginx to perform network relay and connect to the JupyterHub port. The
following commands do that:
```bash
@@ -157,26 +157,26 @@ setsebool -P httpd_can_network_relay 1
setsebool -P httpd_can_network_connect 1
```
Replace 8000 with the port the jupyterhub server is running from.
Replace 8000 with the port the JupyterHub server is running from.
## Apache
As with nginx above, you can use [Apache](https://httpd.apache.org) as the reverse proxy.
First, we will need to enable the apache modules that we are going to need:
As with Nginx above, you can use [Apache](https://httpd.apache.org) as the reverse proxy.
First, we will need to enable the Apache modules that we are going to need:
```bash
a2enmod ssl rewrite proxy headers proxy_http proxy_wstunnel
```
Our Apache configuration is equivalent to the nginx configuration above:
Our Apache configuration is equivalent to the Nginx configuration above:
- Redirect HTTP to HTTPS
- Good SSL Configuration
- Support for websockets on any proxied URL
- Support for WebSocket on any proxied URL
- JupyterHub is running locally at http://127.0.0.1:8000
```bash
# redirect HTTP to HTTPS
# Redirect HTTP to HTTPS
Listen 80
<VirtualHost HUB.DOMAIN.TLD:80>
ServerName HUB.DOMAIN.TLD
@@ -188,26 +188,26 @@ Listen 443
ServerName HUB.DOMAIN.TLD
# enable HTTP/2, if available
# Enable HTTP/2, if available
Protocols h2 http/1.1
# HTTP Strict Transport Security (mod_headers is required) (63072000 seconds)
Header always set Strict-Transport-Security "max-age=63072000"
# configure SSL
# Configure SSL
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/HUB.DOMAIN.TLD/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/HUB.DOMAIN.TLD/privkey.pem
SSLOpenSSLConfCmd DHParameters /etc/ssl/certs/dhparam.pem
# intermediate configuration from ssl-config.mozilla.org (2022-03-03)
# Please note, that this configuration might be out-dated - please update it accordingly using https://ssl-config.mozilla.org/
# Intermediate configuration from SSL-config.mozilla.org (2022-03-03)
# Please note, that this configuration might be outdated - please update it accordingly using https://ssl-config.mozilla.org/
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
SSLHonorCipherOrder off
SSLSessionTickets off
# Use RewriteEngine to handle websocket connection upgrades
# Use RewriteEngine to handle WebSocket connection upgrades
RewriteEngine On
RewriteCond %{HTTP:Connection} Upgrade [NC]
RewriteCond %{HTTP:Upgrade} websocket [NC]
@@ -224,15 +224,15 @@ Listen 443
</VirtualHost>
```
In case of the need to run the jupyterhub under /jhub/ or other location please use the below configurations:
In case of the need to run JupyterHub under /jhub/ or another location please use the below configurations:
- JupyterHub running locally at http://127.0.0.1:8000/jhub/ or other location
httpd.conf amendments:
```bash
RewriteRule /jhub/(.*) ws://127.0.0.1:8000/jhub/$1 [NE,P,L]
RewriteRule /jhub/(.*) http://127.0.0.1:8000/jhub/$1 [NE,P,L]
RewriteRule /jhub/(.*) ws://127.0.0.1:8000/jhub/$1 [P,L]
RewriteRule /jhub/(.*) http://127.0.0.1:8000/jhub/$1 [P,L]
ProxyPass /jhub/ http://127.0.0.1:8000/jhub/
ProxyPassReverse /jhub/ http://127.0.0.1:8000/jhub/
@@ -240,8 +240,8 @@ httpd.conf amendments:
jupyterhub_config.py amendments:
```bash
--The public facing URL of the whole JupyterHub application.
--This is the address on which the proxy will bind. Sets protocol, ip, base_url
c.JupyterHub.bind_url = 'http://127.0.0.1:8000/jhub/'
```python
# The public facing URL of the whole JupyterHub application.
# This is the address on which the proxy will bind. Sets protocol, IP, base_url
c.JupyterHub.bind_url = 'http://127.0.0.1:8000/jhub/'
```

View File

@@ -6,14 +6,14 @@ Only do this if you are very sure you must.
## Overview
There are many Authenticators and Spawners available for JupyterHub. Some, such
as DockerSpawner or OAuthenticator, do not need any elevated permissions. This
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 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.
@@ -69,7 +69,8 @@ Cmnd_Alias JUPYTER_CMD = /usr/local/bin/sudospawner
rhea ALL=(JUPYTER_USERS) NOPASSWD:JUPYTER_CMD
```
It might be useful to modify `secure_path` to add commands in path.
It might be useful to modify `secure_path` to add commands in path. (Search for
`secure_path` in the [sudo docs](https://www.sudo.ws/man/1.8.14/sudoers.man.html)
As an alternative to adding every user to the `/etc/sudoers` file, you can
use a group in the last line above, instead of `JUPYTER_USERS`:
@@ -90,7 +91,7 @@ $ adduser -G jupyterhub newuser
Test that the new user doesn't need to enter a password to run the sudospawner
command.
This should prompt for your password to switch to rhea, but _not_ prompt for
This should prompt for your password to switch to `rhea`, but _not_ prompt for
any password for the second switch. It should show some help output about
logging options:
@@ -113,13 +114,13 @@ 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.
### Shadow group (Linux)
**Note:** On Fedora based distributions there is no clear way to configure
**Note:** On [Fedora based distributions](https://fedoraproject.org/wiki/List_of_Fedora_remixes) there is no clear way to configure
the PAM database to allow sufficient access for authenticating with the target user's password
from JupyterHub. As a workaround we recommend use an
[alternative authentication method](https://github.com/jupyterhub/jupyterhub/wiki/Authenticators).
@@ -150,7 +151,7 @@ We want our new user to be able to read the shadow passwords, so add it to the s
$ sudo usermod -a -G shadow rhea
```
If you want jupyterhub to serve pages on a restricted port (such as port 80 for http),
If you want jupyterhub to serve pages on a restricted port (such as port 80 for HTTP),
then you will need to give `node` permission to do so:
```bash
@@ -158,16 +159,18 @@ sudo setcap 'cap_net_bind_service=+ep' /usr/bin/node
```
However, you may want to further understand the consequences of this.
([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)
**NOTE:** This has not been tested and may not work as expected.
**NOTE:** This has not been tested on FreeBSD and may not work as expected on
the FreeBSD platform. _Do not use in production without verifying that it works properly!_
```bash
$ ls -l /etc/spwd.db /etc/master.passwd
@@ -225,8 +228,8 @@ And try logging in.
## Troubleshooting: SELinux
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 allow this.
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`:
```bash
@@ -253,6 +256,6 @@ $ semodule -i sudo_exec_selinux.pp
## Troubleshooting: PAM session errors
If the PAM authentication doesn't work and you see errors for
`login:session-auth`, or similar, considering updating to a more recent version
`login:session-auth`, or similar, consider updating to a more recent version
of jupyterhub and disabling the opening of PAM sessions with
`c.PAMAuthenticator.open_sessions=False`.

View File

@@ -0,0 +1,245 @@
# Configuring user environments
To deploy JupyterHub means you are providing Jupyter notebook environments for
multiple users. Often, this includes a desire to configure the user
environment in a custom way.
Since the `jupyterhub-singleuser` server extends the standard Jupyter notebook
server, most configuration and documentation that applies to Jupyter Notebook
applies to the single-user environments. Configuration of user environments
typically does not occur through JupyterHub itself, but rather through system-wide
configuration of Jupyter, which is inherited by `jupyterhub-singleuser`.
**Tip:** When searching for configuration tips for JupyterHub user environments, you might want to remove JupyterHub from your search because there are a lot more people out there configuring Jupyter than JupyterHub and the configuration is the same.
This section will focus on user environments, which includes the following:
- [Installing packages](#installing-packages)
- [Configuring Jupyter and IPython](#configuring-jupyter-and-ipython)
- [Installing kernelspecs](#installing-kernelspecs)
- [Using containers vs. multi-user hosts](#multi-user-hosts-vs-containers)
## Installing packages
To make packages available to users, you will typically install packages system-wide or in a shared environment.
This installation location should always be in the same environment where
`jupyterhub-singleuser` itself is installed in, and must be _readable and
executable_ by your users. If you want your users to be able to install additional
packages, the installation location must also be _writable_ by your users.
If you are using a standard Python installation on your system, use the following command:
```bash
sudo python3 -m pip install numpy
```
to install the numpy package in the default Python 3 environment on your system
(typically `/usr/local`).
You may also use conda to install packages. If you do, you should make sure
that the conda environment has appropriate permissions for users to be able to
run Python code in the env. The env must be _readable and executable_ by all
users. Additionally it must be _writeable_ if you want users to install
additional packages.
## Configuring Jupyter and IPython
[Jupyter](https://jupyter-notebook.readthedocs.io/en/stable/config_overview.html)
and [IPython](https://ipython.readthedocs.io/en/stable/development/config.html)
have their own configuration systems.
As a JupyterHub administrator, you will typically want to install and configure environments for all JupyterHub users. For example, let's say you wish for each student in a class to have the same user environment configuration.
Jupyter and IPython support **"system-wide"** locations for configuration, which is the logical place to put global configuration that you want to affect all users. It's generally more efficient to configure user environments "system-wide", and it's a good practice to avoid creating files in the users' home directories.
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`:
```python
c.InteractiveShellApp.extensions.append("cython")
```
### Example: Enable a Jupyter notebook configuration setting for all users
:::{note}
These examples configure the Jupyter ServerApp, which is used by JupyterLab, the default in JupyterHub 2.0.
If you are using the classing Jupyter Notebook server,
the same things should work,
with the following substitutions:
- Search for `jupyter_server_config`, and replace with `jupyter_notebook_config`
- Search for `NotebookApp`, and replace with `ServerApp`
:::
To enable Jupyter notebook's internal idle-shutdown behavior (requires notebook ≥ 5.4), set the following in the `/etc/jupyter/jupyter_server_config.py` file:
```python
# shutdown the server after no activity for an hour
c.ServerApp.shutdown_no_activity_timeout = 60 * 60
# shutdown kernels after no activity for 20 minutes
c.MappingKernelManager.cull_idle_timeout = 20 * 60
# check for idle kernels every two minutes
c.MappingKernelManager.cull_interval = 2 * 60
```
## Installing kernelspecs
You may have multiple Jupyter kernels installed and want to make sure that they are available to all of your users. This means installing kernelspecs either system-wide (e.g. in /usr/local/) or in the `sys.prefix` of JupyterHub
itself.
Jupyter kernelspec installation is system-wide by default, but some kernels
may default to installing kernelspecs in your home directory. These will need
to be moved system-wide to ensure that they are accessible.
To see where your kernelspecs are, you can use the following command:
```bash
jupyter kernelspec list
```
### Example: Installing kernels system-wide
Let's assume that I have a Python 2 and Python 3 environment that I want to make sure are available, I can install their specs **system-wide** (in /usr/local) using the following command:
```bash
/path/to/python3 -m ipykernel install --prefix=/usr/local
/path/to/python2 -m ipykernel install --prefix=/usr/local
```
## Multi-user hosts vs. Containers
There are two broad categories of user environments that depend on what
Spawner you choose:
- Multi-user hosts (shared system)
- Container-based
How you configure user environments for each category can differ a bit
depending on what Spawner you are using.
The first category is a **shared system (multi-user host)** where
each user has a JupyterHub account, a home directory as well as being
a real system user. In this example, shared configuration and installation
must be in a 'system-wide' location, such as `/etc/`, or `/usr/local`
or a custom prefix such as `/opt/conda`.
When JupyterHub uses **container-based** Spawners (e.g. KubeSpawner or
DockerSpawner), the 'system-wide' environment is really the container image used for users.
In both cases, you want to _avoid putting configuration in user home
directories_ because users can change those configuration settings. Also, home directories typically persist once they are created, thereby making it difficult for admins to update later.
## Named servers
By default, in a JupyterHub deployment, each user has one server only.
JupyterHub can, however, have multiple servers per user.
This is mostly useful in deployments where users can configure the environment in which their server will start (e.g. resource requests on an HPC cluster), so that a given user can have multiple configurations running at the same time, without having to stop and restart their own server.
To allow named servers, include this code snippet in your config file:
```python
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)
as well as the admin page:
![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.
To limit the number of **named server** per user by setting a constant value, include this code snippet in your config file:
```python
c.JupyterHub.named_server_limit_per_user = 5
```
Alternatively, to use a callable/awaitable based on the handler object, include this code snippet in your config file:
```python
def named_server_limit_per_user_fn(handler):
user = handler.current_user
if user and user.admin:
return 0
return 5
c.JupyterHub.named_server_limit_per_user = named_server_limit_per_user_fn
```
This can be useful for quota service implementations. The example above limits the number of named servers for non-admin users only.
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
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
(in the single-user environment) to:
```bash
export JUPYTERHUB_SINGLEUSER_APP='notebook.notebookapp.NotebookApp'
```
[jupyter server]: https://jupyter-server.readthedocs.io
[jupyter notebook]: https://jupyter-notebook.readthedocs.io
:::{versionchanged} 2.0
JupyterLab is now the default single-user UI, if available,
which is based on the [Jupyter Server][],
no longer the legacy [Jupyter Notebook][] server.
JupyterHub prior to 2.0 launched the legacy notebook server (`jupyter notebook`),
and the Jupyter server could be selected by specifying the following:
```python
# jupyterhub_config.py
c.Spawner.cmd = ["jupyter-labhub"]
```
Alternatively, for an otherwise customized Jupyter Server app,
set the environment variable using the following command:
```bash
export JUPYTERHUB_SINGLEUSER_APP='jupyter_server.serverapp.ServerApp'
```
:::

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

@@ -0,0 +1,72 @@
# Interpreting common log messages
When debugging errors and outages, looking at the logs emitted by
JupyterHub is very helpful. This document intends to describe some common
log messages, what they mean and what are the most common causes that generated them, as well as some possible ways to fix them.
## Failing suspected API request to not-running server
### Example
Your logs might be littered with lines that look scary
```
[W 2022-03-10 17:25:19.774 JupyterHub base:1349] Failing suspected API request to not-running server: /hub/user/<user-name>/api/metrics/v1
```
### Cause
This likely means that the user's server has stopped running but they
still have a browser tab open. For example, you might have 3 tabs open and you shut
the server down via one.
Another possible reason could be that you closed your laptop and the server was culled for inactivity, then reopened the laptop!
However, the client-side code (JupyterLab, Classic Notebook, etc) doesn't interpret the shut-down server and continues to make some API requests.
JupyterHub's architecture means that the proxy routes all requests that
don't go to a running user server to the hub process itself. The hub
process then explicitly returns a failure response, so the client knows
that the server is not running anymore. This is used by JupyterLab to
inform the user that the server is not running anymore, and provide an option
to restart it.
Most commonly, you'll see this in reference to the `/api/metrics/v1`
URL, used by [jupyter-resource-usage](https://github.com/jupyter-server/jupyter-resource-usage).
### Actions you can take
This log message is benign, and there is usually no action for you to take.
## JupyterHub Singleuser Version mismatch
### Example
```
jupyterhub version 1.5.0 != jupyterhub-singleuser version 1.3.0. This could cause failure to authenticate and result in redirect loops!
```
### Cause
JupyterHub requires the `jupyterhub` python package installed inside the image or
environment, the user server starts in. This message indicates that the version of
the `jupyterhub` package installed inside the user image or environment is not
the same as the JupyterHub server's version itself. This is not necessarily always a
problem - some version drift is mostly acceptable, and the only two known cases of
breakage are across the 0.7 and 2.0 version releases. In those cases, issues pop
up immediately after upgrading your version of JupyterHub, so **always check the JupyterHub
changelog before upgrading!**. The primary problems this _could_ cause are:
1. Infinite redirect loops after the user server starts
2. Missing expected environment variables in the user server once it starts
3. Failure for the started user server to authenticate with the JupyterHub server -
note that this is _not_ the same as _user authentication_ failing!
However, for the most part, unless you are seeing these specific issues, the log
message should be counted as a warning to get the `jupyterhub` package versions
aligned, rather than as an indicator of an existing problem.
### Actions you can take
Upgrade the version of the `jupyterhub` package in your user environment or image
so that it matches the version of JupyterHub running your JupyterHub server! If you
are using the [zero-to-jupyterhub](https://z2jh.jupyter.org) helm chart, you can find the appropriate
version of the `jupyterhub` package to install in your user image [here](https://jupyterhub.github.io/helm-chart/)

View File

@@ -7,9 +7,12 @@ Hub manages by default as a subprocess (it can be run externally, as well, and
typically is in production deployments).
The upside to CHP, and why we use it by default, is that it's easy to install
and run (if you have nodejs, you are set!). The downsides are that it's a
single process and does not support any persistence of the routing table. So
if the proxy process dies, your whole JupyterHub instance is inaccessible
and run (if you have nodejs, you are set!). The downsides are that
- it's a single process and
- does not support any persistence of the routing table.
So if the proxy process dies, your whole JupyterHub instance is inaccessible
until the Hub notices, restarts the proxy, and restores the routing table. For
deployments that want to avoid such a single point of failure, or leverage
existing proxy infrastructure in their chosen deployment (such as Kubernetes
@@ -138,7 +141,7 @@ async def delete_route(self, routespec):
For retrieval, you only _need_ to implement a single method that retrieves all
routes. The return value for this function should be a dictionary, keyed by
`routespect`, of dicts whose keys are the same three arguments passed to
`routespec`, of dicts whose keys are the same three arguments passed to
`add_route` (`routespec`, `target`, `data`)
```python
@@ -204,7 +207,7 @@ setup(
```
If you have added this metadata to your package,
users can select your proxy with the configuration:
admins can select your authenticator with the configuration:
```python
c.JupyterHub.proxy_class = 'mything'
@@ -216,7 +219,7 @@ instead of the full
c.JupyterHub.proxy_class = 'mypackage:MyProxy'
```
previously required.
as previously required.
Additionally, configurable attributes for your proxy will
appear in jupyterhub help output and auto-generated configuration files
via `jupyterhub --generate-config`.

View File

@@ -1,61 +1,89 @@
(rest-api)=
(using-jupyterhub-rest-api)=
# Using JupyterHub's REST API
This section will give you information on:
- what you can do with the API
- create an API token
- add API tokens to the config files
- make an API request programmatically using the requests library
- learn more about JupyterHub's API
- What you can do with the API
- How to create an API token
- Assigning permissions to a token
- Updating to admin services
- Making an API request programmatically using the requests library
- Paginating API requests
- Enabling users to spawn multiple named-servers via the API
- Learn more about JupyterHub's API
## What you can do with the API
Using the [JupyterHub REST API][], you can perform actions on the Hub,
such as:
- checking which users are active
- adding or removing users
- stopping or starting single user notebook servers
- authenticating services
- communicating with an individual Jupyter server's REST API
A [REST](https://en.wikipedia.org/wiki/Representational_state_transfer)
Before we discuss about JupyterHub's REST API, you can learn about [REST APIs here](https://en.wikipedia.org/wiki/Representational_state_transfer). A REST
API provides a standard way for users to get and send information to the
Hub.
## What you can do with the API
Using the [JupyterHub REST API](jupyterhub-rest-API), you can perform actions on the Hub,
such as:
- Checking which users are active
- Adding or removing users
- Stopping or starting single user notebook servers
- Authenticating services
- Communicating with an individual Jupyter server's REST API
## Create an API token
To send requests using JupyterHub API, you must pass an API token with
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:
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-page.png)
JupyterHub's API token page
:::
:::{figure-md}
![token-request-success](../images/token-request-success.png)
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 potential token that can then be
added to JupyterHub using `.api_tokens` configuration setting in
`jupyterhub_config.py`.
This `openssl` command generates a random token that can be added to the JupyterHub configuration in `jupyterhub_config.py`.
Alternatively, use the `jupyterhub token` command to generate a token
for a specific hub user by passing the 'username':
For external services, this would be registered with JupyterHub via configuration:
```bash
jupyterhub token <username>
```python
c.JupyterHub.services = [
{
"name": "my-service",
"api_token": the_secret_value,
},
]
```
This command generates a random string to use as a token and registers
it for the given user with the Hub's database.
At this point, requests authenticated with the token will be associated with The service `my-service`.
In [version 0.8.0](../changelog.md), a token request page for
generating an API token is available from the JupyterHub user interface:
```{note}
You can also load additional tokens for users via the `JupyterHub.api_tokens` configuration.
![Request API token page](../images/token-request.png)
![API token success page](../images/token-request-success.png)
However, this option has been deprecated since the introduction of services.
```
## Assigning permissions to a token
@@ -67,25 +95,26 @@ Prior to JupyterHub 2.0, there were two levels of permissions:
where a token would always have full permissions to do whatever its owner could do.
In JupyterHub 2.0,
specific permissions are now defined as 'scopes',
specific permissions are now defined as '**scopes**',
and can be assigned both at the user/service level,
and at the individual token level.
This allows e.g. a user with full admin permissions to request a token with limited permissions.
### Updating to admin services
## Updating to admin services
```{note}
The `api_tokens` configuration has been softly deprecated since the introduction of services.
We have no plans to remove it,
but deployments are encouraged to use service configuration instead.
```
If you have been using `api_tokens` to create an admin user
and a token for that user to perform some automations,
the services mechanism may be a better fit.
If you have the following configuration:
and the token for that user to perform some automations, then
the services' mechanism may be a better fit if you have the following configuration:
```python
c.JupyterHub.admin_users = {"service-admin",}
c.JupyterHub.admin_users = {"service-admin"}
c.JupyterHub.api_tokens = {
"secret-token": "service-admin",
}
@@ -103,9 +132,8 @@ c.JupyterHub.services = [
},
]
# roles are new in JupyterHub 2.0
# prior to 2.0, only 'admin': True or False
# was available
# roles were introduced in JupyterHub 2.0
# prior to 2.0, only "admin": True or False was available
c.JupyterHub.load_roles = [
{
@@ -125,7 +153,7 @@ c.JupyterHub.load_roles = [
The token will have the permissions listed in the role
(see [scopes][] for a list of available permissions),
but there will no longer be a user account created to house it.
The main noticeable difference is that there will be no notebook server associated with the account
The main noticeable difference between a user and a service is that there will be no notebook server associated with the account
and the service will not show up in the various user list pages and APIs.
## Make an API request
@@ -136,9 +164,8 @@ Authorization header.
### Use requests
Using the popular Python [requests](https://docs.python-requests.org)
library, here's example code to make an API request for the users of a JupyterHub
deployment. An API GET request is made, and the request sends an API token for
authorization. The response contains information about the users:
library, an API GET request is made, and the request sends an API token for
authorization. The response contains information about the users, here's example code to make an API request for the users of a JupyterHub deployment
```python
import requests
@@ -176,7 +203,8 @@ r.json()
```
The same API token can also authorize access to the [Jupyter Notebook REST API][]
provided by notebook servers managed by JupyterHub if it has the necessary `access:users:servers` scope:
provided by notebook servers managed by JupyterHub if it has the necessary `access:servers` scope.
(api-pagination)=
@@ -245,7 +273,7 @@ with your request, in which case a response will look like:
where the list results (same as pre-2.0) will be in `items`,
and pagination info will be in `_pagination`.
The `next` field will include the offset, limit, and URL for requesting the next page.
The `next` field will include the `offset`, `limit`, and `url` for requesting the next page.
`next` will be `null` if there is no next page.
Pagination is governed by two configuration options:
@@ -259,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
With JupyterHub version 0.8, support for multiple servers per user has landed.
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:
@@ -275,9 +303,9 @@ First you must enable named-servers by including the following setting in the `j
`c.JupyterHub.allow_named_servers = True`
If using the [zero-to-jupyterhub-k8s](https://github.com/jupyterhub/zero-to-jupyterhub-k8s) set-up to run JupyterHub,
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:
@@ -303,8 +331,9 @@ or kubernetes pods.
## Learn more about the API
You can see the full [JupyterHub REST API][] for 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
[scopes]: ../rbac/scopes.md
[jupyter notebook rest api]: https://petstore3.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/HEAD/notebook/services/api/api.yaml

View File

@@ -1,8 +1,10 @@
(separate-proxy)=
# Running proxy separately from the hub
## Background
The thing which users directly connect to is the proxy, by default
The thing which users directly connect to is the proxy, which by default is
`configurable-http-proxy`. The proxy either redirects users to the
hub (for login and managing servers), or to their own single-user
servers. Thus, as long as the proxy stays running, access to existing
@@ -10,16 +12,15 @@ servers continues, even if the hub itself restarts or goes down.
When you first configure the hub, you may not even realize this
because the proxy is automatically managed by the hub. This is great
for getting started and even most use, but everytime you restart the
hub, all user connections also get restarted. But it's also simple to
for getting started and even most use-cases, although, everytime you restart the
hub, all user connections are also restarted. However, it is also simple to
run the proxy as a service separate from the hub, so that you are free
to reconfigure the hub while only interrupting users who are currently
actively starting the hub.
to reconfigure the hub while only interrupting users who are waiting for their notebook server to start.
starting their notebook server.
The default JupyterHub proxy is
[configurable-http-proxy](https://github.com/jupyterhub/configurable-http-proxy),
and that page has some docs. If you are using a different proxy, such
as Traefik, these instructions are probably not relevant to you.
[configurable-http-proxy](https://github.com/jupyterhub/configurable-http-proxy). If you are using a different proxy, such
as [Traefik](https://github.com/traefik/traefik), these instructions are probably not relevant to you.
## Configuration options
@@ -40,9 +41,14 @@ set to the URL which the hub uses to connect _to the proxy's API_.
## Proxy configuration
You need to configure a service to start the proxy. An example
command line for this is `configurable-http-proxy --ip=127.0.0.1 --port=8000 --api-ip=127.0.0.1 --api-port=8001 --default-target=http://localhost:8081 --error-target=http://localhost:8081/hub/error`. (Details for how to
do this is out of scope for this tutorial - for example it might be a
systemd service on within another docker cotainer). The proxy has no
command line argument for this is:
```bash
$ configurable-http-proxy --ip=127.0.0.1 --port=8000 --api-ip=127.0.0.1 --api-port=8001 --default-target=http://localhost:8081 --error-target=http://localhost:8081/hub/error
```
(Details on how to do this is out of the scope of this tutorial. For example, it might be a
systemd service configured within another docker container). The proxy has no
configuration files, all configuration is via the command line and
environment variables.
@@ -57,9 +63,9 @@ match the token given to `c.ConfigurableHTTPProxy.auth_token`.
You should check the [configurable-http-proxy
options](https://github.com/jupyterhub/configurable-http-proxy) to see
what other options are needed, for example SSL options. Note that
these are configured in the hub if the hub is starting the proxy - you
need to move the options to here.
what other options are needed, for example, SSL options. Note that
these options are configured in the hub if the hub is starting the proxy, so you
need to configure the options there.
## Docker image

View File

@@ -1,28 +1,29 @@
# Working with templates and UI
The pages of the JupyterHub application are generated from
[Jinja](http://jinja.pocoo.org/) templates. These allow the header, for
[Jinja](https://jinja.palletsprojects.com) templates. These allow the header, for
example, to be defined once and incorporated into all pages. By providing
your own templates, you can have complete control over JupyterHub's
your own template(s), you can have complete control over JupyterHub's
appearance.
## Custom Templates
JupyterHub will look for custom templates in all of the paths in the
`JupyterHub.template_paths` configuration option, falling back on the
JupyterHub will look for custom templates in all paths included in the
`JupyterHub.template_paths` configuration option, falling back on these
[default templates](https://github.com/jupyterhub/jupyterhub/tree/HEAD/share/jupyterhub/templates)
if no custom template with that name is found. This fallback
behavior is new in version 0.9; previous versions searched only those paths
if no custom template(s) with specified name(s) are found. This fallback
behavior is new in version 0.9; previous versions searched only the paths
explicitly included in `template_paths`. You may override as many
or as few templates as you desire.
## Extending Templates
Jinja provides a mechanism to [extend templates](http://jinja.pocoo.org/docs/2.10/templates/#template-inheritance).
A base template can define a `block`, and child templates can replace or
supplement the material in the block. The
[JupyterHub templates](https://github.com/jupyterhub/jupyterhub/tree/HEAD/share/jupyterhub/templates)
make extensive use of blocks, which allows you to customize parts of the
Jinja provides a mechanism to [extend templates](https://jinja.palletsprojects.com/en/3.0.x/templates/#template-inheritance).
A base template can define `block`(s) within itself that child templates can fill up or
supply content to. The
[JupyterHub default templates](https://github.com/jupyterhub/jupyterhub/tree/HEAD/share/jupyterhub/templates)
make extensive use of blocks, thus allowing you to customize parts of the
interface easily.
In general, a child template can extend a base template, `page.html`, by beginning with:
@@ -40,15 +41,15 @@ file with this block:
{% extends "templates/page.html" %}
```
By defining `block`s with same name as in the base template, child templates
By defining `block`s with the same name as in the base template, child templates
can replace those sections with custom content. The content from the base
template can be included with the `{{ super() }}` directive.
template can be included in the child template with the `{{ super() }}` directive.
### Example
To add an additional message to the spawn-pending page, below the existing
text about the server starting up, place this content in a file named
`spawn_pending.html` in a directory included in the
text about the server starting up, place the content below in a file named
`spawn_pending.html`. This directory must also be included in the
`JupyterHub.template_paths` configuration option.
```html
@@ -61,7 +62,7 @@ text about the server starting up, place this content in a file named
To add announcements to be displayed on a page, you have two options:
- Extend the page templates as described above
- [Extend the page templates as described above](#extending-templates)
- Use configuration variables
### Announcement Configuration Variables
@@ -71,10 +72,10 @@ the top of all pages. The more specific variables
`announcement_login`, `announcement_spawn`, `announcement_home`, and
`announcement_logout` are more specific and only show on their
respective pages (overriding the global `announcement` variable).
Note that changing these variables require a restart, unlike direct
Note that changing these variables requires a restart, unlike direct
template extension.
You can get the same effect by extending templates, which allows you
Alternatively, you can get the same effect by extending templates, which allows you
to update the messages without restarting. Set
`c.JupyterHub.template_paths` as mentioned above, and then create a
template (for example, `login.html`) with:
@@ -84,5 +85,5 @@ template (for example, `login.html`) with:
```
Extending `page.html` puts the message on all pages, but note that
extending `page.html` take precedence over an extension of a specific
extending `page.html` takes precedence over an extension of a specific
page (unlike the variable-based approach above).

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: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1017 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 607 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

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,14 +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/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,157 +0,0 @@
==========
JupyterHub
==========
`JupyterHub`_ is the best way to serve `Jupyter notebook`_ for multiple users.
It can be used in a class of students, a corporate data science group or scientific
research group. It is a multi-user **Hub** that spawns, manages, and proxies multiple
instances of the single-user `Jupyter notebook`_ server.
To make life easier, JupyterHub has distributions. Be sure to
take a look at them before continuing with the configuration of the broad
original system of `JupyterHub`_. Today, you can find two main 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 even more 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>`__ .
Four subsystems make up JupyterHub:
* 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
Besides these central pieces, you can add optional configurations through a `config.py` file and manage users kernels on an admin panel. A simplification of the whole system can be seen 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.
The two popular ones are:
* `Zero to JupyterHub on Kubernetes <http://z2jh.jupyter.org>`_, for
running JupyterHub on top of `Kubernetes <https://k8s.io>`_. This
can scale to large number of machines & users.
* `The Littlest JupyterHub <http://tljh.jupyter.org>`_, for an easy
to set up & run JupyterHub supporting 1-100 users on a single machine.
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 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
contributing/index
About JupyterHub
----------------
.. toctree::
:maxdepth: 2
index-about
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
Questions? Suggestions?
=======================
- `Jupyter mailing list <https://groups.google.com/forum/#!forum/jupyter>`_
- `Jupyter website <https://jupyter.org>`_
.. _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,49 +0,0 @@
Using Docker
============
.. important::
We highly recommend following the `Zero to JupyterHub`_ tutorial for
installing JupyterHub.
Alternate installation using Docker
-----------------------------------
A ready to go `docker image <https://hub.docker.com/r/jupyterhub/jupyterhub/>`_
gives a straightforward deployment of JupyterHub.
.. 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, Jupyter Notebook version 4 or greater must be installed.
Starting JupyterHub with docker
-------------------------------
The JupyterHub docker image can be started with the following command::
docker run -d -p 8000:8000 --name jupyterhub jupyterhub/jupyterhub jupyterhub
This command will create a container named ``jupyterhub`` that you can
**stop and resume** with ``docker stop/start``.
The Hub service will be listening on all interfaces at port 8000, which makes
this a good choice for **testing JupyterHub on your desktop or laptop**.
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 a ssl enabled proxy.
`Mounting volumes <https://docs.docker.com/engine/admin/volumes/volumes/>`_
will allow you to store data outside the docker image (host system) so it will
be persistent, even when you start a new image.
The command ``docker exec -it jupyterhub bash`` will spawn a root shell in your
docker container. You can use the root shell to **create system users in the container**.
These accounts will be used for authentication in JupyterHub's default
configuration.
.. _Zero to JupyterHub: https://zero-to-jupyterhub.readthedocs.io/en/latest/

View File

@@ -1,3 +1,10 @@
<!---
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
Role Based Access Control (RBAC) in JupyterHub serves to provide fine grained control of access to Jupyterhub's API resources.

View File

@@ -1,23 +1,21 @@
(roles)=
# Roles
JupyterHub provides four roles that are available by default:
JupyterHub provides four (4) roles that are available by default:
```{admonition} **Default roles**
- `user` role provides a {ref}`default user scope <default-user-scope-target>` `self` that grants access to the user's own resources.
- `admin` role contains all available scopes and grants full rights to all actions. This role **cannot be edited**.
- `token` role provides a {ref}`default token scope <default-token-scope-target>` `all` that resolves to the same permissions as the owner of the token has.
- `token` role provides a {ref}`default token scope <default-token-scope-target>` `inherit` that resolves to the same permissions as the owner of the token has.
- `server` role allows for posting activity of "itself" only.
**These roles cannot be deleted.**
```
These default roles have a default collection of scopes,
but you can define the scopes associated with each role (excluding admin) to suit your needs,
We call these 'default' roles because they are available by default and have a default collection of scopes.
However, you can define the scopes associated with each role (excluding the admin role) to suit your needs,
as seen [below](overriding-default-roles).
The `user`, `admin`, and `token` roles by default all preserve the permissions prior to RBAC.
The `user`, `admin`, and `token` roles, by default, all preserve the permissions prior to Role-based Access Control (RBAC).
Only the `server` role is changed from pre-2.0, to reduce its permissions to activity-only
instead of the default of a full access token.
@@ -27,21 +25,20 @@ Roles can be assigned to the following entities:
- Users
- Services
- Groups
- Tokens
An entity can have zero, one, or multiple roles, and there are no restrictions on which roles can be assigned to which entity. Roles can be added to or removed from entities at any time.
**Users** \
When a new user gets created, they are assigned their default role `user`. Additionaly, if the user is created with admin privileges (via `c.Authenticator.admin_users` in `jupyterhub_config.py` or `admin: true` via API), they will be also granted `admin` role. If existing user's admin status changes via API or `jupyterhub_config.py`, their default role will be updated accordingly (after next startup for the latter).
When a new user gets created, they are assigned their default role, `user`. Additionally, if the user is created with admin privileges (via `c.Authenticator.admin_users` in `jupyterhub_config.py` or `admin: true` via API), they will be also granted `admin` role. If existing user's admin status changes via API or `jupyterhub_config.py`, their default role will be updated accordingly (after next startup for the latter).
**Services** \
Services do not have a default role. Services without roles have no access to the guarded API end-points, so most services will require assignment of a role in order to function.
Services do not have a default role. Services without roles have no access to the guarded API end-points. So, most services will require assignment of a role in order to function.
**Groups** \
A group does not require any role, and has no roles by default. If a user is a member of a group, they automatically inherit any of the group's permissions (see {ref}`resolving-roles-scopes-target` for more details). This is useful for assigning a set of common permissions to several users.
**Tokens** \
A tokens permissions are evaluated based on their owning entity. Since a token is always issued for a user or service, it can never have more permissions than its owner. If no specific role is requested for a new token, the token is assigned the `token` role.
A tokens permissions are evaluated based on their owning entity. Since a token is always issued for a user or service, it can never have more permissions than its owner. If no specific scopes are requested for a new token, the token is assigned the scopes of the `token` role.
(define-role-target)=
@@ -114,7 +111,7 @@ In case the role with a certain name already exists in the database, its definit
(overriding-default-roles)=
### Overriding default roles
### Overriding Default Roles
Role definitions can include those of the "default" roles listed above (admin excluded),
if the default scopes associated with those roles do not suit your deployment.
@@ -155,7 +152,7 @@ c.JupyterHub.load_roles = [
(removing-roles-target)=
## Removing roles
## Removing Roles
Only the entities present in the role definition in the `jupyterhub_config.py` remain the role bearers. If a user, service or group is removed from the role definition, they will lose the role on the next startup.

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