Compare commits

...

384 Commits

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

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

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

opt-in via `JUPYTERHUB_SINGLEUSER_EXTENSION=1`

related changes:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

- Fix missing header level 1 of Login page

- Fix low contrast issue of navbar

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

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

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

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

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

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

View File

@@ -84,6 +84,7 @@ jobs:
publish-docker:
runs-on: ubuntu-20.04
timeout-minutes: 30
services:
# So that we can test this in PRs/branches
@@ -108,10 +109,10 @@ jobs:
# https://github.com/docker/build-push-action/tree/v2.4.0#usage
# https://github.com/docker/build-push-action/blob/v2.4.0/docs/advanced/multi-platform.md
- name: Set up QEMU (for docker buildx)
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # associated tag: v1.0.2
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx (for multi-arch builds)
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325
uses: docker/setup-buildx-action@v2
with:
# Allows pushing to registry on localhost:5000
driver-opts: network=host
@@ -149,7 +150,7 @@ jobs:
branchRegex: ^\w[\w-.]*$
- name: Build and push jupyterhub
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
platforms: linux/amd64,linux/arm64
@@ -170,7 +171,7 @@ jobs:
branchRegex: ^\w[\w-.]*$
- name: Build and push jupyterhub-onbuild
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
build-args: |
BASE_IMAGE=${{ fromJson(steps.jupyterhubtags.outputs.tags)[0] }}
@@ -191,7 +192,7 @@ jobs:
branchRegex: ^\w[\w-.]*$
- name: Build and push jupyterhub-demo
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
build-args: |
BASE_IMAGE=${{ fromJson(steps.onbuildtags.outputs.tags)[0] }}
@@ -215,7 +216,7 @@ jobs:
branchRegex: ^\w[\w-.]*$
- name: Build and push jupyterhub/singleuser
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5
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"

View File

@@ -60,3 +60,15 @@ jobs:
- name: pytest docs/
run: |
pytest docs/
# readthedocs doesn't halt on warnings,
# so raise any warnings here
- name: build docs
run: |
cd docs
make html
- name: check links
run: |
cd docs
make linkcheck

View File

@@ -28,7 +28,7 @@ on:
env:
# UTF-8 content may be interpreted as ascii and causes errors without this.
LANG: C.UTF-8
PYTEST_ADDOPTS: "--verbose --color=yes"
SQLALCHEMY_WARN_20: "1"
permissions:
contents: read
@@ -78,15 +78,26 @@ jobs:
oldest_dependencies: oldest_dependencies
legacy_notebook: legacy_notebook
- python: "3.8"
legacy_notebook: legacy_notebook
jupyter_server: "1.*"
subset: singleuser
- python: "3.9"
db: mysql
- python: "3.10"
db: postgres
- python: "3.11"
subdomain: subdomain
serverextension: serverextension
- python: "3.11"
ssl: ssl
serverextension: serverextension
- python: "3.11"
subdomain: subdomain
noextension: noextension
subset: singleuser
- python: "3.11"
ssl: ssl
noextension: noextension
subset: singleuser
- python: "3.11"
selenium: selenium
- python: "3.11"
@@ -114,8 +125,10 @@ jobs:
echo "PGPASSWORD=hub[test/:?" >> $GITHUB_ENV
echo "JUPYTERHUB_TEST_DB_URL=postgresql://test_user:hub%5Btest%2F%3A%3F@127.0.0.1:5432/jupyterhub" >> $GITHUB_ENV
fi
if [ "${{ matrix.jupyter_server }}" != "" ]; then
echo "JUPYTERHUB_SINGLEUSER_APP=jupyterhub.tests.mockserverapp.MockServerApp" >> $GITHUB_ENV
if [ "${{ matrix.serverextension }}" != "" ]; then
echo "JUPYTERHUB_SINGLEUSER_EXTENSION=1" >> $GITHUB_ENV
elif [ "${{ matrix.noextension }}" != "" ]; then
echo "JUPYTERHUB_SINGLEUSER_EXTENSION=0" >> $GITHUB_ENV
fi
- uses: actions/checkout@v3
# NOTE: actions/setup-node@v3 make use of a cache within the GitHub base
@@ -140,7 +153,7 @@ jobs:
- name: Install Python dependencies
run: |
pip install --upgrade pip
pip install ".[test]"
pip install -e ".[test]"
if [ "${{ matrix.oldest_dependencies }}" != "" ]; then
# take any dependencies in requirements.txt such as tornado>=5.0
@@ -152,17 +165,24 @@ jobs:
if [ "${{ matrix.main_dependencies }}" != "" ]; then
pip install git+https://github.com/ipython/traitlets#egg=traitlets --force
pip install --upgrade --pre sqlalchemy
fi
if [ "${{ matrix.legacy_notebook }}" != "" ]; then
pip uninstall jupyter_server --yes
pip install 'notebook<7'
fi
if [ "${{ matrix.jupyter_server }}" != "" ]; then
pip install "jupyter_server==${{ matrix.jupyter_server }}"
fi
if [ "${{ matrix.db }}" == "mysql" ]; then
pip install mysql-connector-python
fi
if [ "${{ matrix.db }}" == "postgres" ]; then
pip install psycopg2-binary
fi
if [ "${{ matrix.serverextension }}" != "" ]; then
pip install 'jupyter-server>=2'
fi
pip freeze
@@ -206,15 +226,6 @@ jobs:
DB=postgres bash ci/docker-db.sh
DB=postgres bash ci/init-db.sh
fi
- name: Setup Firefox
if: matrix.selenium
uses: browser-actions/setup-firefox@latest
with:
firefox-version: latest
- name: Setup Geckodriver
if: matrix.selenium
uses: browser-actions/setup-geckodriver@latest
- name: Configure selenium tests
if: matrix.selenium
@@ -222,7 +233,7 @@ jobs:
- name: Run pytest
run: |
pytest --maxfail=2 --cov=jupyterhub jupyterhub/tests
pytest -k "${{ matrix.subset }}" --maxfail=2 --cov=jupyterhub jupyterhub/tests
- uses: codecov/codecov-action@v3

3
.gitignore vendored
View File

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

View File

@@ -8,18 +8,23 @@
# - Run on all files: pre-commit run --all-files
# - Register git hooks: pre-commit install --install-hooks
#
ci:
# pre-commit.ci will open PRs updating our hooks once a month
autoupdate_schedule: monthly
repos:
# Autoformat: Python code, syntax patterns are modernized
- repo: https://github.com/asottile/pyupgrade
rev: v3.2.2
rev: v3.3.1
hooks:
- id: pyupgrade
args:
- --py36-plus
- --py37-plus
# Autoformat: Python code
- repo: https://github.com/PyCQA/autoflake
rev: v2.0.0
rev: v2.0.1
hooks:
- id: autoflake
# args ref: https://github.com/PyCQA/autoflake#advanced-usage
@@ -28,19 +33,19 @@ repos:
# Autoformat: Python code
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
# Autoformat: Python code
- repo: https://github.com/psf/black
rev: 22.10.0
rev: 23.1.0
hooks:
- id: black
# Autoformat: markdown, yaml, javascript (see the file .prettierignore)
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.4
rev: v3.0.0-alpha.6
hooks:
- id: prettier

View File

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

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)
@@ -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)
@@ -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

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -6,7 +6,7 @@ info:
description: The REST API for JupyterHub
license:
name: BSD-3-Clause
version: 3.1.0
version: 4.0.0b2
servers:
- url: /hub/api
security:
@@ -815,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
@@ -1289,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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -20,8 +20,6 @@ from jupyterhub.app import JupyterHub
project = "JupyterHub"
author = "Project Jupyter Contributors"
copyright = f"{datetime.date.today().year}, {author}"
version = "%i.%i" % jupyterhub.version_info[:2]
release = jupyterhub.__version__
# -- General Sphinx configuration --------------------------------------------
@@ -36,10 +34,11 @@ extensions = [
"sphinx-jsonschema",
"sphinxext.opengraph",
"sphinxext.rediraffe",
"jupyterhub_sphinx_theme",
"myst_parser",
]
root_doc = "index"
source_suffix = [".md", ".rst"]
source_suffix = [".md"]
# default_role let's use use `foo` instead of ``foo`` in rST
default_role = "literal"
@@ -48,11 +47,22 @@ default_role = "literal"
# ref: https://myst-parser.readthedocs.io/en/latest/configuration.html
#
myst_heading_anchors = 2
myst_enable_extensions = [
# available extensions: https://myst-parser.readthedocs.io/en/latest/syntax/optional.html
"attrs_inline",
"colon_fence",
"deflist",
"fieldlist",
"substitution",
]
myst_substitutions = {
# date example: Dev 07, 2022
"date": datetime.date.today().strftime("%b %d, %Y").title(),
"version": jupyterhub.__version__,
}
# -- Custom directives to generate documentation -----------------------------
# ref: https://myst-parser.readthedocs.io/en/latest/syntax/roles-and-directives.html
@@ -146,18 +156,13 @@ html_logo = "_static/images/logo/logo.png"
html_favicon = "_static/images/logo/favicon.ico"
html_static_path = ["_static"]
html_theme = "pydata_sphinx_theme"
html_theme = "jupyterhub_sphinx_theme"
html_theme_options = {
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/jupyterhub/jupyterhub",
"icon": "fab fa-github-square",
},
{
"name": "Discourse",
"url": "https://discourse.jupyter.org/c/jupyterhub/10",
"icon": "fab fa-discourse",
"icon": "fa-brands fa-github",
},
],
"use_edit_page_button": True,
@@ -180,20 +185,24 @@ linkcheck_ignore = [
r"https://github.com/[^/]*$", # too many github usernames / searches in changelog
"https://github.com/jupyterhub/jupyterhub/pull/", # too many PRs in changelog
"https://github.com/jupyterhub/jupyterhub/compare/", # too many comparisons in changelog
r"https?://(localhost|127.0.0.1).*", # ignore localhost references in auto-links
r".*/rest-api.html#.*", # ignore javascript-resolved internal rest-api links
r"https://jupyter.chameleoncloud.org", # FIXME: ignore (presumably) short-term SSL issue
]
linkcheck_anchors_ignore = [
"/#!",
"/#%21",
]
# -- Intersphinx -------------------------------------------------------------
# ref: https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#configuration
#
intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"tornado": ("https://www.tornadoweb.org/en/stable/", None),
"jupyter-server": ("https://jupyter-server.readthedocs.io/en/stable/", None),
}
# -- Options for the opengraph extension -------------------------------------
# ref: https://github.com/wpilibsuite/sphinxext-opengraph#options
#
@@ -205,11 +214,29 @@ ogp_use_first_image = True
# -- Options for the rediraffe extension -------------------------------------
# ref: https://github.com/wpilibsuite/sphinxext-rediraffe#readme
#
# This extensions help us relocated content without breaking links. If a
# document is moved internally, a redirect like should be configured below to
# This extension helps us relocate content without breaking links. If a
# document is moved internally, a redirect link should be configured as below to
# help us not break links.
#
# 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 = "main"
rediraffe_redirects = {
# "old-file": "new-folder/new-file-name",
}
rediraffe_redirects = "redirects.txt"
# rediraffe_redirects = {
# "old-file": "new-folder/new-file-name",
# }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,155 @@
(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 well tested with JupyterHub.
[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
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.
## 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.
### MySQL / MariaDB
- You should use the `pymysql` sqlalchemy provider (the other one, MySQLdb,
isn't available for py3).
- You also need to set `pool_recycle` to some value (typically 60 - 300)
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.

View File

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

View File

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

View File

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

View File

@@ -1,3 +1,5 @@
(web-security)=
# Security Overview
The **Security Overview** section helps you learn about:
@@ -131,4 +133,4 @@ 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).

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

@@ -71,7 +71,7 @@ Here is a sample of organizations that use JupyterHub:
- **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?
@@ -132,7 +132,7 @@ users.
- For security considerations in the base JupyterHub application,
[see the JupyterHub security page](https://jupyterhub.readthedocs.io/en/stable/reference/websecurity.html).
- For security considerations when deploying JupyterHub on Kubernetes, see the
[JupyterHub on Kubernetes security page](https://zero-to-jupyterhub.readthedocs.io/en/latest/security.html).
[JupyterHub on Kubernetes security page](https://z2jh.jupyter.org/en/latest/security.html).
The longer answer: it depends on your deployment. Because JupyterHub is very flexible, it can be used
in a variety of deployment setups. This often entails connecting your JupyterHub to **other** infrastructure

View File

@@ -1,3 +1,5 @@
(troubleshooting)=
# Troubleshooting
When troubleshooting, you may see unexpected behaviors or receive an error

View File

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

View File

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

View File

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

View File

@@ -57,6 +57,24 @@ The typical locations for these config files are:
- **system-wide** in `/etc/{jupyter|ipython}`
- **env-wide** (environment wide) in `{sys.prefix}/etc/{jupyter|ipython}`.
### Jupyter environment configuration priority
When Jupyter runs in an environment (conda or virtualenv), it prefers to load configuration from the environment over each user's own configuration (e.g. in `~/.jupyter`).
This may cause issues if you use a _shared_ conda environment or virtualenv for users, because e.g. jupyterlab may try to write information like workspaces or settings to the environment instead of the user's own directory.
This could fail with something like `Permission denied: $PREFIX/etc/jupyter/lab`.
To avoid this issue, set `JUPYTER_PREFER_ENV_PATH=0` in the user environment:
```python
c.Spawner.environment.update(
{
"JUPYTER_PREFER_ENV_PATH": "0",
}
)
```
which tells Jupyter to prefer _user_ configuration paths (e.g. in `~/.jupyter`) to configuration set in the environment.
### Example: Enable an extension system-wide
For example, to enable the `cython` IPython extension for all of your users, create the file `/etc/ipython/ipython_config.py`:
@@ -153,11 +171,11 @@ c.JupyterHub.allow_named_servers = True
Named servers were implemented in the REST API in JupyterHub 0.8,
and JupyterHub 1.0 introduces UI for managing named servers via the user home page:
![named servers on the home page](../images/named-servers-home.png)
![named servers on the home page](/images/named-servers-home.png)
as well as the admin page:
![named servers on the admin page](../images/named-servers-admin.png)
![named servers on the admin page](/images/named-servers-admin.png)
Named servers can be accessed, created, started, stopped, and deleted
from these pages. Activity tracking is now per server as well.
@@ -184,6 +202,8 @@ This can be useful for quota service implementations. The example above limits t
If `named_server_limit_per_user` is set to `0`, no limit is enforced.
When using named servers, Spawners may need additional configuration to take the `servername` into account. Whilst `KubeSpawner` takes the `servername` into account by default in [`pod_name_template`](https://jupyterhub-kubespawner.readthedocs.io/en/latest/spawner.html#kubespawner.KubeSpawner.pod_name_template), other Spawners may not. Check the documentation for the specific Spawner to see how singleuser servers are named, for example in `DockerSpawner` this involves modifying the [`name_template`](https://jupyterhub-dockerspawner.readthedocs.io/en/latest/api/index.html) setting to include `servername`, eg. `"{prefix}-{username}-{servername}"`.
(classic-notebook-ui)=
## Switching back to the classic notebook

View File

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

View File

@@ -1,4 +1,4 @@
(rest-api)=
(using-jupyterhub-rest-api)=
# Using JupyterHub's REST API
@@ -19,7 +19,7 @@ Hub.
## What you can do with the API
Using the [JupyterHub REST API][], you can perform actions on the Hub,
Using the [JupyterHub REST API](jupyterhub-rest-API), you can perform actions on the Hub,
such as:
- Checking which users are active
@@ -57,7 +57,7 @@ jupyterhub token <username>
This command generates a random string to use as a token and registers
it for the given user with the Hub's database.
In [version 0.8.0](../changelog.md), a token request page for
In [version 0.8.0](changelog), a token request page for
generating an API token is available from the JupyterHub user interface:
:::{figure-md}
@@ -276,7 +276,7 @@ Pagination is enabled on the `GET /users`, `GET /groups`, and `GET /proxy` REST
## Enabling users to spawn multiple named-servers via the API
Support for multiple servers per user was introduced in JupyterHub [version 0.8.](../changelog.md)
Support for multiple servers per user was introduced in JupyterHub [version 0.8.](changelog)
Prior to that, each user could only launch a single default server via the API
like this:
@@ -294,7 +294,7 @@ First you must enable named-servers by including the following setting in the `j
If you are using the [zero-to-jupyterhub-k8s](https://github.com/jupyterhub/zero-to-jupyterhub-k8s) set-up to run JupyterHub,
then instead of editing the `jupyterhub_config.py` file directly, you could pass
the following as part of the `config.yaml` file, as per the [tutorial](https://zero-to-jupyterhub.readthedocs.io/en/latest/):
the following as part of the `config.yaml` file, as per the [tutorial](https://z2jh.jupyter.org/en/latest/):
```bash
hub:
@@ -320,7 +320,7 @@ or kubernetes pods.
## Learn more about the API
You can see the full [JupyterHub REST API][] for more details.
You can see the full [JupyterHub REST API](jupyterhub-rest-api) for more details.
[openapi initiative]: https://www.openapis.org/
[jupyterhub rest api]: ./rest-api

View File

@@ -1,3 +1,5 @@
(separate-proxy)=
# Running proxy separately from the hub
## Background

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

View File

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

View File

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

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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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

@@ -0,0 +1,23 @@
# This file contains rediraffe redirects as generated from the docs/source/conf.py file
# For more information, see rediraffe configuration in the conf.py file.
"changelog.md" "reference/changelog.md"
"getting-started/faq.md" "faq/faq.md"
"reference/api-only.md" "howto/api-only.md"
"reference/config-ghoauth.md" "howto/configuration/config-ghoauth.md"
"reference/config-proxy.md" "howto/configuration/config-proxy.md"
"admin/log-messages.md" "howto/log-messages.md"
"reference/proxy.md" "howto/proxy.md"
"reference/templates.md" "howto/templates.md"
"quickstart-docker.md" "tutorial/quickstart-docker.md"
"reference/config-examples.md" "howto/index.md"
"getting-started/institutional-faq.md" "faq/institutional-faq.md"
"troubleshooting.md" "faq/troubleshooting.md"
"reference/config-sudo.md" "howto/configuration/config-sudo.md"
"reference/config-user-env.md" "howto/configuration/config-user-env.md"
"reference/rest.md" "howto/rest.md"
"reference/separate-proxy.md" "howto/separate-proxy.md"
"admin/upgrading.md" "howto/upgrading.md"
"installation-basics.md" "tutorial/installation-basics.md"
"quickstart.md" "tutorial/quickstart.md"
"events/index.md" "reference/event-logging.md"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,3 +1,5 @@
(authenticators-reference)=
# Authenticators
The {class}`.Authenticator` is the mechanism for authorizing users to use the

View File

@@ -1,3 +1,5 @@
(changelog)=
# Changelog
For detailed changes from the prior release, click on the version number, and
@@ -6,8 +8,134 @@ command line for details.
## [Unreleased]
### 4.0 (beta) - 2023-XX-YY
4.0 is a major release, but a small one.
There are three major changes that _should_ be invisible to most users:
1. Groups can now have 'properties', editable via the admin page, which can be used by Spawners for their operations.
This requires a db schema upgrade, so remember to [**backup and upgrade your database**](upgrading-jupyterhub)!
2. Often-problematic header-based checks for cross-site requests have been replaces with more standard use of XSRF tokens.
Most folks shouldn't notice this change, but if "Blocking Cross Origin API request" has been giving you headaches, this should be much improved.
3. Improved support for Jupyter Server 2.0 by reimplementing `jupyterhub-singleuser` as a standard _server extension_.
This mode is used by default with Jupyter Server >=2.0.
Again, this should be an implementation detail to most, but it's a big change under the hood.
If you have issues, please let us know and you can opt-out by setting `JUPYTERHUB_SINGLEUSER_EXTENSION=0` in your single-user environment.
In addition to these, thanks to contributions from this years Outreachy interns, we have reorganized the documentation according to [diataxis](https://diataxis.fr), improved accessibility of JupyterHub pages, and improved testing.
([full changelog](https://github.com/jupyterhub/jupyterhub/compare/3.1.0...HEAD))
#### API and Breaking Changes
- require sqlalchemy 1.4 [#4319](https://github.com/jupyterhub/jupyterhub/pull/4319) ([@minrk](https://github.com/minrk), [@manics](https://github.com/manics))
- Use XSRF tokens for cross-site checks [#4032](https://github.com/jupyterhub/jupyterhub/pull/4032) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio), [@julietKiloRomeo](https://github.com/julietKiloRomeo))
#### New features added
- Make singleuser server-extension default [#4354](https://github.com/jupyterhub/jupyterhub/pull/4354) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- singleuser auth as server extension [#3888](https://github.com/jupyterhub/jupyterhub/pull/3888) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Dynamic table for changing customizable properties of groups [#3651](https://github.com/jupyterhub/jupyterhub/pull/3651) ([@vladfreeze](https://github.com/vladfreeze), [@minrk](https://github.com/minrk), [@naatebarber](https://github.com/naatebarber), [@manics](https://github.com/manics))
#### Enhancements made
- add a few more buckets for server_spawn_duration_seconds [#4352](https://github.com/jupyterhub/jupyterhub/pull/4352) ([@shaneknapp](https://github.com/shaneknapp), [@yuvipanda](https://github.com/yuvipanda))
- Improve contrast on muted text [#4326](https://github.com/jupyterhub/jupyterhub/pull/4326) ([@bl-aire](https://github.com/bl-aire), [@minrk](https://github.com/minrk))
- Standardize styling on input fields by moving common form CSS to page.less [#4294](https://github.com/jupyterhub/jupyterhub/pull/4294) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
#### Bugs fixed
- fix inclusion of singleuser/templates/page.html in wheel [#4387](https://github.com/jupyterhub/jupyterhub/pull/4387) ([@consideRatio](https://github.com/consideRatio), [@minrk](https://github.com/minrk))
- exponential_backoff: preserve jitter when max_wait is reached [#4383](https://github.com/jupyterhub/jupyterhub/pull/4383) ([@minrk](https://github.com/minrk), [@manics](https://github.com/manics))
- admin panel: fix condition for start/stop buttons on user servers [#4365](https://github.com/jupyterhub/jupyterhub/pull/4365) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- avoid logging error when browsers send invalid cookies [#4356](https://github.com/jupyterhub/jupyterhub/pull/4356) ([@minrk](https://github.com/minrk), [@manics](https://github.com/manics), [@consideRatio](https://github.com/consideRatio))
- test and fix deprecated load_groups list [#4299](https://github.com/jupyterhub/jupyterhub/pull/4299) ([@minrk](https://github.com/minrk), [@manics](https://github.com/manics))
- Fix formatting of load_groups help string [#4295](https://github.com/jupyterhub/jupyterhub/pull/4295) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Fix skipped heading level across pages [#4290](https://github.com/jupyterhub/jupyterhub/pull/4290) ([@bl-aire](https://github.com/bl-aire), [@minrk](https://github.com/minrk))
- Fix reoccurring accessibility issues in JupyterHub's pages [#4274](https://github.com/jupyterhub/jupyterhub/pull/4274) ([@bl-aire](https://github.com/bl-aire), [@minrk](https://github.com/minrk))
- Remove remnants of unused jupyterhub-services cookie [#4258](https://github.com/jupyterhub/jupyterhub/pull/4258) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
#### Maintenance and upkeep improvements
- Selenium: updating test_oauth_page [#4393](https://github.com/jupyterhub/jupyterhub/pull/4393) ([@mouse1203](https://github.com/mouse1203), [@minrk](https://github.com/minrk))
- avoid warning on engine_connect listener [#4392](https://github.com/jupyterhub/jupyterhub/pull/4392) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio), [@manics](https://github.com/manics))
- remove pin from singleuser [#4379](https://github.com/jupyterhub/jupyterhub/pull/4379) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio), [@mathbunnyru](https://github.com/mathbunnyru))
- temporary fix: pin base-notebook tag [#4348](https://github.com/jupyterhub/jupyterhub/pull/4348) ([@minrk](https://github.com/minrk))
- simplify some async fixtures [#4332](https://github.com/jupyterhub/jupyterhub/pull/4332) ([@minrk](https://github.com/minrk), [@GeorgianaElena](https://github.com/GeorgianaElena), [@Sheila-nk](https://github.com/Sheila-nk))
- Selenium: adding new cases that covered Admin UI page [#4328](https://github.com/jupyterhub/jupyterhub/pull/4328) ([@mouse1203](https://github.com/mouse1203), [@minrk](https://github.com/minrk))
- also ignore sqlite backups [#4327](https://github.com/jupyterhub/jupyterhub/pull/4327) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- pre-commit: bump isort [#4325](https://github.com/jupyterhub/jupyterhub/pull/4325) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Remove no longer relevant notice in readme [#4324](https://github.com/jupyterhub/jupyterhub/pull/4324) ([@consideRatio](https://github.com/consideRatio), [@minrk](https://github.com/minrk))
- Fix the oauthenticator docs api links [#4304](https://github.com/jupyterhub/jupyterhub/pull/4304) ([@GeorgianaElena](https://github.com/GeorgianaElena), [@minrk](https://github.com/minrk))
- Selenium testing: adding new case covered the authorisation page [#4298](https://github.com/jupyterhub/jupyterhub/pull/4298) ([@mouse1203](https://github.com/mouse1203), [@minrk](https://github.com/minrk))
- docs: fix linkcheck in gallery [#4297](https://github.com/jupyterhub/jupyterhub/pull/4297) ([@minrk](https://github.com/minrk))
- Refactored selenium tests for improved readability [#4278](https://github.com/jupyterhub/jupyterhub/pull/4278) ([@mouse1203](https://github.com/mouse1203), [@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- remove deprecated import of pipes.quote [#4273](https://github.com/jupyterhub/jupyterhub/pull/4273) ([@minrk](https://github.com/minrk), [@manics](https://github.com/manics))
- only run testing config on localhost [#4271](https://github.com/jupyterhub/jupyterhub/pull/4271) ([@minrk](https://github.com/minrk), [@manics](https://github.com/manics))
- pre-commit: autoupdate monthly [#4268](https://github.com/jupyterhub/jupyterhub/pull/4268) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio), [@GeorgianaElena](https://github.com/GeorgianaElena), [@betatim](https://github.com/betatim))
- remove unnecessary actions for firefox/geckodriver [#4264](https://github.com/jupyterhub/jupyterhub/pull/4264) ([@minrk](https://github.com/minrk), [@manics](https://github.com/manics))
- docs: refresh Makefile/make.bat [#4256](https://github.com/jupyterhub/jupyterhub/pull/4256) ([@consideRatio](https://github.com/consideRatio), [@minrk](https://github.com/minrk))
- Test docs, links on CI [#4251](https://github.com/jupyterhub/jupyterhub/pull/4251) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- maint: fix detail when removing support for py36 [#4248](https://github.com/jupyterhub/jupyterhub/pull/4248) ([@consideRatio](https://github.com/consideRatio), [@manics](https://github.com/manics))
- more selenium test cases [#4207](https://github.com/jupyterhub/jupyterhub/pull/4207) ([@mouse1203](https://github.com/mouse1203), [@minrk](https://github.com/minrk))
#### Documentation improvements
- Add emphasis about role loading and hub restarts. [#4390](https://github.com/jupyterhub/jupyterhub/pull/4390) ([@ryanlovett](https://github.com/ryanlovett), [@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Re-enable links to REST API [#4386](https://github.com/jupyterhub/jupyterhub/pull/4386) ([@minrk](https://github.com/minrk), [@manics](https://github.com/manics))
- reduce nested hierarchy in docs organization [#4377](https://github.com/jupyterhub/jupyterhub/pull/4377) ([@alwasega](https://github.com/alwasega), [@minrk](https://github.com/minrk))
- changelog for 4.0 beta [#4375](https://github.com/jupyterhub/jupyterhub/pull/4375) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Getting started link broken [#4374](https://github.com/jupyterhub/jupyterhub/pull/4374) ([@3coins](https://github.com/3coins), [@minrk](https://github.com/minrk))
- add collaboration accounts tutorial [#4373](https://github.com/jupyterhub/jupyterhub/pull/4373) ([@minrk](https://github.com/minrk), [@fperez](https://github.com/fperez), [@ryanlovett](https://github.com/ryanlovett))
- Updated the top-level index file [#4368](https://github.com/jupyterhub/jupyterhub/pull/4368) ([@alwasega](https://github.com/alwasega), [@sgibson91](https://github.com/sgibson91))
- JupyterHub sphinx theme [#4363](https://github.com/jupyterhub/jupyterhub/pull/4363) ([@minrk](https://github.com/minrk), [@choldgraf](https://github.com/choldgraf))
- Remove PDF links from README.md [#4358](https://github.com/jupyterhub/jupyterhub/pull/4358) ([@pnasrat](https://github.com/pnasrat), [@manics](https://github.com/manics))
- add singleuser explanation doc [#4357](https://github.com/jupyterhub/jupyterhub/pull/4357) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Updates to the documentation Contribution section [#4355](https://github.com/jupyterhub/jupyterhub/pull/4355) ([@alwasega](https://github.com/alwasega), [@sgibson91](https://github.com/sgibson91), [@minrk](https://github.com/minrk))
- Restructured references section of the docs [#4343](https://github.com/jupyterhub/jupyterhub/pull/4343) ([@alwasega](https://github.com/alwasega), [@minrk](https://github.com/minrk), [@sgibson91](https://github.com/sgibson91))
- Document use of pytest-asyncio in JupyterHub test suite [#4341](https://github.com/jupyterhub/jupyterhub/pull/4341) ([@Sheila-nk](https://github.com/Sheila-nk), [@minrk](https://github.com/minrk), [@alwasega](https://github.com/alwasega))
- Moved Explanation/Background files [#4340](https://github.com/jupyterhub/jupyterhub/pull/4340) ([@alwasega](https://github.com/alwasega), [@sgibson91](https://github.com/sgibson91), [@minrk](https://github.com/minrk))
- Moved last set of Tutorials [#4338](https://github.com/jupyterhub/jupyterhub/pull/4338) ([@alwasega](https://github.com/alwasega), [@sgibson91](https://github.com/sgibson91))
- fix a couple ref links in changelog [#4334](https://github.com/jupyterhub/jupyterhub/pull/4334) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Added rediraffe using auto redirect builder [#4331](https://github.com/jupyterhub/jupyterhub/pull/4331) ([@alwasega](https://github.com/alwasega), [@sgibson91](https://github.com/sgibson91), [@GeorgianaElena](https://github.com/GeorgianaElena), [@consideRatio](https://github.com/consideRatio), [@manics](https://github.com/manics))
- Backport PR #4316 on branch 3.x (changelog for 3.1.1) [#4318](https://github.com/jupyterhub/jupyterhub/pull/4318) ([@minrk](https://github.com/minrk))
- changelog for 3.1.1 [#4316](https://github.com/jupyterhub/jupyterhub/pull/4316) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- Moved second half of HowTo documentation [#4314](https://github.com/jupyterhub/jupyterhub/pull/4314) ([@alwasega](https://github.com/alwasega), [@sgibson91](https://github.com/sgibson91), [@minrk](https://github.com/minrk))
- Moved first half of HowTo documentation [#4311](https://github.com/jupyterhub/jupyterhub/pull/4311) ([@alwasega](https://github.com/alwasega), [@sgibson91](https://github.com/sgibson91), [@minrk](https://github.com/minrk))
- number agreement in authenticators-users-basics [#4309](https://github.com/jupyterhub/jupyterhub/pull/4309) ([@TaofeeqatDev](https://github.com/TaofeeqatDev), [@minrk](https://github.com/minrk))
- transferred docs to the FAQ folder [#4307](https://github.com/jupyterhub/jupyterhub/pull/4307) ([@alwasega](https://github.com/alwasega), [@sgibson91](https://github.com/sgibson91), [@minrk](https://github.com/minrk), [@GeorgianaElena](https://github.com/GeorgianaElena))
- Added docs to the folder [#4305](https://github.com/jupyterhub/jupyterhub/pull/4305) ([@alwasega](https://github.com/alwasega), [@sgibson91](https://github.com/sgibson91), [@minrk](https://github.com/minrk))
- Created folders to house the restructured documentation [#4301](https://github.com/jupyterhub/jupyterhub/pull/4301) ([@alwasega](https://github.com/alwasega), [@sgibson91](https://github.com/sgibson91), [@minrk](https://github.com/minrk), [@manics](https://github.com/manics), [@GeorgianaElena](https://github.com/GeorgianaElena))
- expand database docs [#4292](https://github.com/jupyterhub/jupyterhub/pull/4292) ([@minrk](https://github.com/minrk), [@GeorgianaElena](https://github.com/GeorgianaElena), [@ajpower](https://github.com/ajpower), [@consideRatio](https://github.com/consideRatio), [@manics](https://github.com/manics), [@sgibson91](https://github.com/sgibson91))
- added note on `Spawner.name_template` setting [#4288](https://github.com/jupyterhub/jupyterhub/pull/4288) ([@stevejpurves](https://github.com/stevejpurves), [@minrk](https://github.com/minrk))
- Document JUPYTER_PREFER_ENV_PATH=0 for shared user environments [#4269](https://github.com/jupyterhub/jupyterhub/pull/4269) ([@minrk](https://github.com/minrk), [@manics](https://github.com/manics))
- set max depth on api/index toctree [#4259](https://github.com/jupyterhub/jupyterhub/pull/4259) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- fix bracket typo in capacity figures [#4250](https://github.com/jupyterhub/jupyterhub/pull/4250) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- convert remaining rst files to myst [#4249](https://github.com/jupyterhub/jupyterhub/pull/4249) ([@minrk](https://github.com/minrk), [@consideRatio](https://github.com/consideRatio))
- doc: fix formatting of spawner env-vars [#4245](https://github.com/jupyterhub/jupyterhub/pull/4245) ([@manics](https://github.com/manics), [@consideRatio](https://github.com/consideRatio), [@minrk](https://github.com/minrk))
#### Contributors to this release
The following people contributed discussions, new ideas, code and documentation contributions, and review.
See [our definition of contributors](https://github-activity.readthedocs.io/en/latest/#how-does-this-tool-define-contributions-in-the-reports).
([GitHub contributors page for this release](https://github.com/jupyterhub/jupyterhub/graphs/contributors?from=2022-12-05&to=2023-03-15&type=c))
@3coins ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3A3coins+updated%3A2022-12-05..2023-03-15&type=Issues)) | @ajcollett ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aajcollett+updated%3A2022-12-05..2023-03-15&type=Issues)) | @ajpower ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aajpower+updated%3A2022-12-05..2023-03-15&type=Issues)) | @alwasega ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aalwasega+updated%3A2022-12-05..2023-03-15&type=Issues)) | @betatim ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Abetatim+updated%3A2022-12-05..2023-03-15&type=Issues)) | @bl-aire ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Abl-aire+updated%3A2022-12-05..2023-03-15&type=Issues)) | @choldgraf ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Acholdgraf+updated%3A2022-12-05..2023-03-15&type=Issues)) | @consideRatio ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AconsideRatio+updated%3A2022-12-05..2023-03-15&type=Issues)) | @dependabot ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Adependabot+updated%3A2022-12-05..2023-03-15&type=Issues)) | @fperez ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Afperez+updated%3A2022-12-05..2023-03-15&type=Issues)) | @GeorgianaElena ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AGeorgianaElena+updated%3A2022-12-05..2023-03-15&type=Issues)) | @julietKiloRomeo ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AjulietKiloRomeo+updated%3A2022-12-05..2023-03-15&type=Issues)) | @ktaletsk ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aktaletsk+updated%3A2022-12-05..2023-03-15&type=Issues)) | @manics ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Amanics+updated%3A2022-12-05..2023-03-15&type=Issues)) | @mathbunnyru ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Amathbunnyru+updated%3A2022-12-05..2023-03-15&type=Issues)) | @meeseeksdev ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ameeseeksdev+updated%3A2022-12-05..2023-03-15&type=Issues)) | @meeseeksmachine ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ameeseeksmachine+updated%3A2022-12-05..2023-03-15&type=Issues)) | @minrk ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aminrk+updated%3A2022-12-05..2023-03-15&type=Issues)) | @mouse1203 ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Amouse1203+updated%3A2022-12-05..2023-03-15&type=Issues)) | @naatebarber ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Anaatebarber+updated%3A2022-12-05..2023-03-15&type=Issues)) | @pnasrat ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Apnasrat+updated%3A2022-12-05..2023-03-15&type=Issues)) | @pre-commit-ci ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Apre-commit-ci+updated%3A2022-12-05..2023-03-15&type=Issues)) | @ryanlovett ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aryanlovett+updated%3A2022-12-05..2023-03-15&type=Issues)) | @sgibson91 ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Asgibson91+updated%3A2022-12-05..2023-03-15&type=Issues)) | @shaneknapp ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ashaneknapp+updated%3A2022-12-05..2023-03-15&type=Issues)) | @Sheila-nk ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3ASheila-nk+updated%3A2022-12-05..2023-03-15&type=Issues)) | @stevejpurves ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Astevejpurves+updated%3A2022-12-05..2023-03-15&type=Issues)) | @TaofeeqatDev ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3ATaofeeqatDev+updated%3A2022-12-05..2023-03-15&type=Issues)) | @vladfreeze ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Avladfreeze+updated%3A2022-12-05..2023-03-15&type=Issues)) | @yuvipanda ([activity](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ayuvipanda+updated%3A2022-12-05..2023-03-15&type=Issues))
## 3.1
### 3.1.1 - 2023-01-27
3.1.1 has only tiny bugfixes, enabling compatibility with the latest sqlalchemy 2.0 release, and fixing some metadata files that were not being included in wheel installs.
([full changelog](https://github.com/jupyterhub/jupyterhub/compare/3.1.0...3.1.1))
#### Bugs fixed
- Backport PR #4303 on branch 3.x: make sure event-schemas are installed [#4317](https://github.com/jupyterhub/jupyterhub/pull/4317) ([@minrk](https://github.com/minrk))
- Backport PR #4302 on branch 3.x: sqlalchemy 2 compatibility [#4315](https://github.com/jupyterhub/jupyterhub/pull/4315) ([@minrk](https://github.com/minrk))
### 3.1.0 - 2022-12-05
3.1.0 is a small release, fixing various bugs and introducing some small new features and metrics.
@@ -183,18 +311,18 @@ This can be used to e.g. limit student/grader/instructor permissions in a gradin
or grant instructors read-only access to their students' single-user servers starting with upcoming Jupyter Server 2.0.
Further extending granular control of permissions,
we have added `!service` and `!server` filters for scopes (:ref:`self-referencing-filters`),
we have added `!service` and `!server` filters for scopes ({ref}`self-referencing-filters`),
like we had for `!user`.
Access to the admin UI is now governed by a dedicated `admin-ui` scope,
rather than combined `admin:servers` and `admin:users` in 2.0.
More info in `ref`{available-scopes-target}.
More info in {ref}`available-scopes-target`.
#### More highlights
- The admin UI can now show more detailed info about users and their servers in a drop-down details table:
![Details view in admin UI](./images/dropdown-details-3.0.png)
![Details view in admin UI](/images/dropdown-details-3.0.png)
- Several bugfixes and improvements in the new admin UI.
- Direct access to the Hub's database is deprecated.
@@ -568,10 +696,10 @@ default 'user' role as expected.
JupyterHub 2.0 is a big release!
The most significant change is the addition of [roles and scopes][rbac]
The most significant change is the addition of [roles and scopes](rbac)
to the JupyterHub permissions model,
allowing more fine-grained access control.
Read more about it [in the docs][rbac].
Read more about it [in the docs](rbac).
In particular, the 'admin' level of permissions should not be needed anymore,
and you can now grant users and services only the permissions they need, not more.
@@ -581,7 +709,7 @@ and consider assigning only the necessary roles and scopes.
[rbac]: ./rbac/index.md
JupyterHub 2.0 requires an update to the database schema,
so **make sure to [read the upgrade documentation and backup your database](admin/upgrading)
so **make sure to [read the upgrade documentation and backup your database](upgrading-jupyterhub)
before upgrading**.
:::{admonition} stop all servers before upgrading
@@ -1342,7 +1470,7 @@ whether it was through discussion, testing, documentation, or development.
- There is now full UI support for managing named servers.
With named servers, each jupyterhub user may have access to more than one named server. For example, a professor may access a server named `research` and another named `teaching`.
![named servers on the home page](./images/named-servers-home.png)
![named servers on the home page](/images/named-servers-home.png)
- Authenticators can now expire and refresh authentication data by implementing
`Authenticator.refresh_user(user)`.

View File

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

View File

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

View File

@@ -1,30 +0,0 @@
==============================
Configuration Reference
==============================
.. important::
Make sure the version of JupyterHub for this documentation matches your
installation version, as the output of this command may change between versions.
JupyterHub configuration
------------------------
As explained in the `Configuration Basics <../getting-started/config-basics.html#generate-a-default-config-file>`_
section, the ``jupyterhub_config.py`` can be automatically generated via
.. code-block:: bash
jupyterhub --generate-config
The following contains the output of that command for reference.
.. jupyterhub-generate-config::
JupyterHub help command output
------------------------------
This section contains the output of the command ``jupyterhub --help-all``.
.. jupyterhub-help-all::

View File

@@ -1,62 +0,0 @@
# The Hub's Database
JupyterHub uses a database to store information about users, services, and other
data needed for operating the Hub.
## Default SQLite database
The default database for JupyterHub is a [SQLite](https://sqlite.org) database.
We have chosen SQLite as JupyterHub's default for its lightweight simplicity
in certain uses such as testing, small deployments and workshops.
For production systems, SQLite has some disadvantages when used with JupyterHub:
- `upgrade-db` may not 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
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).
## Using an RDBMS (PostgreSQL, MySQL)
When running a long term deployment or a production system, we recommend using
a traditional RDBMS database, such as [PostgreSQL](https://www.postgresql.org)
or [MySQL](https://www.mysql.com), that supports the SQL `ALTER TABLE`
statement.
## 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.
### MySQL / MariaDB
- You should use the `pymysql` sqlalchemy provider (the other one, MySQLdb,
isn't available for py3).
- You also need to set `pool_recycle` to some value (typically 60 - 300)
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.

View File

@@ -0,0 +1,42 @@
# Event logging and telemetry
JupyterHub can be configured to record structured events from a running server using Jupyter's [Telemetry System]. The types of events that JupyterHub emits are defined by [JSON schemas] listed at the bottom of this [page].
## How to emit events
Event logging is handled by its `Eventlog` object. This leverages Python's standing [logging] library to emit, filter, and collect event data.
To begin recording events, you'll need to set two configurations:
> 1. `handlers`: tells the EventLog _where_ to route your events. This trait is a list of Python logging handlers that route events to the event log file.
> 2. `allows_schemas`: tells the EventLog _which_ events should be recorded. No events are emitted by default; all recorded events must be listed here.
Here's a basic example:
```
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
```
[json schemas]: https://json-schema.org/
[logging]: https://docs.python.org/3/library/logging.html
[telemetry system]: https://github.com/jupyter/telemetry

View File

@@ -1,3 +1,5 @@
(gallery-of-deployments)=
# A Gallery of JupyterHub Deployments
**A JupyterHub Community Resource**
@@ -20,13 +22,13 @@ Please submit pull requests to update information or to add new institutions or
- [GitHub organization](https://github.com/data-8)
- [NERSC](http://www.nersc.gov/)
- [NERSC](https://www.nersc.gov/)
- [Press release on Jupyter and Cori](http://www.nersc.gov/news-publications/nersc-news/nersc-center-news/2016/jupyter-notebooks-will-open-up-new-possibilities-on-nerscs-cori-supercomputer/)
- [Press release on Jupyter and Cori](https://www.nersc.gov/news-publications/nersc-news/nersc-center-news/2016/jupyter-notebooks-will-open-up-new-possibilities-on-nerscs-cori-supercomputer/)
- [Moving and sharing data](https://www.nersc.gov/assets/Uploads/03-MovingAndSharingData-Cholia.pdf)
- [Research IT](http://research-it.berkeley.edu)
- [JupyterHub server supports campus research computation](http://research-it.berkeley.edu/blog/17/01/24/free-fully-loaded-jupyterhub-server-supports-campus-research-computation)
- [Research IT](https://research-it.berkeley.edu)
- [JupyterHub server supports campus research computation](https://research-it.berkeley.edu/blog/17/01/24/free-fully-loaded-jupyterhub-server-supports-campus-research-computation)
### University of California Davis
@@ -71,25 +73,20 @@ easy to do with RStudio too.
### Clemson University
- Advanced Computing
- [Palmetto cluster and JupyterHub](http://citi.sites.clemson.edu/2016/08/18/JupyterHub-for-Palmetto-Cluster.html)
- [Palmetto cluster and JupyterHub](https://citi.sites.clemson.edu/2016/08/18/JupyterHub-for-Palmetto-Cluster.html)
### University of Colorado Boulder
- (CU Research Computing) CURC
- [JupyterHub User Guide](https://www.rc.colorado.edu/support/user-guide/jupyterhub.html)
- [JupyterHub User Guide](https://curc.readthedocs.io/en/latest/gateways/jupyterhub.html)
- Slurm job dispatched on Crestone compute cluster
- log troubleshooting
- Profiles in IPython Clusters tab
- [Parallel Processing with JupyterHub tutorial](https://www.rc.colorado.edu/support/examples-and-tutorials/parallel-processing-with-jupyterhub.html)
- [Parallel Programming with JupyterHub document](https://www.rc.colorado.edu/book/export/html/833)
- Earth Lab at CU
- [Tutorial on Parallel R on JupyterHub](https://earthdatascience.org/tutorials/parallel-r-on-jupyterhub/)
### George Washington University
- [Jupyter Hub](http://go.gwu.edu/jupyter) with university single-sign-on. Deployed early 2017.
- [JupyterHub](https://go.gwu.edu/jupyter) with university single-sign-on. Deployed early 2017.
### HTCondor
@@ -101,7 +98,7 @@ easy to do with RStudio too.
### IllustrisTNG Simulation Project
- [JupyterHub/Lab-based analysis platform, part of the TNG public data release](http://www.tng-project.org/data/)
- [JupyterHub/Lab-based analysis platform, part of the TNG public data release](https://www.tng-project.org/data/)
### MIT and Lincoln Labs
@@ -121,17 +118,13 @@ easy to do with RStudio too.
### Paderborn University
- [Data Science (DICE) group](https://dice.cs.uni-paderborn.de/)
- [Data Science (DICE) group](https://dice-research.org)
- [nbgraderutils](https://github.com/dice-group/nbgraderutils): Use JupyterHub + nbgrader + iJava kernel for online Java exercises. Used in lecture Statistical Natural Language Processing.
### Penn State University
- [Press release](https://news.psu.edu/story/523093/2018/05/24/new-open-source-web-apps-available-students-and-faculty): "New open-source web apps available for students and faculty"
### University of Rochester CIRC
- [JupyterHub Userguide](https://info.circ.rochester.edu/Web_Applications/JupyterHub.html) - Slurm, beehive
### University of California San Diego
- San Diego Supercomputer Center - Andrea Zonca
@@ -144,7 +137,7 @@ easy to do with RStudio too.
- [Sample deployment of Jupyterhub in HPC on SDSC Comet](https://zonca.github.io/2017/02/sample-deployment-jupyterhub-hpc.html)
- Educational Technology Services - Paul Jamason
- [jupyterhub.ucsd.edu](https://jupyterhub.ucsd.edu)
- [datahub.ucsd.edu](https://datahub.ucsd.edu)
### TACC University of Texas
@@ -180,7 +173,7 @@ easy to do with RStudio too.
### Rackspace Carina
- https://getcarina.com/blog/learning-how-to-whale/
- http://carolynvanslyck.com/talk/carina/jupyterhub/#/ (but carolynvanslyck is currently down; checked 10/26/22)
- https://carolynvanslyck.com/talk/carina/jupyterhub/#/ (but carolynvanslyck is currently down; checked 10/26/22)
### Hadoop
@@ -189,14 +182,13 @@ easy to do with RStudio too.
## Miscellaneous
- https://medium.com/@ybarraud/setting-up-jupyterhub-with-sudospawner-and-anaconda-844628c0dbee#.rm3yt87e1
- [Mailing list UT deployment](https://groups.google.com/forum/#!topic/jupyter/nkPSEeMr8c0)
- [Mailing list UT deployment](https://groups.google.com/g/jupyter/c/nkPSEeMr8c0)
- [JupyterHub setup on Centos](https://gist.github.com/johnrc/604971f7d41ebf12370bf5729bf3e0a4)
- [Deploy JupyterHub to Docker Swarm](https://jupyterhub.surge.sh/#/welcome)
- http://www.laketide.com/building-your-lab-part-3/
- http://estrellita.hatenablog.com/entry/2015/07/31/083202
- http://www.walkingrandomly.com/?p=5734
- [Deploy JupyterHub to Docker Swarm](https://jupyterhub.surge.sh)
- https://www.laketide.com/building-your-lab-part-3/
- https://estrellita.hatenablog.com/entry/2015/07/31/083202
- https://www.walkingrandomly.com/?p=5734
- https://wrdrd.com/docs/consulting/education-technology
- https://bitbucket.org/jackhale/fenics-jupyter
- [LinuxCluster blog](https://linuxcluster.wordpress.com/category/application/jupyterhub/)
- [Network Technology](https://arnesund.com/tag/jupyterhub/)
- [Spark Cluster on OpenStack with Multi-User Jupyter Notebook](https://arnesund.com/2015/09/21/spark-cluster-on-openstack-with-multi-user-jupyter-notebook/)

View File

@@ -0,0 +1,27 @@
(reference-index)=
# Reference
_Reference_ documentation provide technical descriptions about JupyterHub and how it works.
This section is divided into two broad subsections:
1. Technical reference.
2. API reference.
---
```{toctree}
:maxdepth: 1
technical-overview
authenticators
spawners
config-reference
services
urls
event-logging
monitoring
gallery-jhub-deployments
changelog
api/index.md
```

View File

@@ -1,32 +0,0 @@
Technical Reference
===================
This section covers more of the details of the JupyterHub architecture, as well as
what happens under-the-hood when you deploy and configure your JupyterHub.
.. toctree::
:maxdepth: 2
technical-overview
urls
websecurity
authenticators
spawners
services
proxy
separate-proxy
rest
rest-api
server-api
monitoring
database
templates
api-only
../events/index
config-user-env
config-examples
config-ghoauth
config-proxy
config-sudo
config-reference
oauth

View File

@@ -0,0 +1,20 @@
# Monitoring
This section covers details on monitoring the state of your JupyterHub installation.
JupyterHub expose the `/metrics` endpoint that returns text describing its current
operational state formatted in a way [Prometheus](https://prometheus.io) understands.
Prometheus is a separate open source tool that can be configured to repeatedly poll
JupyterHub's `/metrics` endpoint to parse and save its current state.
By doing so, Prometheus can describe JupyterHub's evolving state over time.
This evolving state can then be accessed through Prometheus that expose its underlying
storage to those allowed to access it, and be presented with dashboards by a
tool like [Grafana](https://grafana.com).
```{toctree}
:maxdepth: 2
/reference/metrics
```

View File

@@ -1,20 +0,0 @@
Monitoring
==========
This section covers details on monitoring the state of your JupyterHub installation.
JupyterHub expose the ``/metrics`` endpoint that returns text describing its current
operational state formatted in a way `Prometheus <https://prometheus.io/docs/introduction/overview/>`_ understands.
Prometheus is a separate open source tool that can be configured to repeatedly poll
JupyterHub's ``/metrics`` endpoint to parse and save its current state.
By doing so, Prometheus can describe JupyterHub's evolving state over time.
This evolving state can then be accessed through Prometheus that expose its underlying
storage to those allowed to access it, and be presented with dashboards by a
tool like `Grafana <https://grafana.com/docs/grafana/latest/getting-started/what-is-grafana/>`_.
.. toctree::
:maxdepth: 2
metrics

View File

@@ -1,3 +1,9 @@
<!---
This doc is part of the API references section of the References documentation.
--->
(jupyterhub-rest-API)=
# JupyterHub REST API
Below is an interactive view of JupyterHub's OpenAPI specification.

View File

@@ -1 +1,3 @@
```{eval-rst}
.. jsonschema:: ../../../jupyterhub/event-schemas/server-actions/v1.yaml
```

View File

@@ -1,3 +1,5 @@
(services)=
# Services
## Definition of a Service
@@ -290,7 +292,7 @@ service. See the `service-whoami-flask` example in the
[JupyterHub GitHub repo](https://github.com/jupyterhub/jupyterhub/tree/HEAD/examples/service-whoami-flask)
for more details.
```{literalinclude} ../../../examples/service-whoami-flask/whoami-flask.py
```{literalinclude} ../../../../jupyterhub/examples/service-whoami-flask/whoami-flask.py
:language: python
```
@@ -352,7 +354,7 @@ You will only get to this stage if the user has the required `access:services!se
To retrieve the user model for the token, make a request to `GET /hub/api/user` with the token in the Authorization header.
For example, using flask:
```{literalinclude} ../../../examples/service-whoami-flask/whoami-flask.py
```{literalinclude} ../../../../jupyterhub/examples/service-whoami-flask/whoami-flask.py
:language: python
```
@@ -405,7 +407,7 @@ and an example of its configuration is found [here](https://github.com/jupyter/n
nbviewer can also be run as a Hub-Managed Service as described [nbviewer README][nbviewer example]
section on securing the notebook viewer.
[requests]: http://docs.python-requests.org/en/master/
[requests]: https://docs.python-requests.org/en/master/
[services_auth]: ../api/services.auth.html
[nbviewer example]: https://github.com/jupyter/nbviewer#securing-the-notebook-viewer
[fastapi example]: https://github.com/jupyterhub/jupyterhub/tree/HEAD/examples/service-fastapi

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