mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-08 10:34:10 +00:00
Compare commits
612 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ca3b2bc079 | ||
![]() |
bba81a856c | ||
![]() |
ca2a98695d | ||
![]() |
cbadb454d5 | ||
![]() |
0e26ba9f57 | ||
![]() |
261e2ae13e | ||
![]() |
ed6c981cf7 | ||
![]() |
a3e642150e | ||
![]() |
53fb794241 | ||
![]() |
0e27bac90e | ||
![]() |
a15656c1cf | ||
![]() |
f2da9774b3 | ||
![]() |
1978c36985 | ||
![]() |
da835fbe86 | ||
![]() |
faa34044f3 | ||
![]() |
e196c93783 | ||
![]() |
26d5ee3eba | ||
![]() |
dc69ff4126 | ||
![]() |
024fe661e5 | ||
![]() |
11bc5c325a | ||
![]() |
642475f844 | ||
![]() |
6f05534dd8 | ||
![]() |
750df8b686 | ||
![]() |
485ac0df4c | ||
![]() |
b180bd0c0c | ||
![]() |
0a6f0165b7 | ||
![]() |
21b77e2348 | ||
![]() |
b5e43b7dfb | ||
![]() |
eab7e54d3d | ||
![]() |
2b3a9d9ab8 | ||
![]() |
fb4872f74d | ||
![]() |
efbd593113 | ||
![]() |
e390ba0e4d | ||
![]() |
9c2ca005b5 | ||
![]() |
3861163bbb | ||
![]() |
b105fe14dc | ||
![]() |
950d98ee57 | ||
![]() |
6d2f47150b | ||
![]() |
203cbe291e | ||
![]() |
f22c239666 | ||
![]() |
783ddf5265 | ||
![]() |
c92ef8bd45 | ||
![]() |
ae06035711 | ||
![]() |
59d7d659bf | ||
![]() |
e63c403e92 | ||
![]() |
074917d9be | ||
![]() |
8ae8f75516 | ||
![]() |
e8aef6587e | ||
![]() |
6f776053e8 | ||
![]() |
42ee0f9797 | ||
![]() |
7090444ce4 | ||
![]() |
818964fd3a | ||
![]() |
63383ce9db | ||
![]() |
89d9e43d3c | ||
![]() |
60944e48bf | ||
![]() |
a24292b54c | ||
![]() |
a14792decd | ||
![]() |
ad358a9884 | ||
![]() |
0e4c6c6581 | ||
![]() |
cbace1de16 | ||
![]() |
af7ccfc117 | ||
![]() |
1ef87fb41a | ||
![]() |
093dea9bcf | ||
![]() |
9e0c75884c | ||
![]() |
16e5080ae9 | ||
![]() |
5abf4bdb75 | ||
![]() |
225e87d9db | ||
![]() |
d923b9b736 | ||
![]() |
0b98bcd503 | ||
![]() |
d38e41fd97 | ||
![]() |
37fd7af917 | ||
![]() |
20895dba83 | ||
![]() |
2079d1e7c4 | ||
![]() |
1b0355b173 | ||
![]() |
df11d83d2c | ||
![]() |
83db40b01f | ||
![]() |
12dc3a9ff8 | ||
![]() |
61c48fd453 | ||
![]() |
45294dfdc7 | ||
![]() |
46ccb3cd4a | ||
![]() |
0a0b20834f | ||
![]() |
3a26e66adc | ||
![]() |
94faddb1e0 | ||
![]() |
d1ebd8e5bf | ||
![]() |
a59b33686a | ||
![]() |
b6d0a62c75 | ||
![]() |
0404ba6433 | ||
![]() |
f707ff372d | ||
![]() |
370c649d61 | ||
![]() |
1fe10713fd | ||
![]() |
ed80a8232f | ||
![]() |
0884ebc948 | ||
![]() |
1da7eee9ba | ||
![]() |
d92226134d | ||
![]() |
d9f2ec0b8e | ||
![]() |
90c95d5665 | ||
![]() |
1b00e49e4d | ||
![]() |
3e09b979bc | ||
![]() |
e81884fabb | ||
![]() |
3f7334e960 | ||
![]() |
548744e59b | ||
![]() |
015370eec7 | ||
![]() |
c0fd37cbeb | ||
![]() |
74b5e2601d | ||
![]() |
a28fb9361f | ||
![]() |
98d13d8e74 | ||
![]() |
98ef84e774 | ||
![]() |
cd2a311f54 | ||
![]() |
cd373049ed | ||
![]() |
8b7b7ad67e | ||
![]() |
76bd0a4aa2 | ||
![]() |
2e66cabe8d | ||
![]() |
7819b5cc3e | ||
![]() |
6411c25c28 | ||
![]() |
de7ee551d7 | ||
![]() |
a035d7f65e | ||
![]() |
cb998f0c0d | ||
![]() |
9cbe5eae5b | ||
![]() |
73313fdef8 | ||
![]() |
4d5828fa8c | ||
![]() |
0b6500fe21 | ||
![]() |
7ad9fee198 | ||
![]() |
09ead8cacc | ||
![]() |
3be375e12c | ||
![]() |
6f71a3a5a2 | ||
![]() |
f336c77166 | ||
![]() |
7c1ca033f3 | ||
![]() |
71f085fc19 | ||
![]() |
e7388b4333 | ||
![]() |
5c4100a4d0 | ||
![]() |
0e643ae274 | ||
![]() |
8423d81cf3 | ||
![]() |
2942654f15 | ||
![]() |
55aa910177 | ||
![]() |
b809311582 | ||
![]() |
73b2c408e1 | ||
![]() |
5265ff4165 | ||
![]() |
954ce155e0 | ||
![]() |
1a750c0479 | ||
![]() |
43323d0f60 | ||
![]() |
65a87bcf65 | ||
![]() |
0e44693819 | ||
![]() |
faa5e31f52 | ||
![]() |
01a43f41f8 | ||
![]() |
d008d51b7f | ||
![]() |
68b2dbf0f5 | ||
![]() |
f07b55c289 | ||
![]() |
e6ab7ae58d | ||
![]() |
fbc752e352 | ||
![]() |
6b5d87da63 | ||
![]() |
cd30074ab9 | ||
![]() |
4d4ded311e | ||
![]() |
9f5f02aa73 | ||
![]() |
2babc7ae83 | ||
![]() |
27c1441baa | ||
![]() |
bc21e99e7e | ||
![]() |
07b6e281c4 | ||
![]() |
5023718463 | ||
![]() |
4617cc10ef | ||
![]() |
b35d77f475 | ||
![]() |
68f784edee | ||
![]() |
e3b704b83e | ||
![]() |
a8a26856b0 | ||
![]() |
f087178171 | ||
![]() |
3c5dd08c17 | ||
![]() |
072dc29f80 | ||
![]() |
c9500e5b71 | ||
![]() |
caae054cea | ||
![]() |
2c01935339 | ||
![]() |
0ef744e4c9 | ||
![]() |
e405a71a19 | ||
![]() |
798faaafe8 | ||
![]() |
b673fad94b | ||
![]() |
f45f7536e9 | ||
![]() |
e06abc3158 | ||
![]() |
e4514725cf | ||
![]() |
af655f9be1 | ||
![]() |
76488db2ef | ||
![]() |
36fd86798e | ||
![]() |
46efc3e689 | ||
![]() |
71bbdf65ac | ||
![]() |
1bcc508e42 | ||
![]() |
84adcbec30 | ||
![]() |
81bd5eeedb | ||
![]() |
6a96a9c3f4 | ||
![]() |
55aa7e7819 | ||
![]() |
20b11b26f9 | ||
![]() |
b42371ded8 | ||
![]() |
cfa4364549 | ||
![]() |
1d17471e97 | ||
![]() |
cb3391e2cd | ||
![]() |
79782d01c9 | ||
![]() |
8e81aae517 | ||
![]() |
49be789425 | ||
![]() |
fb2a2cdf3a | ||
![]() |
bb423b07ae | ||
![]() |
add7a834a5 | ||
![]() |
3e5b78b32b | ||
![]() |
cbb93c36f1 | ||
![]() |
f55ececb31 | ||
![]() |
d0d5e84ad3 | ||
![]() |
b7cd235f7b | ||
![]() |
2e5fc51b6b | ||
![]() |
5f4a40324f | ||
![]() |
9539790f29 | ||
![]() |
9fe7822098 | ||
![]() |
e70658c015 | ||
![]() |
13ae9247f9 | ||
![]() |
cb81f309a6 | ||
![]() |
b5359545db | ||
![]() |
640c688519 | ||
![]() |
ce1269c1c8 | ||
![]() |
d1a412b354 | ||
![]() |
fd9f86cf49 | ||
![]() |
4a67babe7d | ||
![]() |
1aa220ee2c | ||
![]() |
286b85cc78 | ||
![]() |
8002cbb873 | ||
![]() |
7522d2c73a | ||
![]() |
ca733312a1 | ||
![]() |
a75e0095c9 | ||
![]() |
7fda625102 | ||
![]() |
e099579ff3 | ||
![]() |
2457813432 | ||
![]() |
d45472a7fc | ||
![]() |
ca730cbed4 | ||
![]() |
fd3ae8b2b6 | ||
![]() |
b7621ea82b | ||
![]() |
ba25ee9e9c | ||
![]() |
239902934a | ||
![]() |
e63d6bfbb1 | ||
![]() |
ae434dd866 | ||
![]() |
15efe6b7c1 | ||
![]() |
5fbf787066 | ||
![]() |
b486f9465c | ||
![]() |
5e77ca22e3 | ||
![]() |
cd79f17d90 | ||
![]() |
742de1311e | ||
![]() |
f76cc42363 | ||
![]() |
7854ed56d1 | ||
![]() |
f2cab7c5ef | ||
![]() |
bd8bb9e5ec | ||
![]() |
25c1469658 | ||
![]() |
b64b4e45c2 | ||
![]() |
24d99afffd | ||
![]() |
470d7624a3 | ||
![]() |
d0120ef56c | ||
![]() |
44b81f662a | ||
![]() |
43a868d00b | ||
![]() |
52e852e8f9 | ||
![]() |
1c5607ca1d | ||
![]() |
9c4aefc424 | ||
![]() |
66995952ab | ||
![]() |
1b2417678b | ||
![]() |
8c9e6fd82b | ||
![]() |
325dd21845 | ||
![]() |
abdc3850ff | ||
![]() |
6caa969708 | ||
![]() |
89f4385735 | ||
![]() |
2b77b1e507 | ||
![]() |
98ad6fd4e6 | ||
![]() |
5322243367 | ||
![]() |
17f11970bb | ||
![]() |
66922889c0 | ||
![]() |
f820e5fde2 | ||
![]() |
41a80e4009 | ||
![]() |
1a2e5d2e9d | ||
![]() |
6619524d1f | ||
![]() |
44a02299c1 | ||
![]() |
09d552ad3d | ||
![]() |
721e73f433 | ||
![]() |
6c40c05166 | ||
![]() |
044d7ac000 | ||
![]() |
b74f1b1b14 | ||
![]() |
b9a59768d0 | ||
![]() |
3ce05d42b6 | ||
![]() |
6a36812e4a | ||
![]() |
b535985c25 | ||
![]() |
cc77b828d2 | ||
![]() |
410fa0f36a | ||
![]() |
4ec51ce0cf | ||
![]() |
e9613bfb2f | ||
![]() |
0a27724540 | ||
![]() |
04121b0e3d | ||
![]() |
e0b6c46b4f | ||
![]() |
c473a35459 | ||
![]() |
27b1759f8a | ||
![]() |
7d2e416d0f | ||
![]() |
6455fa13b8 | ||
![]() |
350cb83b7b | ||
![]() |
a880fc4d6c | ||
![]() |
61577c1540 | ||
![]() |
3885affd68 | ||
![]() |
c8317074aa | ||
![]() |
29936e0d2b | ||
![]() |
5d71fbb2a2 | ||
![]() |
3de1145a69 | ||
![]() |
44326bda12 | ||
![]() |
681a7ae840 | ||
![]() |
57f4e9cb7c | ||
![]() |
5eb1bea3b0 | ||
![]() |
611b91799c | ||
![]() |
6013f55ef8 | ||
![]() |
916a4bb784 | ||
![]() |
befc4785b0 | ||
![]() |
04175ae3bd | ||
![]() |
7add99c09a | ||
![]() |
6be4893bfa | ||
![]() |
ee913f98fe | ||
![]() |
464b5ef31f | ||
![]() |
c5c4ea60fe | ||
![]() |
cf352f8a0d | ||
![]() |
b86734653c | ||
![]() |
6d0dc488f7 | ||
![]() |
718f01e600 | ||
![]() |
0521270862 | ||
![]() |
260f5ce35b | ||
![]() |
bf28242d9d | ||
![]() |
18d0270af1 | ||
![]() |
ee4a8e593d | ||
![]() |
e65b7c3c15 | ||
![]() |
16f07dda70 | ||
![]() |
de461be7a9 | ||
![]() |
7c71e517ef | ||
![]() |
b9ea57a2f9 | ||
![]() |
320b589037 | ||
![]() |
ea7bedec49 | ||
![]() |
49fa9e6b98 | ||
![]() |
d9ce3dbe5d | ||
![]() |
4fbc737152 | ||
![]() |
0b4c181bf7 | ||
![]() |
6a10070602 | ||
![]() |
5b02d9c222 | ||
![]() |
948e112bde | ||
![]() |
79af8ea264 | ||
![]() |
ec83356261 | ||
![]() |
c7bb995f29 | ||
![]() |
f887a7b547 | ||
![]() |
a2ba05d7b8 | ||
![]() |
0cc382012e | ||
![]() |
9fc16bb3f7 | ||
![]() |
cddeeb9da4 | ||
![]() |
d2ee8472a3 | ||
![]() |
0563a95dc1 | ||
![]() |
ff823fa8cf | ||
![]() |
bf09419377 | ||
![]() |
a2a238f81d | ||
![]() |
1ec169a8a1 | ||
![]() |
2550d24048 | ||
![]() |
c3bfedf0a2 | ||
![]() |
dce25e065f | ||
![]() |
8f9723f0a7 | ||
![]() |
8391d1d5cf | ||
![]() |
7a76cfd89d | ||
![]() |
4d57412361 | ||
![]() |
5cc6da1421 | ||
![]() |
3003b8482a | ||
![]() |
2cf8681748 | ||
![]() |
165364e752 | ||
![]() |
4eb2d6d8a4 | ||
![]() |
1effa17666 | ||
![]() |
cab45ea60c | ||
![]() |
4d1904d25f | ||
![]() |
8372079db4 | ||
![]() |
b7002c12fa | ||
![]() |
d8503534c3 | ||
![]() |
f3d96f8f60 | ||
![]() |
7a550e38cb | ||
![]() |
ccc26d5f50 | ||
![]() |
5acb25d024 | ||
![]() |
413321beee | ||
![]() |
4ccf4fa4cf | ||
![]() |
df6d2cb045 | ||
![]() |
0d57ce2e33 | ||
![]() |
e0d27849b8 | ||
![]() |
a2877c7be2 | ||
![]() |
def928f1b7 | ||
![]() |
ed675f20e4 | ||
![]() |
95c551c316 | ||
![]() |
ff7d37c3ab | ||
![]() |
2bcb24c56e | ||
![]() |
ed76db02e2 | ||
![]() |
cc623cc2cb | ||
![]() |
55e660aa3a | ||
![]() |
3e0588f82c | ||
![]() |
b6c7b6bf91 | ||
![]() |
f10198a859 | ||
![]() |
388a990928 | ||
![]() |
fb6fb87621 | ||
![]() |
a8500a31a9 | ||
![]() |
bffdd3969c | ||
![]() |
5941314d1e | ||
![]() |
296511699e | ||
![]() |
40e2ffc368 | ||
![]() |
07fe2fcff6 | ||
![]() |
886ce6cbdf | ||
![]() |
3effd05f06 | ||
![]() |
183ab22018 | ||
![]() |
5bef758f34 | ||
![]() |
27f978807d | ||
![]() |
2478a1ac6e | ||
![]() |
1db1be22c5 | ||
![]() |
e9002bfec9 | ||
![]() |
95a7c97052 | ||
![]() |
9749b6eb6a | ||
![]() |
979b47d1e0 | ||
![]() |
c12ccafe22 | ||
![]() |
acc51dbe24 | ||
![]() |
51dcbe4c80 | ||
![]() |
6da70e9960 | ||
![]() |
1cb98ce9ff | ||
![]() |
f2ecf6a307 | ||
![]() |
0a4c3bbfd3 | ||
![]() |
e4ae7ce4fe | ||
![]() |
ab43f6beb8 | ||
![]() |
e8806372c6 | ||
![]() |
6e353df033 | ||
![]() |
06507b426d | ||
![]() |
e282205139 | ||
![]() |
e4ff84b7c9 | ||
![]() |
8c4dbd7a32 | ||
![]() |
1336df621b | ||
![]() |
b66931306e | ||
![]() |
83003c7e3d | ||
![]() |
23b9400c53 | ||
![]() |
98e9117633 | ||
![]() |
b2d9f93601 | ||
![]() |
61c39972da | ||
![]() |
08f6ff52b0 | ||
![]() |
949496eb36 | ||
![]() |
7af4cc2fa9 | ||
![]() |
3d60ad3956 | ||
![]() |
689a5ba190 | ||
![]() |
80b9f02332 | ||
![]() |
8bd1219b92 | ||
![]() |
4ea74c4869 | ||
![]() |
24fb08d513 | ||
![]() |
6b22599149 | ||
![]() |
70ca293977 | ||
![]() |
aeaffa654f | ||
![]() |
86e4f42035 | ||
![]() |
6ccb809a2a | ||
![]() |
992bc98ff1 | ||
![]() |
43597febcb | ||
![]() |
6464e3629c | ||
![]() |
62d2a4bec2 | ||
![]() |
6e3913456b | ||
![]() |
de39fda9a7 | ||
![]() |
abca5546b7 | ||
![]() |
1b87e9c668 | ||
![]() |
70561c8727 | ||
![]() |
b13d3afa0f | ||
![]() |
5f6748abd4 | ||
![]() |
8b944a3293 | ||
![]() |
5dddd97132 | ||
![]() |
20a600ffa0 | ||
![]() |
de2841e00d | ||
![]() |
33af239911 | ||
![]() |
2aeb49690b | ||
![]() |
265fcbc874 | ||
![]() |
98a6338247 | ||
![]() |
d519bacd8a | ||
![]() |
ad39fe3823 | ||
![]() |
aca10da71d | ||
![]() |
e8b2bd82c8 | ||
![]() |
5616ade51d | ||
![]() |
b83f6d178b | ||
![]() |
3068e3911b | ||
![]() |
6867f3b141 | ||
![]() |
aec601dbff | ||
![]() |
748b6c98d5 | ||
![]() |
d6d03e8e38 | ||
![]() |
14d32c5bae | ||
![]() |
653922605a | ||
![]() |
52f5aacce1 | ||
![]() |
e00ef75f15 | ||
![]() |
50879db41c | ||
![]() |
8c4a170f4e | ||
![]() |
f36e5420f5 | ||
![]() |
27d83dd6c2 | ||
![]() |
aa43ce85bd | ||
![]() |
53205764ca | ||
![]() |
a7fc94c22a | ||
![]() |
9419c7f2c0 | ||
![]() |
73e0d7092e | ||
![]() |
562f86026d | ||
![]() |
3a64eb85a8 | ||
![]() |
e4340a467c | ||
![]() |
f8c00092d2 | ||
![]() |
bd00f376d7 | ||
![]() |
99b32dd372 | ||
![]() |
7a94830a29 | ||
![]() |
eeb867947a | ||
![]() |
ccac4aa53f | ||
![]() |
38c313eef7 | ||
![]() |
251aa1f12c | ||
![]() |
b6b596cd34 | ||
![]() |
2391d0f764 | ||
![]() |
959cd5a6e1 | ||
![]() |
036dcb644c | ||
![]() |
bdc7ee40f4 | ||
![]() |
5383a60d4a | ||
![]() |
78649b9118 | ||
![]() |
e63ec9aedc | ||
![]() |
6be699c333 | ||
![]() |
a377f8bc7f | ||
![]() |
7ba36ef760 | ||
![]() |
6f13355446 | ||
![]() |
a5f08035a2 | ||
![]() |
3d0256a757 | ||
![]() |
cca7cc6e92 | ||
![]() |
3ab54e6eeb | ||
![]() |
ce7e532ab6 | ||
![]() |
da79a89f22 | ||
![]() |
d75bcc03c0 | ||
![]() |
a03fd54982 | ||
![]() |
f4fa229645 | ||
![]() |
cdc2151f75 | ||
![]() |
b4a06ea53f | ||
![]() |
5fcaaac331 | ||
![]() |
4ea8fcb031 | ||
![]() |
ca7df636cb | ||
![]() |
759a4f0624 | ||
![]() |
2a89495323 | ||
![]() |
671c8ab78d | ||
![]() |
49aaf5050f | ||
![]() |
0c20f3e867 | ||
![]() |
db7d0920cd | ||
![]() |
ff2db557a8 | ||
![]() |
0cd5e51dd4 | ||
![]() |
b0fbf6a61e | ||
![]() |
9c810b1436 | ||
![]() |
3d1f936a46 | ||
![]() |
2c609d0936 | ||
![]() |
8c3025dc4f | ||
![]() |
d51f9f8998 | ||
![]() |
41583c1322 | ||
![]() |
c65e48b2b6 | ||
![]() |
01aeb84a13 | ||
![]() |
4c2e3f176a | ||
![]() |
554248b083 | ||
![]() |
4a859664da | ||
![]() |
00b37c9415 | ||
![]() |
3a9c631526 | ||
![]() |
4c868cdfb6 | ||
![]() |
96e75bb4ac | ||
![]() |
f09fdf4761 | ||
![]() |
7ef70eb74f | ||
![]() |
5c4eab0c15 | ||
![]() |
8ca8750b04 | ||
![]() |
eb1bf1dc58 | ||
![]() |
7852dbc1dc | ||
![]() |
3caea2a463 | ||
![]() |
6679c389b5 | ||
![]() |
954bbbe7d9 | ||
![]() |
3338de2619 | ||
![]() |
33c09daf5b | ||
![]() |
f3cc79e453 | ||
![]() |
cc0bc531d3 | ||
![]() |
fd2919b36f | ||
![]() |
b6e4225482 | ||
![]() |
18d7003580 | ||
![]() |
873f60781c | ||
![]() |
d1d8c02cb9 | ||
![]() |
67dd7742ef | ||
![]() |
3ee808e35c | ||
![]() |
78369901b2 | ||
![]() |
d7a7589821 | ||
![]() |
8437e66db9 | ||
![]() |
6ea07a7dd0 | ||
![]() |
fc184c4ec7 | ||
![]() |
df4f96eaf9 | ||
![]() |
d8bb3f4402 | ||
![]() |
4082c2ddbc | ||
![]() |
300f49d1ab | ||
![]() |
6abc096cbc | ||
![]() |
a6aba9a7e1 | ||
![]() |
8c3ff64511 | ||
![]() |
104593b9ec | ||
![]() |
495ebe406c | ||
![]() |
5100c60831 | ||
![]() |
bec737bf27 | ||
![]() |
2bb27653e2 | ||
![]() |
e8fbe84ac8 | ||
![]() |
8564ff015c | ||
![]() |
fb85cfb118 | ||
![]() |
25384051aa | ||
![]() |
2623aa5e46 | ||
![]() |
30ebf84bd4 | ||
![]() |
50466843ee | ||
![]() |
c616ab284d | ||
![]() |
41090ceb55 | ||
![]() |
d7939c1721 | ||
![]() |
d93ca55b11 | ||
![]() |
9ff11e6fa4 | ||
![]() |
5f3833bc95 | ||
![]() |
66ddaebf26 | ||
![]() |
2598ac2c1a | ||
![]() |
4ab36e3da6 | ||
![]() |
282cc020b6 | ||
![]() |
6912a5a752 | ||
![]() |
cedf237852 | ||
![]() |
9ff8f3e6ec | ||
![]() |
abc9581a75 | ||
![]() |
02df033227 | ||
![]() |
f82097bf2e | ||
![]() |
2af252c4c3 | ||
![]() |
06c8d22087 | ||
![]() |
95d479af88 | ||
![]() |
aee92985ac | ||
![]() |
ea73931ad0 | ||
![]() |
b0494c203f |
48
.github/dependabot.yaml
vendored
48
.github/dependabot.yaml
vendored
@@ -14,3 +14,51 @@ updates:
|
|||||||
interval: monthly
|
interval: monthly
|
||||||
time: "05:00"
|
time: "05:00"
|
||||||
timezone: Etc/UTC
|
timezone: Etc/UTC
|
||||||
|
- package-ecosystem: npm
|
||||||
|
directory: /
|
||||||
|
groups:
|
||||||
|
# one big pull request for minor bumps
|
||||||
|
npm-minor:
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
update-types:
|
||||||
|
- minor
|
||||||
|
- patch
|
||||||
|
schedule:
|
||||||
|
interval: monthly
|
||||||
|
- package-ecosystem: npm
|
||||||
|
directory: /jsx
|
||||||
|
groups:
|
||||||
|
# one big pull request for minor bumps
|
||||||
|
jsx-minor:
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
update-types:
|
||||||
|
- minor
|
||||||
|
- patch
|
||||||
|
# group major bumps of react-related dependencies
|
||||||
|
jsx-react:
|
||||||
|
patterns:
|
||||||
|
- "react*"
|
||||||
|
- "redux*"
|
||||||
|
- "*react"
|
||||||
|
- "recompose"
|
||||||
|
update-types:
|
||||||
|
- major
|
||||||
|
# group major bumps of webpack-related dependencies
|
||||||
|
jsx-webpack:
|
||||||
|
patterns:
|
||||||
|
- "*webpack*"
|
||||||
|
- "@babel/*"
|
||||||
|
- "*-loader"
|
||||||
|
update-types:
|
||||||
|
- major
|
||||||
|
# group major bumps of jest-related dependencies
|
||||||
|
jsx-jest:
|
||||||
|
patterns:
|
||||||
|
- "*jest*"
|
||||||
|
- "*test*"
|
||||||
|
update-types:
|
||||||
|
- major
|
||||||
|
schedule:
|
||||||
|
interval: monthly
|
||||||
|
54
.github/workflows/registry-overviews.yml
vendored
54
.github/workflows/registry-overviews.yml
vendored
@@ -1,54 +0,0 @@
|
|||||||
name: Update Registry overviews
|
|
||||||
|
|
||||||
env:
|
|
||||||
OWNER: ${{ github.repository_owner }}
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
paths:
|
|
||||||
- ".github/workflows/registry-overviews.yml"
|
|
||||||
|
|
||||||
- "README.md"
|
|
||||||
- "onbuild/README.md"
|
|
||||||
- "demo-image/README.md"
|
|
||||||
- "singleuser/README.md"
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update-overview:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: update-overview (${{matrix.image}})
|
|
||||||
if: github.repository_owner == 'jupyterhub'
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout Repo ⚡️
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Push README to Registry 🐳
|
|
||||||
uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # v1
|
|
||||||
env:
|
|
||||||
DOCKER_USER: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
DOCKER_PASS: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
destination_container_repo: ${{ env.OWNER }}/${{ matrix.image }}
|
|
||||||
provider: dockerhub
|
|
||||||
short_description: ${{ matrix.description }}
|
|
||||||
readme_file: ${{ matrix.readme_file }}
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- image: jupyterhub
|
|
||||||
description: "JupyterHub: multi-user Jupyter notebook server"
|
|
||||||
readme_file: README.md
|
|
||||||
- image: jupyterhub-onbuild
|
|
||||||
description: onbuild version of JupyterHub images
|
|
||||||
readme_file: onbuild/README.md
|
|
||||||
- image: jupyterhub-demo
|
|
||||||
description: Demo JupyterHub Docker image with a quick overview of what JupyterHub is and how it works
|
|
||||||
readme_file: demo-image/README.md
|
|
||||||
- image: singleuser
|
|
||||||
description: "single-user docker images for use with JupyterHub and DockerSpawner see also: jupyter/docker-stacks"
|
|
||||||
readme_file: singleuser/README.md
|
|
159
.github/workflows/release.yml
vendored
159
.github/workflows/release.yml
vendored
@@ -1,7 +1,7 @@
|
|||||||
# This is a GitHub workflow defining a set of jobs with a set of steps.
|
# This is a GitHub workflow defining a set of jobs with a set of steps.
|
||||||
# ref: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
|
# ref: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
|
||||||
#
|
#
|
||||||
# Test build release artifacts (PyPI package, Docker images) and publish them on
|
# Test build release artifacts (PyPI package) and publish them on
|
||||||
# pushed git tags.
|
# pushed git tags.
|
||||||
#
|
#
|
||||||
name: Release
|
name: Release
|
||||||
@@ -28,16 +28,20 @@ on:
|
|||||||
- "**"
|
- "**"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-release:
|
build-release:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: "3.11"
|
python-version: "3.11"
|
||||||
|
cache: pip
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v5
|
||||||
with:
|
with:
|
||||||
node-version: "20"
|
node-version: "20"
|
||||||
|
|
||||||
@@ -81,150 +85,3 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
pip install twine
|
pip install twine
|
||||||
twine upload --skip-existing dist/*
|
twine upload --skip-existing dist/*
|
||||||
|
|
||||||
publish-docker:
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
timeout-minutes: 30
|
|
||||||
|
|
||||||
services:
|
|
||||||
# So that we can test this in PRs/branches
|
|
||||||
local-registry:
|
|
||||||
image: registry:2
|
|
||||||
ports:
|
|
||||||
- 5000:5000
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Should we push this image to a public registry?
|
|
||||||
run: |
|
|
||||||
if [ "${{ startsWith(github.ref, 'refs/tags/') || (github.ref == 'refs/heads/main') }}" = "true" ]; then
|
|
||||||
echo "REGISTRY=quay.io/" >> $GITHUB_ENV
|
|
||||||
else
|
|
||||||
echo "REGISTRY=localhost:5000/" >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
# Setup docker to build for multiple platforms, see:
|
|
||||||
# https://github.com/docker/build-push-action/tree/v2.4.0#usage
|
|
||||||
# https://github.com/docker/build-push-action/blob/v2.4.0/docs/advanced/multi-platform.md
|
|
||||||
- name: Set up QEMU (for docker buildx)
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx (for multi-arch builds)
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
# Allows pushing to registry on localhost:5000
|
|
||||||
driver-opts: network=host
|
|
||||||
|
|
||||||
- name: Setup push rights to Docker Hub
|
|
||||||
# This was setup by...
|
|
||||||
# 1. Creating a [Robot Account](https://quay.io/organization/jupyterhub?tab=robots) in the JupyterHub
|
|
||||||
# . Quay.io org
|
|
||||||
# 2. Giving it enough permissions to push to the jupyterhub and singleuser images
|
|
||||||
# 3. Putting the robot account's username and password in GitHub actions environment
|
|
||||||
if: env.REGISTRY != 'localhost:5000/'
|
|
||||||
run: |
|
|
||||||
docker login -u "${{ secrets.QUAY_USERNAME }}" -p "${{ secrets.QUAY_PASSWORD }}" "${{ env.REGISTRY }}"
|
|
||||||
docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" -p "${{ secrets.DOCKERHUB_TOKEN }}" docker.io
|
|
||||||
|
|
||||||
# image: jupyterhub/jupyterhub
|
|
||||||
#
|
|
||||||
# https://github.com/jupyterhub/action-major-minor-tag-calculator
|
|
||||||
# If this is a tagged build this will return additional parent tags.
|
|
||||||
# E.g. 1.2.3 is expanded to Docker tags
|
|
||||||
# [{prefix}:1.2.3, {prefix}:1.2, {prefix}:1, {prefix}:latest] unless
|
|
||||||
# this is a backported tag in which case the newer tags aren't updated.
|
|
||||||
# For branches this will return the branch name.
|
|
||||||
# If GITHUB_TOKEN isn't available (e.g. in PRs) returns no tags [].
|
|
||||||
- name: Get list of jupyterhub tags
|
|
||||||
id: jupyterhubtags
|
|
||||||
uses: jupyterhub/action-major-minor-tag-calculator@v3
|
|
||||||
with:
|
|
||||||
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
prefix: >-
|
|
||||||
${{ env.REGISTRY }}jupyterhub/jupyterhub:
|
|
||||||
jupyterhub/jupyterhub:
|
|
||||||
defaultTag: "${{ env.REGISTRY }}jupyterhub/jupyterhub:noref"
|
|
||||||
branchRegex: ^\w[\w-.]*$
|
|
||||||
|
|
||||||
- name: Build and push jupyterhub
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
push: true
|
|
||||||
# tags parameter must be a string input so convert `gettags` JSON
|
|
||||||
# array into a comma separated list of tags
|
|
||||||
tags: ${{ join(fromJson(steps.jupyterhubtags.outputs.tags)) }}
|
|
||||||
|
|
||||||
# image: jupyterhub/jupyterhub-onbuild
|
|
||||||
#
|
|
||||||
- name: Get list of jupyterhub-onbuild tags
|
|
||||||
id: onbuildtags
|
|
||||||
uses: jupyterhub/action-major-minor-tag-calculator@v3
|
|
||||||
with:
|
|
||||||
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
prefix: >-
|
|
||||||
${{ env.REGISTRY }}jupyterhub/jupyterhub-onbuild:
|
|
||||||
jupyterhub/jupyterhub-onbuild:
|
|
||||||
defaultTag: "${{ env.REGISTRY }}jupyterhub/jupyterhub-onbuild:noref"
|
|
||||||
branchRegex: ^\w[\w-.]*$
|
|
||||||
|
|
||||||
- name: Build and push jupyterhub-onbuild
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
build-args: |
|
|
||||||
BASE_IMAGE=${{ fromJson(steps.jupyterhubtags.outputs.tags)[0] }}
|
|
||||||
context: onbuild
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
push: true
|
|
||||||
tags: ${{ join(fromJson(steps.onbuildtags.outputs.tags)) }}
|
|
||||||
|
|
||||||
# image: jupyterhub/jupyterhub-demo
|
|
||||||
#
|
|
||||||
- name: Get list of jupyterhub-demo tags
|
|
||||||
id: demotags
|
|
||||||
uses: jupyterhub/action-major-minor-tag-calculator@v3
|
|
||||||
with:
|
|
||||||
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
prefix: >-
|
|
||||||
${{ env.REGISTRY }}jupyterhub/jupyterhub-demo:
|
|
||||||
jupyterhub/jupyterhub-demo:
|
|
||||||
defaultTag: "${{ env.REGISTRY }}jupyterhub/jupyterhub-demo:noref"
|
|
||||||
branchRegex: ^\w[\w-.]*$
|
|
||||||
|
|
||||||
- name: Build and push jupyterhub-demo
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
build-args: |
|
|
||||||
BASE_IMAGE=${{ fromJson(steps.onbuildtags.outputs.tags)[0] }}
|
|
||||||
context: demo-image
|
|
||||||
# linux/arm64 currently fails:
|
|
||||||
# ERROR: Could not build wheels for argon2-cffi which use PEP 517 and cannot be installed directly
|
|
||||||
# ERROR: executor failed running [/bin/sh -c python3 -m pip install notebook]: exit code: 1
|
|
||||||
platforms: linux/amd64
|
|
||||||
push: true
|
|
||||||
tags: ${{ join(fromJson(steps.demotags.outputs.tags)) }}
|
|
||||||
|
|
||||||
# image: jupyterhub/singleuser
|
|
||||||
#
|
|
||||||
- name: Get list of jupyterhub/singleuser tags
|
|
||||||
id: singleusertags
|
|
||||||
uses: jupyterhub/action-major-minor-tag-calculator@v3
|
|
||||||
with:
|
|
||||||
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
prefix: >-
|
|
||||||
${{ env.REGISTRY }}jupyterhub/singleuser:
|
|
||||||
jupyterhub/singleuser:
|
|
||||||
defaultTag: "${{ env.REGISTRY }}jupyterhub/singleuser:noref"
|
|
||||||
branchRegex: ^\w[\w-.]*$
|
|
||||||
|
|
||||||
- name: Build and push jupyterhub/singleuser
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
build-args: |
|
|
||||||
JUPYTERHUB_VERSION=${{ github.ref_type == 'tag' && github.ref_name || format('git:{0}', github.sha) }}
|
|
||||||
context: singleuser
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
push: true
|
|
||||||
tags: ${{ join(fromJson(steps.singleusertags.outputs.tags)) }}
|
|
||||||
|
23
.github/workflows/test-docs.yml
vendored
23
.github/workflows/test-docs.yml
vendored
@@ -29,6 +29,9 @@ on:
|
|||||||
- "**"
|
- "**"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# UTF-8 content may be interpreted as ascii and causes errors without this.
|
# UTF-8 content may be interpreted as ascii and causes errors without this.
|
||||||
LANG: C.UTF-8
|
LANG: C.UTF-8
|
||||||
@@ -38,9 +41,9 @@ jobs:
|
|||||||
validate-rest-api-definition:
|
validate-rest-api-definition:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v5
|
||||||
with:
|
with:
|
||||||
node-version: "20"
|
node-version: "20"
|
||||||
cache: npm
|
cache: npm
|
||||||
@@ -52,15 +55,19 @@ jobs:
|
|||||||
test-docs:
|
test-docs:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
# make rediraffecheckdiff requires git history to compare current
|
# make rediraffecheckdiff requires git history to compare current
|
||||||
# commit with the main branch and previous releases.
|
# commit with the main branch and previous releases.
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: "3.11"
|
python-version: "3.11"
|
||||||
|
cache: pip
|
||||||
|
cache-dependency-path: |
|
||||||
|
requirements.txt
|
||||||
|
docs/requirements.txt
|
||||||
|
|
||||||
- name: Install requirements
|
- name: Install requirements
|
||||||
run: |
|
run: |
|
||||||
@@ -77,10 +84,12 @@ jobs:
|
|||||||
cd docs
|
cd docs
|
||||||
make html
|
make html
|
||||||
|
|
||||||
|
# Output broken and permanently redirected links in a readable format
|
||||||
- name: check links
|
- name: check links
|
||||||
run: |
|
uses: manics/action-sphinx-linkcheck-summary@main
|
||||||
cd docs
|
with:
|
||||||
make linkcheck
|
docs-dir: docs
|
||||||
|
build-dir: docs/_build
|
||||||
|
|
||||||
# make rediraffecheckdiff compares files for different changesets
|
# make rediraffecheckdiff compares files for different changesets
|
||||||
# these diff targets aren't always available
|
# these diff targets aren't always available
|
||||||
|
4
.github/workflows/test-jsx.yml
vendored
4
.github/workflows/test-jsx.yml
vendored
@@ -32,8 +32,8 @@ jobs:
|
|||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v5
|
||||||
with:
|
with:
|
||||||
node-version: "20"
|
node-version: "20"
|
||||||
|
|
||||||
|
42
.github/workflows/test.yml
vendored
42
.github/workflows/test.yml
vendored
@@ -139,11 +139,11 @@ jobs:
|
|||||||
if [ "${{ matrix.jupyverse }}" != "" ]; then
|
if [ "${{ matrix.jupyverse }}" != "" ]; then
|
||||||
echo "JUPYTERHUB_SINGLEUSER_APP=jupyverse" >> $GITHUB_ENV
|
echo "JUPYTERHUB_SINGLEUSER_APP=jupyverse" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
# NOTE: actions/setup-node@v4 make use of a cache within the GitHub base
|
# NOTE: actions/setup-node@v5 make use of a cache within the GitHub base
|
||||||
# environment and setup in a fraction of a second.
|
# environment and setup in a fraction of a second.
|
||||||
- name: Install Node
|
- name: Install Node
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v5
|
||||||
with:
|
with:
|
||||||
node-version: "20"
|
node-version: "20"
|
||||||
- name: Install Javascript dependencies
|
- name: Install Javascript dependencies
|
||||||
@@ -152,12 +152,17 @@ jobs:
|
|||||||
npm install -g configurable-http-proxy yarn
|
npm install -g configurable-http-proxy yarn
|
||||||
npm list
|
npm list
|
||||||
|
|
||||||
# NOTE: actions/setup-python@v5 make use of a cache within the GitHub base
|
# NOTE: actions/setup-python@v6 make use of a cache within the GitHub base
|
||||||
# environment and setup in a fraction of a second.
|
# environment and setup in a fraction of a second.
|
||||||
- name: Install Python ${{ matrix.python }}
|
- name: Install Python ${{ matrix.python }}
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: "${{ matrix.python }}"
|
python-version: "${{ matrix.python }}"
|
||||||
|
cache: pip
|
||||||
|
cache-dependency-path: |
|
||||||
|
pyproject.toml
|
||||||
|
requirements.txt
|
||||||
|
ci/oldest-dependencies/requirements.old
|
||||||
|
|
||||||
- name: Install Python dependencies
|
- name: Install Python dependencies
|
||||||
run: |
|
run: |
|
||||||
@@ -168,7 +173,7 @@ jobs:
|
|||||||
# make sure our `>=` pins really do express our minimum supported versions
|
# make sure our `>=` pins really do express our minimum supported versions
|
||||||
pip install -r ci/oldest-dependencies/requirements.old -e .
|
pip install -r ci/oldest-dependencies/requirements.old -e .
|
||||||
else
|
else
|
||||||
pip install -e ".[test]"
|
pip install --pre -e ".[test]" "pycurl; python_version >= '3.10'"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${{ matrix.main_dependencies }}" != "" ]; then
|
if [ "${{ matrix.main_dependencies }}" != "" ]; then
|
||||||
@@ -247,31 +252,10 @@ jobs:
|
|||||||
|
|
||||||
- name: Ensure browsers are installed for playwright
|
- name: Ensure browsers are installed for playwright
|
||||||
if: matrix.browser
|
if: matrix.browser
|
||||||
run: python -m playwright install --with-deps
|
run: python -m playwright install --with-deps firefox
|
||||||
|
|
||||||
- name: Run pytest
|
- name: Run pytest
|
||||||
run: |
|
run: |
|
||||||
pytest -k "${{ matrix.subset }}" --maxfail=2 --cov=jupyterhub jupyterhub/tests
|
pytest -k "${{ matrix.subset }}" --maxfail=2 --cov=jupyterhub jupyterhub/tests
|
||||||
|
|
||||||
- uses: codecov/codecov-action@v4
|
- uses: codecov/codecov-action@v5
|
||||||
|
|
||||||
docker-build:
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
timeout-minutes: 20
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: build images
|
|
||||||
run: |
|
|
||||||
DOCKER_BUILDKIT=1 docker build -t jupyterhub/jupyterhub .
|
|
||||||
docker build -t jupyterhub/jupyterhub-onbuild onbuild
|
|
||||||
docker build -t jupyterhub/singleuser singleuser
|
|
||||||
|
|
||||||
- name: smoke test jupyterhub
|
|
||||||
run: |
|
|
||||||
docker run --rm -t jupyterhub/jupyterhub jupyterhub --help
|
|
||||||
|
|
||||||
- name: verify static files
|
|
||||||
run: |
|
|
||||||
docker run --rm -t -v $PWD/dockerfiles:/io jupyterhub/jupyterhub python3 /io/test.py
|
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -7,8 +7,6 @@ node_modules
|
|||||||
dist
|
dist
|
||||||
docs/_build
|
docs/_build
|
||||||
docs/build
|
docs/build
|
||||||
docs/source/_static/rest-api
|
|
||||||
docs/source/rbac/scope-table.md
|
|
||||||
docs/source/reference/metrics.md
|
docs/source/reference/metrics.md
|
||||||
|
|
||||||
.ipynb_checkpoints
|
.ipynb_checkpoints
|
||||||
|
@@ -16,7 +16,7 @@ ci:
|
|||||||
repos:
|
repos:
|
||||||
# autoformat and lint Python code
|
# autoformat and lint Python code
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
rev: v0.4.3
|
rev: v0.12.11
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
types_or:
|
types_or:
|
||||||
@@ -29,15 +29,15 @@ repos:
|
|||||||
- jupyter
|
- jupyter
|
||||||
|
|
||||||
# Autoformat: markdown, yaml, javascript (see the file .prettierignore)
|
# Autoformat: markdown, yaml, javascript (see the file .prettierignore)
|
||||||
- repo: https://github.com/pre-commit/mirrors-prettier
|
- repo: https://github.com/rbubley/mirrors-prettier
|
||||||
rev: v4.0.0-alpha.8
|
rev: v3.6.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: prettier
|
- id: prettier
|
||||||
exclude: .*/templates/.*
|
exclude: .*/templates/.*|docs/source/_static/rest-api.yml|docs/source/rbac/scope-table.md
|
||||||
|
|
||||||
# autoformat HTML templates
|
# autoformat HTML templates
|
||||||
- repo: https://github.com/djlint/djLint
|
- repo: https://github.com/djlint/djLint
|
||||||
rev: v1.34.1
|
rev: v1.36.4
|
||||||
hooks:
|
hooks:
|
||||||
- id: djlint-reformat-jinja
|
- id: djlint-reformat-jinja
|
||||||
files: ".*templates/.*.html"
|
files: ".*templates/.*.html"
|
||||||
@@ -49,10 +49,38 @@ repos:
|
|||||||
|
|
||||||
# Autoformat and linting, misc. details
|
# Autoformat and linting, misc. details
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.6.0
|
rev: v6.0.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
exclude: share/jupyterhub/static/js/admin-react.js
|
exclude: share/jupyterhub/static/js/admin-react.js
|
||||||
- id: requirements-txt-fixer
|
- id: requirements-txt-fixer
|
||||||
- id: check-case-conflict
|
- id: check-case-conflict
|
||||||
- id: check-executables-have-shebangs
|
- id: check-executables-have-shebangs
|
||||||
|
|
||||||
|
# source docs: rest-api.yml and scope-table.md are autogenerated
|
||||||
|
- repo: local
|
||||||
|
hooks:
|
||||||
|
- id: update-api-and-scope-docs
|
||||||
|
name: Update rest-api.yml and scope-table.md based on scopes.py
|
||||||
|
language: python
|
||||||
|
additional_dependencies: ["pytablewriter", "ruamel.yaml"]
|
||||||
|
entry: python docs/source/rbac/generate-scope-table.py
|
||||||
|
args:
|
||||||
|
- --update
|
||||||
|
files: jupyterhub/scopes.py
|
||||||
|
pass_filenames: false
|
||||||
|
|
||||||
|
# run eslint in the jsx directory
|
||||||
|
# need to pass through 'jsx:install-run' hook in
|
||||||
|
# top-level package.json to ensure dependencies are installed
|
||||||
|
# eslint pre-commit hook doesn't really work with eslint 9,
|
||||||
|
# so use `npm run lint:fix`
|
||||||
|
- id: jsx-eslint
|
||||||
|
name: eslint in jsx/
|
||||||
|
entry: npm run jsx:install-run lint:fix
|
||||||
|
pass_filenames: false
|
||||||
|
language: node
|
||||||
|
files: "jsx/.*"
|
||||||
|
# can't run on pre-commit; hangs, for some reason
|
||||||
|
stages:
|
||||||
|
- manual
|
||||||
|
@@ -8,10 +8,9 @@ sphinx:
|
|||||||
configuration: docs/source/conf.py
|
configuration: docs/source/conf.py
|
||||||
|
|
||||||
build:
|
build:
|
||||||
os: ubuntu-22.04
|
os: ubuntu-24.04
|
||||||
tools:
|
tools:
|
||||||
nodejs: "20"
|
python: "3.13"
|
||||||
python: "3.11"
|
|
||||||
|
|
||||||
python:
|
python:
|
||||||
install:
|
install:
|
||||||
|
@@ -12,3 +12,29 @@ Please see our documentation on
|
|||||||
- [Testing JupyterHub and linting code](https://jupyterhub.readthedocs.io/en/latest/contributing/tests.html)
|
- [Testing JupyterHub and linting code](https://jupyterhub.readthedocs.io/en/latest/contributing/tests.html)
|
||||||
|
|
||||||
If you need some help, feel free to ask on [Gitter](https://gitter.im/jupyterhub/jupyterhub) or [Discourse](https://discourse.jupyter.org/).
|
If you need some help, feel free to ask on [Gitter](https://gitter.im/jupyterhub/jupyterhub) or [Discourse](https://discourse.jupyter.org/).
|
||||||
|
|
||||||
|
## Our Copyright Policy
|
||||||
|
|
||||||
|
Jupyter uses a shared copyright model. Each contributor maintains copyright
|
||||||
|
over their contributions to Jupyter. But, it is important to note that these
|
||||||
|
contributions are typically only changes to the repositories. Thus, the Jupyter
|
||||||
|
source code, in its entirety is not the copyright of any single person or
|
||||||
|
institution. Instead, it is the collective copyright of the entire Jupyter
|
||||||
|
Development Team. If individual contributors want to maintain a record of what
|
||||||
|
changes/contributions they have specific copyright on, they should indicate
|
||||||
|
their copyright in the commit message of the change, when they commit the
|
||||||
|
change to one of the Jupyter repositories.
|
||||||
|
|
||||||
|
With this in mind, the following banner should be used in any source code file
|
||||||
|
to indicate the copyright and license terms:
|
||||||
|
|
||||||
|
# Copyright (c) Jupyter Development Team.
|
||||||
|
# Distributed under the terms of the Modified BSD License.
|
||||||
|
|
||||||
|
### About the Jupyter Development Team
|
||||||
|
|
||||||
|
The Jupyter Development Team is the set of all contributors to the Jupyter project.
|
||||||
|
This includes all of the Jupyter subprojects.
|
||||||
|
|
||||||
|
The team that coordinates JupyterHub subproject can be found here:
|
||||||
|
https://compass.hub.jupyter.org/page/governance.html
|
||||||
|
59
COPYING.md
59
COPYING.md
@@ -1,59 +0,0 @@
|
|||||||
# The Jupyter multi-user notebook server licensing terms
|
|
||||||
|
|
||||||
Jupyter multi-user notebook server is licensed under the terms of the Modified BSD License
|
|
||||||
(also known as New or Revised or 3-Clause BSD), as follows:
|
|
||||||
|
|
||||||
- Copyright (c) 2014-, Jupyter Development Team
|
|
||||||
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are met:
|
|
||||||
|
|
||||||
Redistributions of source code must retain the above copyright notice, this
|
|
||||||
list of conditions and the following disclaimer.
|
|
||||||
|
|
||||||
Redistributions in binary form must reproduce the above copyright notice, this
|
|
||||||
list of conditions and the following disclaimer in the documentation and/or
|
|
||||||
other materials provided with the distribution.
|
|
||||||
|
|
||||||
Neither the name of the Jupyter Development Team nor the names of its
|
|
||||||
contributors may be used to endorse or promote products derived from this
|
|
||||||
software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
||||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
|
||||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
## About the Jupyter Development Team
|
|
||||||
|
|
||||||
The Jupyter Development Team is the set of all contributors to the Jupyter project.
|
|
||||||
This includes all of the Jupyter subprojects.
|
|
||||||
|
|
||||||
The core team that coordinates development on GitHub can be found here:
|
|
||||||
https://github.com/jupyter/.
|
|
||||||
|
|
||||||
## Our Copyright Policy
|
|
||||||
|
|
||||||
Jupyter uses a shared copyright model. Each contributor maintains copyright
|
|
||||||
over their contributions to Jupyter. But, it is important to note that these
|
|
||||||
contributions are typically only changes to the repositories. Thus, the Jupyter
|
|
||||||
source code, in its entirety is not the copyright of any single person or
|
|
||||||
institution. Instead, it is the collective copyright of the entire Jupyter
|
|
||||||
Development Team. If individual contributors want to maintain a record of what
|
|
||||||
changes/contributions they have specific copyright on, they should indicate
|
|
||||||
their copyright in the commit message of the change, when they commit the
|
|
||||||
change to one of the Jupyter repositories.
|
|
||||||
|
|
||||||
With this in mind, the following banner should be used in any source code file
|
|
||||||
to indicate the copyright and license terms:
|
|
||||||
|
|
||||||
# Copyright (c) Jupyter Development Team.
|
|
||||||
# Distributed under the terms of the Modified BSD License.
|
|
146
Dockerfile
146
Dockerfile
@@ -1,146 +0,0 @@
|
|||||||
# An incomplete base Docker image for running JupyterHub
|
|
||||||
#
|
|
||||||
# Add your configuration to create a complete derivative Docker image.
|
|
||||||
#
|
|
||||||
# Include your configuration settings by starting with one of two options:
|
|
||||||
#
|
|
||||||
# Option 1:
|
|
||||||
#
|
|
||||||
# FROM quay.io/jupyterhub/jupyterhub:latest
|
|
||||||
#
|
|
||||||
# And put your configuration file jupyterhub_config.py in /srv/jupyterhub/jupyterhub_config.py.
|
|
||||||
#
|
|
||||||
# Option 2:
|
|
||||||
#
|
|
||||||
# Or you can create your jupyterhub config and database on the host machine, and mount it with:
|
|
||||||
#
|
|
||||||
# docker run -v $PWD:/srv/jupyterhub -t quay.io/jupyterhub/jupyterhub
|
|
||||||
#
|
|
||||||
# NOTE
|
|
||||||
# If you base on quay.io/jupyterhub/jupyterhub-onbuild
|
|
||||||
# your jupyterhub_config.py will be added automatically
|
|
||||||
# from your docker directory.
|
|
||||||
|
|
||||||
######################################################################
|
|
||||||
# This Dockerfile uses multi-stage builds with optimisations to build
|
|
||||||
# the JupyterHub wheel on the native architecture only
|
|
||||||
# https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/
|
|
||||||
|
|
||||||
ARG BASE_IMAGE=ubuntu:22.04
|
|
||||||
|
|
||||||
|
|
||||||
######################################################################
|
|
||||||
# The JupyterHub wheel is pure Python so can be built for any platform
|
|
||||||
# on the native architecture (avoiding QEMU emulation)
|
|
||||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} $BASE_IMAGE AS jupyterhub-builder
|
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
|
|
||||||
# Don't clear apt cache, and don't combine RUN commands, so that cached layers can
|
|
||||||
# be reused in other stages
|
|
||||||
|
|
||||||
RUN apt-get update -qq \
|
|
||||||
&& apt-get install -yqq --no-install-recommends \
|
|
||||||
build-essential \
|
|
||||||
ca-certificates \
|
|
||||||
curl \
|
|
||||||
git \
|
|
||||||
gnupg \
|
|
||||||
locales \
|
|
||||||
python3-dev \
|
|
||||||
python3-pip \
|
|
||||||
python3-pycurl \
|
|
||||||
python3-venv \
|
|
||||||
&& python3 -m pip install --no-cache-dir --upgrade setuptools pip build wheel
|
|
||||||
# Ubuntu 22.04 comes with Nodejs 12 which is too old for building JupyterHub JS
|
|
||||||
# It's fine at runtime though (used only by configurable-http-proxy)
|
|
||||||
ARG NODE_MAJOR=20
|
|
||||||
RUN mkdir -p /etc/apt/keyrings \
|
|
||||||
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
|
|
||||||
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
|
|
||||||
&& apt-get update \
|
|
||||||
&& apt-get install -yqq --no-install-recommends \
|
|
||||||
nodejs
|
|
||||||
|
|
||||||
WORKDIR /src/jupyterhub
|
|
||||||
# copy everything except whats in .dockerignore, its a
|
|
||||||
# compromise between needing to rebuild and maintaining
|
|
||||||
# what needs to be part of the build
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
ARG PIP_CACHE_DIR=/tmp/pip-cache
|
|
||||||
RUN --mount=type=cache,target=${PIP_CACHE_DIR} \
|
|
||||||
python3 -m build --wheel
|
|
||||||
|
|
||||||
# verify installed files
|
|
||||||
RUN --mount=type=cache,target=${PIP_CACHE_DIR} \
|
|
||||||
python3 -m pip install ./dist/*.whl \
|
|
||||||
&& cd ci \
|
|
||||||
&& python3 check_installed_data.py
|
|
||||||
|
|
||||||
######################################################################
|
|
||||||
# All other wheels required by JupyterHub, some are platform specific
|
|
||||||
FROM $BASE_IMAGE AS wheel-builder
|
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
|
|
||||||
RUN apt-get update -qq \
|
|
||||||
&& apt-get install -yqq --no-install-recommends \
|
|
||||||
build-essential \
|
|
||||||
ca-certificates \
|
|
||||||
curl \
|
|
||||||
locales \
|
|
||||||
python3-dev \
|
|
||||||
python3-pip \
|
|
||||||
python3-pycurl \
|
|
||||||
python3-venv \
|
|
||||||
&& python3 -m pip install --no-cache-dir --upgrade setuptools pip build wheel
|
|
||||||
|
|
||||||
WORKDIR /src/jupyterhub
|
|
||||||
|
|
||||||
COPY --from=jupyterhub-builder /src/jupyterhub/dist/*.whl /src/jupyterhub/dist/
|
|
||||||
ARG PIP_CACHE_DIR=/tmp/pip-cache
|
|
||||||
RUN --mount=type=cache,target=${PIP_CACHE_DIR} \
|
|
||||||
python3 -m pip wheel --wheel-dir wheelhouse dist/*.whl
|
|
||||||
|
|
||||||
|
|
||||||
######################################################################
|
|
||||||
# The final JupyterHub image, platform specific
|
|
||||||
FROM $BASE_IMAGE AS jupyterhub
|
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive \
|
|
||||||
SHELL=/bin/bash \
|
|
||||||
LC_ALL=en_US.UTF-8 \
|
|
||||||
LANG=en_US.UTF-8 \
|
|
||||||
LANGUAGE=en_US.UTF-8 \
|
|
||||||
PYTHONDONTWRITEBYTECODE=1
|
|
||||||
|
|
||||||
EXPOSE 8000
|
|
||||||
|
|
||||||
LABEL maintainer="Jupyter Project <jupyter@googlegroups.com>"
|
|
||||||
LABEL org.jupyter.service="jupyterhub"
|
|
||||||
|
|
||||||
WORKDIR /srv/jupyterhub
|
|
||||||
|
|
||||||
RUN apt-get update -qq \
|
|
||||||
&& apt-get install -yqq --no-install-recommends \
|
|
||||||
ca-certificates \
|
|
||||||
curl \
|
|
||||||
gnupg \
|
|
||||||
locales \
|
|
||||||
python-is-python3 \
|
|
||||||
python3-pip \
|
|
||||||
python3-pycurl \
|
|
||||||
nodejs \
|
|
||||||
npm \
|
|
||||||
&& locale-gen $LC_ALL \
|
|
||||||
&& npm install -g configurable-http-proxy@^4.2.0 \
|
|
||||||
# clean cache and logs
|
|
||||||
&& rm -rf /var/lib/apt/lists/* /var/log/* /var/tmp/* ~/.npm
|
|
||||||
# install the wheels we built in the previous stage
|
|
||||||
RUN --mount=type=cache,from=wheel-builder,source=/src/jupyterhub/wheelhouse,target=/tmp/wheelhouse \
|
|
||||||
# always make sure pip is up to date!
|
|
||||||
python3 -m pip install --no-compile --no-cache-dir --upgrade setuptools pip \
|
|
||||||
&& python3 -m pip install --no-compile --no-cache-dir /tmp/wheelhouse/*
|
|
||||||
|
|
||||||
CMD ["jupyterhub"]
|
|
11
LICENSE
Normal file
11
LICENSE
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
Copyright 2014-, Jupyter Development Team
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
@@ -58,7 +58,6 @@ for administration of the Hub and its users.
|
|||||||
- A Linux/Unix based system
|
- A Linux/Unix based system
|
||||||
- [Python](https://www.python.org/downloads/) 3.8 or greater
|
- [Python](https://www.python.org/downloads/) 3.8 or greater
|
||||||
- [nodejs/npm](https://www.npmjs.com/)
|
- [nodejs/npm](https://www.npmjs.com/)
|
||||||
|
|
||||||
- If you are using **`conda`**, the nodejs and npm dependencies will be installed for
|
- If you are using **`conda`**, the nodejs and npm dependencies will be installed for
|
||||||
you by conda.
|
you by conda.
|
||||||
|
|
||||||
@@ -111,7 +110,7 @@ Visit `http://localhost:8000` in your browser, and sign in with your system user
|
|||||||
|
|
||||||
_Note_: To allow multiple users to sign in to the server, you will need to
|
_Note_: To allow multiple users to sign in to the server, you will need to
|
||||||
run the `jupyterhub` command as a _privileged user_, such as root.
|
run the `jupyterhub` command as a _privileged user_, such as root.
|
||||||
The [wiki](https://github.com/jupyterhub/jupyterhub/wiki/Using-sudo-to-run-JupyterHub-without-root-privileges)
|
The [documentation](https://jupyterhub.readthedocs.io/en/latest/howto/configuration/config-sudo.html)
|
||||||
describes how to run the server as a _less privileged user_, which requires
|
describes how to run the server as a _less privileged user_, which requires
|
||||||
more configuration of the system.
|
more configuration of the system.
|
||||||
|
|
||||||
@@ -220,7 +219,7 @@ docker container or Linux VM.
|
|||||||
We use a shared copyright model that enables all contributors to maintain the
|
We use a shared copyright model that enables all contributors to maintain the
|
||||||
copyright on their contributions.
|
copyright on their contributions.
|
||||||
|
|
||||||
All code is licensed under the terms of the [revised BSD license](./COPYING.md).
|
All code is licensed under the terms of the [revised BSD license](./LICENSE).
|
||||||
|
|
||||||
## Help and resources
|
## Help and resources
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
# Reporting a Vulnerability
|
# Reporting a Vulnerability
|
||||||
|
|
||||||
If you believe you’ve found a security vulnerability in a Jupyter
|
If you believe you’ve found a security vulnerability in a Jupyter
|
||||||
project, please report it to security@ipython.org. If you prefer to
|
project, please report it!
|
||||||
encrypt your security reports, you can use [this PGP public key](https://jupyter-notebook.readthedocs.io/en/stable/_downloads/1d303a645f2505a8fd283826fafc9908/ipython_security.asc).
|
See the [security documentation](https://jupyterhub.readthedocs.org/en/latest/contributing/security.html) for how.
|
||||||
|
@@ -1,16 +0,0 @@
|
|||||||
# Demo JupyterHub Docker image
|
|
||||||
#
|
|
||||||
# This should only be used for demo or testing and not as a base image to build on.
|
|
||||||
#
|
|
||||||
# It includes the notebook package and it uses the DummyAuthenticator and the SimpleLocalProcessSpawner.
|
|
||||||
ARG BASE_IMAGE=quay.io/jupyterhub/jupyterhub-onbuild
|
|
||||||
FROM ${BASE_IMAGE}
|
|
||||||
|
|
||||||
# Install the notebook package
|
|
||||||
RUN python3 -m pip install notebook
|
|
||||||
|
|
||||||
# Create a demo user
|
|
||||||
RUN useradd --create-home demo
|
|
||||||
RUN chown demo .
|
|
||||||
|
|
||||||
USER demo
|
|
@@ -1,26 +0,0 @@
|
|||||||
## Demo Dockerfile
|
|
||||||
|
|
||||||
This is a demo JupyterHub Docker image to help you get a quick overview of what
|
|
||||||
JupyterHub is and how it works.
|
|
||||||
|
|
||||||
It uses the SimpleLocalProcessSpawner to spawn new user servers and
|
|
||||||
DummyAuthenticator for authentication.
|
|
||||||
The DummyAuthenticator allows you to log in with any username & password and the
|
|
||||||
SimpleLocalProcessSpawner allows starting servers without having to create a
|
|
||||||
local user for each JupyterHub user.
|
|
||||||
|
|
||||||
### Important!
|
|
||||||
|
|
||||||
This should only be used for demo or testing purposes!
|
|
||||||
It shouldn't be used as a base image to build on.
|
|
||||||
|
|
||||||
### Try it
|
|
||||||
|
|
||||||
1. `cd` to the root of your jupyterhub repo.
|
|
||||||
|
|
||||||
2. Build the demo image with `docker build -t jupyterhub-demo demo-image`.
|
|
||||||
|
|
||||||
3. Run the demo image with `docker run -d -p 8000:8000 jupyterhub-demo`.
|
|
||||||
|
|
||||||
4. Visit http://localhost:8000 and login with any username and password
|
|
||||||
5. Happy demo-ing :tada:!
|
|
@@ -1,7 +0,0 @@
|
|||||||
# Configuration file for jupyterhub-demo
|
|
||||||
|
|
||||||
c = get_config() # noqa
|
|
||||||
|
|
||||||
# Use DummyAuthenticator and SimpleSpawner
|
|
||||||
c.JupyterHub.spawner_class = "simple"
|
|
||||||
c.JupyterHub.authenticator_class = "dummy"
|
|
@@ -1,14 +0,0 @@
|
|||||||
import os
|
|
||||||
|
|
||||||
from jupyterhub._data import DATA_FILES_PATH
|
|
||||||
|
|
||||||
print(f"DATA_FILES_PATH={DATA_FILES_PATH}")
|
|
||||||
|
|
||||||
for sub_path in (
|
|
||||||
"templates",
|
|
||||||
"static/components",
|
|
||||||
"static/css/style.min.css",
|
|
||||||
"static/js/admin-react.js",
|
|
||||||
):
|
|
||||||
path = os.path.join(DATA_FILES_PATH, sub_path)
|
|
||||||
assert os.path.exists(path), path
|
|
@@ -35,7 +35,7 @@ help:
|
|||||||
# - NOTE: If the pre-requisites for the html target is updated, also update the
|
# - NOTE: If the pre-requisites for the html target is updated, also update the
|
||||||
# Read The Docs section in docs/source/conf.py.
|
# Read The Docs section in docs/source/conf.py.
|
||||||
#
|
#
|
||||||
html: metrics scopes
|
html: metrics
|
||||||
$(SPHINXBUILD) -b html "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS)
|
$(SPHINXBUILD) -b html "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS)
|
||||||
@echo
|
@echo
|
||||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
||||||
@@ -44,10 +44,6 @@ metrics: source/reference/metrics.md
|
|||||||
source/reference/metrics.md:
|
source/reference/metrics.md:
|
||||||
python3 generate-metrics.py
|
python3 generate-metrics.py
|
||||||
|
|
||||||
scopes: source/rbac/scope-table.md
|
|
||||||
source/rbac/scope-table.md:
|
|
||||||
python3 source/rbac/generate-scope-table.py
|
|
||||||
|
|
||||||
|
|
||||||
# Manually added targets - related to development
|
# Manually added targets - related to development
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
@@ -56,7 +52,7 @@ source/rbac/scope-table.md:
|
|||||||
# - requires sphinx-autobuild, see
|
# - requires sphinx-autobuild, see
|
||||||
# https://sphinxcontrib-spelling.readthedocs.io/en/latest/
|
# https://sphinxcontrib-spelling.readthedocs.io/en/latest/
|
||||||
# - builds and rebuilds html on changes to source, but does not re-generate
|
# - builds and rebuilds html on changes to source, but does not re-generate
|
||||||
# metrics/scopes files
|
# metrics files
|
||||||
# - starts a livereload enabled webserver and opens up a browser
|
# - starts a livereload enabled webserver and opens up a browser
|
||||||
devenv: html
|
devenv: html
|
||||||
sphinx-autobuild -b html --open-browser "$(SOURCEDIR)" "$(BUILDDIR)/html"
|
sphinx-autobuild -b html --open-browser "$(SOURCEDIR)" "$(BUILDDIR)/html"
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
# don't depend on it here, as that often results in a duplicate
|
# don't depend on it here, as that often results in a duplicate
|
||||||
# installation of jupyterhub that's already installed
|
# installation of jupyterhub that's already installed
|
||||||
autodoc-traits
|
autodoc-traits
|
||||||
|
intersphinx-registry
|
||||||
jupyterhub-sphinx-theme
|
jupyterhub-sphinx-theme
|
||||||
myst-parser>=0.19
|
myst-parser>=0.19
|
||||||
pre-commit
|
pre-commit
|
||||||
|
@@ -7,7 +7,7 @@ info:
|
|||||||
license:
|
license:
|
||||||
name: BSD-3-Clause
|
name: BSD-3-Clause
|
||||||
identifier: BSD-3-Clause
|
identifier: BSD-3-Clause
|
||||||
version: 5.0.0b2
|
version: 5.4.0
|
||||||
servers:
|
servers:
|
||||||
- url: /hub/api
|
- url: /hub/api
|
||||||
security:
|
security:
|
||||||
@@ -62,20 +62,19 @@ paths:
|
|||||||
properties:
|
properties:
|
||||||
class:
|
class:
|
||||||
type: string
|
type: string
|
||||||
description:
|
description: The Python class currently active for
|
||||||
The Python class currently active for JupyterHub
|
JupyterHub Authentication
|
||||||
Authentication
|
|
||||||
version:
|
version:
|
||||||
type: string
|
type: string
|
||||||
description: The version of the currently active Authenticator
|
description: The version of the currently active
|
||||||
|
Authenticator
|
||||||
spawner:
|
spawner:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
class:
|
class:
|
||||||
type: string
|
type: string
|
||||||
description:
|
description: The Python class currently active for
|
||||||
The Python class currently active for spawning
|
spawning single-user notebook servers
|
||||||
single-user notebook servers
|
|
||||||
version:
|
version:
|
||||||
type: string
|
type: string
|
||||||
description: The version of the currently active Spawner
|
description: The version of the currently active Spawner
|
||||||
@@ -258,9 +257,8 @@ paths:
|
|||||||
parameters:
|
parameters:
|
||||||
- $ref: "#/components/parameters/userName"
|
- $ref: "#/components/parameters/userName"
|
||||||
requestBody:
|
requestBody:
|
||||||
description:
|
description: Updated user info. At least one key to be updated (name or
|
||||||
Updated user info. At least one key to be updated (name or admin)
|
admin) is required.
|
||||||
is required.
|
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
@@ -268,14 +266,12 @@ paths:
|
|||||||
properties:
|
properties:
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
description:
|
description: the new name (optional, if another key is updated
|
||||||
the new name (optional, if another key is updated i.e.
|
i.e. admin)
|
||||||
admin)
|
|
||||||
admin:
|
admin:
|
||||||
type: boolean
|
type: boolean
|
||||||
description:
|
description: update admin (optional, if another key is updated
|
||||||
update admin (optional, if another key is updated i.e.
|
i.e. name)
|
||||||
name)
|
|
||||||
required: true
|
required: true
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
@@ -291,9 +287,8 @@ paths:
|
|||||||
post:
|
post:
|
||||||
operationId: post-user-activity
|
operationId: post-user-activity
|
||||||
summary: Notify Hub of activity for a given user
|
summary: Notify Hub of activity for a given user
|
||||||
description:
|
description: Notify the Hub of activity by the user, e.g. accessing a
|
||||||
Notify the Hub of activity by the user, e.g. accessing a service
|
service or (more likely) actively using a server.
|
||||||
or (more likely) actively using a server.
|
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: "#/components/parameters/userName"
|
- $ref: "#/components/parameters/userName"
|
||||||
requestBody:
|
requestBody:
|
||||||
@@ -372,9 +367,8 @@ paths:
|
|||||||
description: The user's notebook server has started
|
description: The user's notebook server has started
|
||||||
content: {}
|
content: {}
|
||||||
202:
|
202:
|
||||||
description:
|
description: The user's notebook server has not yet started, but has
|
||||||
The user's notebook server has not yet started, but has been
|
been requested
|
||||||
requested
|
|
||||||
content: {}
|
content: {}
|
||||||
security:
|
security:
|
||||||
- oauth2:
|
- oauth2:
|
||||||
@@ -387,9 +381,8 @@ paths:
|
|||||||
- $ref: "#/components/parameters/userName"
|
- $ref: "#/components/parameters/userName"
|
||||||
responses:
|
responses:
|
||||||
202:
|
202:
|
||||||
description:
|
description: The user's notebook server has not yet stopped as it is
|
||||||
The user's notebook server has not yet stopped as it is taking
|
taking a while to stop
|
||||||
a while to stop
|
|
||||||
content: {}
|
content: {}
|
||||||
204:
|
204:
|
||||||
description: The user's notebook server has stopped
|
description: The user's notebook server has stopped
|
||||||
@@ -420,9 +413,8 @@ paths:
|
|||||||
description: The user's notebook named-server has started
|
description: The user's notebook named-server has started
|
||||||
content: {}
|
content: {}
|
||||||
202:
|
202:
|
||||||
description:
|
description: The user's notebook named-server has not yet started, but
|
||||||
The user's notebook named-server has not yet started, but has
|
has been requested
|
||||||
been requested
|
|
||||||
content: {}
|
content: {}
|
||||||
security:
|
security:
|
||||||
- oauth2:
|
- oauth2:
|
||||||
@@ -457,9 +449,8 @@ paths:
|
|||||||
required: false
|
required: false
|
||||||
responses:
|
responses:
|
||||||
202:
|
202:
|
||||||
description:
|
description: The user's notebook named-server has not yet stopped as
|
||||||
The user's notebook named-server has not yet stopped as it
|
it is taking a while to stop
|
||||||
is taking a while to stop
|
|
||||||
content: {}
|
content: {}
|
||||||
204:
|
204:
|
||||||
description: The user's notebook named-server has stopped
|
description: The user's notebook named-server has stopped
|
||||||
@@ -472,9 +463,8 @@ paths:
|
|||||||
get:
|
get:
|
||||||
operationId: get-user-shared
|
operationId: get-user-shared
|
||||||
summary: List servers shared with user
|
summary: List servers shared with user
|
||||||
description:
|
description: Returns list of Shares granting the user access to servers
|
||||||
Returns list of Shares granting the user access to servers owned
|
owned by others (new in 5.0)
|
||||||
by others (new in 5.0)
|
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: "#/components/parameters/userName"
|
- $ref: "#/components/parameters/userName"
|
||||||
|
|
||||||
@@ -587,12 +577,13 @@ paths:
|
|||||||
expires_in:
|
expires_in:
|
||||||
type: number
|
type: number
|
||||||
example: 3600
|
example: 3600
|
||||||
description:
|
description: lifetime (in seconds) after which the requested
|
||||||
lifetime (in seconds) after which the requested token
|
token will expire. Omit, or specify null or 0 for no
|
||||||
will expire. Omit, or specify null or 0 for no expiration.
|
expiration.
|
||||||
note:
|
note:
|
||||||
type: string
|
type: string
|
||||||
description: A note attached to the token for future bookkeeping
|
description: A note attached to the token for future
|
||||||
|
bookkeeping
|
||||||
roles:
|
roles:
|
||||||
type: array
|
type: array
|
||||||
description: |
|
description: |
|
||||||
@@ -770,7 +761,8 @@ paths:
|
|||||||
- $ref: "#/components/parameters/sharedServerName"
|
- $ref: "#/components/parameters/sharedServerName"
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: The permissions granted to members of `group` on `owner/server`
|
description: The permissions granted to members of `group` on
|
||||||
|
`owner/server`
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
@@ -1176,8 +1168,17 @@ paths:
|
|||||||
example: abc123
|
example: abc123
|
||||||
accept_url:
|
accept_url:
|
||||||
type: string
|
type: string
|
||||||
description: The URL for accepting the code
|
description: The URL path for accepting the code
|
||||||
example: /hub/accept-share?code=abc123
|
example: /hub/accept-share?code=abc123
|
||||||
|
full_accept_url:
|
||||||
|
type:
|
||||||
|
- string
|
||||||
|
- "null"
|
||||||
|
description: |
|
||||||
|
The full URL for accepting the code,
|
||||||
|
if JupyterHub.public_url configuration is defined.
|
||||||
|
example:
|
||||||
|
https://hub.example.org/hub/accept-share?code=abc123
|
||||||
security:
|
security:
|
||||||
- oauth2:
|
- oauth2:
|
||||||
- shares
|
- shares
|
||||||
@@ -1254,9 +1255,8 @@ paths:
|
|||||||
get:
|
get:
|
||||||
operationId: get-proxy
|
operationId: get-proxy
|
||||||
summary: Get the proxy's routing table
|
summary: Get the proxy's routing table
|
||||||
description:
|
description: A convenience alias for getting the routing table directly
|
||||||
A convenience alias for getting the routing table directly from
|
from the proxy
|
||||||
the proxy
|
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: "#/components/parameters/paginationOffset"
|
- $ref: "#/components/parameters/paginationOffset"
|
||||||
- $ref: "#/components/parameters/paginationLimit"
|
- $ref: "#/components/parameters/paginationLimit"
|
||||||
@@ -1267,9 +1267,8 @@ paths:
|
|||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
type: object
|
||||||
description:
|
description: configurable-http-proxy routing table (see
|
||||||
configurable-http-proxy routing table (see configurable-http-proxy
|
configurable-http-proxy docs for details)
|
||||||
docs for details)
|
|
||||||
security:
|
security:
|
||||||
- oauth2:
|
- oauth2:
|
||||||
- proxy
|
- proxy
|
||||||
@@ -1288,9 +1287,8 @@ paths:
|
|||||||
summary: Notify the Hub about a new proxy
|
summary: Notify the Hub about a new proxy
|
||||||
description: Notifies the Hub of a new proxy to use.
|
description: Notifies the Hub of a new proxy to use.
|
||||||
requestBody:
|
requestBody:
|
||||||
description:
|
description: Any values that have changed for the new proxy. All keys
|
||||||
Any values that have changed for the new proxy. All keys are
|
are optional.
|
||||||
optional.
|
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
@@ -1381,9 +1379,8 @@ paths:
|
|||||||
get:
|
get:
|
||||||
operationId: get-auth-cookie
|
operationId: get-auth-cookie
|
||||||
summary: Identify a user from a cookie
|
summary: Identify a user from a cookie
|
||||||
description:
|
description: Used by single-user notebook servers to hand off cookie
|
||||||
Used by single-user notebook servers to hand off cookie authentication
|
authentication to the Hub
|
||||||
to the Hub
|
|
||||||
parameters:
|
parameters:
|
||||||
- name: cookie_name
|
- name: cookie_name
|
||||||
in: path
|
in: path
|
||||||
@@ -1507,14 +1504,12 @@ paths:
|
|||||||
properties:
|
properties:
|
||||||
proxy:
|
proxy:
|
||||||
type: boolean
|
type: boolean
|
||||||
description:
|
description: Whether the proxy should be shutdown as well
|
||||||
Whether the proxy should be shutdown as well (default
|
(default from Hub config)
|
||||||
from Hub config)
|
|
||||||
servers:
|
servers:
|
||||||
type: boolean
|
type: boolean
|
||||||
description:
|
description: Whether users' notebook servers should be
|
||||||
Whether users' notebook servers should be shutdown
|
shutdown as well (default from Hub config)
|
||||||
as well (default from Hub config)
|
|
||||||
required: false
|
required: false
|
||||||
responses:
|
responses:
|
||||||
202:
|
202:
|
||||||
@@ -1638,6 +1633,11 @@ components:
|
|||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
description: The user's name
|
description: The user's name
|
||||||
|
kind:
|
||||||
|
type: string
|
||||||
|
description: the string 'user' to distinguish from 'service'
|
||||||
|
enum:
|
||||||
|
- user
|
||||||
admin:
|
admin:
|
||||||
type: boolean
|
type: boolean
|
||||||
description: Whether the user is an admin
|
description: Whether the user is an admin
|
||||||
@@ -1653,9 +1653,8 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
server:
|
server:
|
||||||
type: string
|
type: string
|
||||||
description:
|
description: The user's notebook server's base URL, if running; null
|
||||||
The user's notebook server's base URL, if running; null if
|
if not.
|
||||||
not.
|
|
||||||
pending:
|
pending:
|
||||||
type: string
|
type: string
|
||||||
description: The currently pending action, if any
|
description: The currently pending action, if any
|
||||||
@@ -1686,9 +1685,8 @@ components:
|
|||||||
properties:
|
properties:
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
description:
|
description: The server's name. The user's default server has an empty
|
||||||
The server's name. The user's default server has an empty name
|
name ('')
|
||||||
('')
|
|
||||||
ready:
|
ready:
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
@@ -1750,16 +1748,14 @@ components:
|
|||||||
state:
|
state:
|
||||||
type: object
|
type: object
|
||||||
properties: {}
|
properties: {}
|
||||||
description:
|
description: Arbitrary internal state from this server's spawner. Only
|
||||||
Arbitrary internal state from this server's spawner. Only available
|
available on the hub's users list or get-user-by-name method, and
|
||||||
on the hub's users list or get-user-by-name method, and only with admin:users:server_state
|
only with admin:users:server_state scope. None otherwise.
|
||||||
scope. None otherwise.
|
|
||||||
user_options:
|
user_options:
|
||||||
type: object
|
type: object
|
||||||
properties: {}
|
properties: {}
|
||||||
description:
|
description: User specified options for the user's spawned instance of
|
||||||
User specified options for the user's spawned instance of a
|
a single-user server.
|
||||||
single-user server.
|
|
||||||
RequestIdentity:
|
RequestIdentity:
|
||||||
description: |
|
description: |
|
||||||
The model for the entity making the request.
|
The model for the entity making the request.
|
||||||
@@ -1776,6 +1772,13 @@ components:
|
|||||||
service: "#/components/schemas/Service"
|
service: "#/components/schemas/Service"
|
||||||
- type: object
|
- type: object
|
||||||
properties:
|
properties:
|
||||||
|
kind:
|
||||||
|
type: string
|
||||||
|
description: |
|
||||||
|
'user' or 'service' depending on the entity which owns the token
|
||||||
|
enum:
|
||||||
|
- user
|
||||||
|
- service
|
||||||
session_id:
|
session_id:
|
||||||
type:
|
type:
|
||||||
- string
|
- string
|
||||||
@@ -1812,6 +1815,11 @@ components:
|
|||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
description: The group's name
|
description: The group's name
|
||||||
|
kind:
|
||||||
|
type: string
|
||||||
|
description: Always the string 'group'
|
||||||
|
enum:
|
||||||
|
- group
|
||||||
users:
|
users:
|
||||||
type: array
|
type: array
|
||||||
description: The names of users who are members of this group
|
description: The names of users who are members of this group
|
||||||
@@ -1837,6 +1845,11 @@ components:
|
|||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
description: The service's name
|
description: The service's name
|
||||||
|
kind:
|
||||||
|
type: string
|
||||||
|
description: the string 'service' to distinguish from 'user'
|
||||||
|
enum:
|
||||||
|
- service
|
||||||
admin:
|
admin:
|
||||||
type: boolean
|
type: boolean
|
||||||
description: Whether the service is an admin
|
description: Whether the service is an admin
|
||||||
@@ -1877,7 +1890,14 @@ components:
|
|||||||
description: the server name. '' for the default server.
|
description: the server name. '' for the default server.
|
||||||
url:
|
url:
|
||||||
type: string
|
type: string
|
||||||
description: the server's URL
|
description: the server's URL (path only when not using subdomains)
|
||||||
|
full_url:
|
||||||
|
type:
|
||||||
|
- string
|
||||||
|
- "null"
|
||||||
|
description: |
|
||||||
|
The full URL of the server (`https://hub.example.org/user/:name/:servername`).
|
||||||
|
`null` unless JupyterHub.public_url or subdomains are configured.
|
||||||
ready:
|
ready:
|
||||||
type: boolean
|
type: boolean
|
||||||
description: whether the server is ready
|
description: whether the server is ready
|
||||||
@@ -1903,9 +1923,8 @@ components:
|
|||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
group:
|
group:
|
||||||
description:
|
description: the group being shared with (exactly one of 'user' or
|
||||||
the group being shared with (exactly one of 'user' or 'group'
|
'group' will be non-null, the other will be null)
|
||||||
will be non-null, the other will be null)
|
|
||||||
type:
|
type:
|
||||||
- object
|
- object
|
||||||
- "null"
|
- "null"
|
||||||
@@ -1913,9 +1932,8 @@ components:
|
|||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
user:
|
user:
|
||||||
description:
|
description: the user being shared with (exactly one of 'user' or
|
||||||
the user being shared with (exactly one of 'user' or 'group'
|
'group' will be non-null, the other will be null)
|
||||||
will be non-null, the other will be null)
|
|
||||||
type:
|
type:
|
||||||
- object
|
- object
|
||||||
- "null"
|
- "null"
|
||||||
@@ -1928,9 +1946,8 @@ components:
|
|||||||
format: date-time
|
format: date-time
|
||||||
|
|
||||||
ShareCode:
|
ShareCode:
|
||||||
description:
|
description: A single sharing code. There is at most one of these objects
|
||||||
A single sharing code. There is at most one of these objects per
|
per (server, user) or (server, group) combination.
|
||||||
(server, user) or (server, group) combination.
|
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
server:
|
server:
|
||||||
@@ -1965,41 +1982,41 @@ components:
|
|||||||
properties:
|
properties:
|
||||||
id:
|
id:
|
||||||
type: string
|
type: string
|
||||||
description:
|
description: The id of the API token. Used for modifying or deleting
|
||||||
The id of the API token. Used for modifying or deleting the
|
the token.
|
||||||
token.
|
|
||||||
user:
|
user:
|
||||||
type: string
|
type: string
|
||||||
description: The user that owns a token (undefined if owned by a service)
|
description: The user that owns a token (undefined if owned by a
|
||||||
|
service)
|
||||||
service:
|
service:
|
||||||
type: string
|
type: string
|
||||||
description: The service that owns the token (undefined of owned by a user)
|
description: The service that owns the token (undefined of owned by a
|
||||||
|
user)
|
||||||
roles:
|
roles:
|
||||||
type: array
|
type: array
|
||||||
description:
|
description: Deprecated in JupyterHub 3, always an empty list. Tokens
|
||||||
Deprecated in JupyterHub 3, always an empty list. Tokens have
|
have 'scopes' starting from JupyterHub 3.
|
||||||
'scopes' starting from JupyterHub 3.
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
scopes:
|
scopes:
|
||||||
type: array
|
type: array
|
||||||
description:
|
description: List of scopes this token has been assigned. New in
|
||||||
List of scopes this token has been assigned. New in JupyterHub
|
JupyterHub 3. In JupyterHub 2.x, tokens were assigned 'roles'
|
||||||
3. In JupyterHub 2.x, tokens were assigned 'roles' instead of scopes.
|
instead of scopes.
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
note:
|
note:
|
||||||
type: string
|
type: string
|
||||||
description:
|
description: A note about the token, typically describing what it was
|
||||||
A note about the token, typically describing what it was created
|
created for.
|
||||||
for.
|
|
||||||
created:
|
created:
|
||||||
type: string
|
type: string
|
||||||
description: Timestamp when this token was created
|
description: Timestamp when this token was created
|
||||||
format: date-time
|
format: date-time
|
||||||
expires_at:
|
expires_at:
|
||||||
type: string
|
type: string
|
||||||
description: Timestamp when this token expires. Null if there is no expiry.
|
description: Timestamp when this token expires. Null if there is no
|
||||||
|
expiry.
|
||||||
format: date-time
|
format: date-time
|
||||||
last_activity:
|
last_activity:
|
||||||
type: string
|
type: string
|
||||||
@@ -2022,46 +2039,45 @@ components:
|
|||||||
properties:
|
properties:
|
||||||
token:
|
token:
|
||||||
type: string
|
type: string
|
||||||
description:
|
description: The token itself. Only present in responses to requests
|
||||||
The token itself. Only present in responses to requests for
|
for a new token.
|
||||||
a new token.
|
|
||||||
id:
|
id:
|
||||||
type: string
|
type: string
|
||||||
description:
|
description: The id of the API token. Used for modifying or deleting
|
||||||
The id of the API token. Used for modifying or deleting the
|
the token.
|
||||||
token.
|
|
||||||
user:
|
user:
|
||||||
type: string
|
type: string
|
||||||
description: The user that owns a token (undefined if owned by a service)
|
description: The user that owns a token (undefined if owned by a
|
||||||
|
service)
|
||||||
service:
|
service:
|
||||||
type: string
|
type: string
|
||||||
description: The service that owns the token (undefined of owned by a user)
|
description: The service that owns the token (undefined of owned by a
|
||||||
|
user)
|
||||||
roles:
|
roles:
|
||||||
type: array
|
type: array
|
||||||
description:
|
description: Deprecated in JupyterHub 3, always an empty list. Tokens
|
||||||
Deprecated in JupyterHub 3, always an empty list. Tokens have
|
have 'scopes' starting from JupyterHub 3.
|
||||||
'scopes' starting from JupyterHub 3.
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
scopes:
|
scopes:
|
||||||
type: array
|
type: array
|
||||||
description:
|
description: List of scopes this token has been assigned. New in
|
||||||
List of scopes this token has been assigned. New in JupyterHub
|
JupyterHub 3. In JupyterHub 2.x, tokens were assigned 'roles'
|
||||||
3. In JupyterHub 2.x, tokens were assigned 'roles' instead of scopes.
|
instead of scopes.
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
note:
|
note:
|
||||||
type: string
|
type: string
|
||||||
description:
|
description: A note about the token, typically describing what it was
|
||||||
A note about the token, typically describing what it was created
|
created for.
|
||||||
for.
|
|
||||||
created:
|
created:
|
||||||
type: string
|
type: string
|
||||||
description: Timestamp when this token was created
|
description: Timestamp when this token was created
|
||||||
format: date-time
|
format: date-time
|
||||||
expires_at:
|
expires_at:
|
||||||
type: string
|
type: string
|
||||||
description: Timestamp when this token expires. Null if there is no expiry.
|
description: Timestamp when this token expires. Null if there is no
|
||||||
|
expiry.
|
||||||
format: date-time
|
format: date-time
|
||||||
last_activity:
|
last_activity:
|
||||||
type: string
|
type: string
|
||||||
@@ -2091,27 +2107,23 @@ components:
|
|||||||
tokenUrl: /hub/api/oauth2/token
|
tokenUrl: /hub/api/oauth2/token
|
||||||
scopes:
|
scopes:
|
||||||
(no_scope): Identify the owner of the requesting entity.
|
(no_scope): Identify the owner of the requesting entity.
|
||||||
self:
|
self: The user’s own resources _(metascope for users, resolves to
|
||||||
The user’s own resources _(metascope for users, resolves to (no_scope)
|
(no_scope) for services)_
|
||||||
for services)_
|
inherit: Everything that the token-owning entity can access
|
||||||
inherit:
|
_(metascope for tokens)_
|
||||||
Everything that the token-owning entity can access _(metascope
|
admin-ui: Access the admin page. Permission to take actions via the
|
||||||
for tokens)_
|
admin page granted separately.
|
||||||
admin-ui:
|
admin:users: Read, modify, create, and delete users and their
|
||||||
Access the admin page. Permission to take actions via the admin
|
authentication state, not including their servers or tokens. This
|
||||||
page granted separately.
|
is an extremely privileged scope and should be considered
|
||||||
admin:users:
|
tantamount to superuser.
|
||||||
Read, write, create and delete users and their authentication
|
|
||||||
state, not including their servers or tokens.
|
|
||||||
admin:auth_state: Read a user’s authentication state.
|
admin:auth_state: Read a user’s authentication state.
|
||||||
users:
|
users: Read and write permissions to user models (excluding servers,
|
||||||
Read and write permissions to user models (excluding servers, tokens
|
tokens and authentication state).
|
||||||
and authentication state).
|
|
||||||
delete:users: Delete users.
|
delete:users: Delete users.
|
||||||
list:users: List users, including at least their names.
|
list:users: List users, including at least their names.
|
||||||
read:users:
|
read:users: Read user models (including the URL of the default
|
||||||
Read user models (excluding including servers, tokens and
|
server if it is running).
|
||||||
authentication state).
|
|
||||||
read:users:name: Read names of users.
|
read:users:name: Read names of users.
|
||||||
read:users:groups: Read users’ group membership.
|
read:users:groups: Read users’ group membership.
|
||||||
read:users:activity: Read time of last user activity.
|
read:users:activity: Read time of last user activity.
|
||||||
@@ -2120,28 +2132,25 @@ components:
|
|||||||
read:roles:services: Read service role assignments.
|
read:roles:services: Read service role assignments.
|
||||||
read:roles:groups: Read group role assignments.
|
read:roles:groups: Read group role assignments.
|
||||||
users:activity: Update time of last user activity.
|
users:activity: Update time of last user activity.
|
||||||
admin:servers:
|
admin:servers: Read, start, stop, create and delete user servers and
|
||||||
Read, start, stop, create and delete user servers and their
|
their state.
|
||||||
state.
|
|
||||||
admin:server_state: Read and write users’ server state.
|
admin:server_state: Read and write users’ server state.
|
||||||
servers: Start and stop user servers.
|
servers: Start and stop user servers.
|
||||||
read:servers:
|
read:servers: Read users’ names and their server models (excluding
|
||||||
Read users’ names and their server models (excluding the
|
the server state).
|
||||||
server state).
|
|
||||||
delete:servers: Stop and delete users' servers.
|
delete:servers: Stop and delete users' servers.
|
||||||
tokens: Read, write, create and delete user tokens.
|
tokens: Read, write, create and delete user tokens.
|
||||||
read:tokens: Read user tokens.
|
read:tokens: Read user tokens.
|
||||||
admin:groups: Read and write group information, create and delete groups.
|
admin:groups: Read and write group information, create and delete
|
||||||
groups:
|
groups.
|
||||||
Read and write group information, including adding/removing users
|
groups: 'Read and write group information, including adding/removing any
|
||||||
to/from groups.
|
users to/from groups. Note: adding users to groups may affect permissions.'
|
||||||
list:groups: List groups, including at least their names.
|
list:groups: List groups, including at least their names.
|
||||||
read:groups: Read group models.
|
read:groups: Read group models.
|
||||||
read:groups:name: Read group names.
|
read:groups:name: Read group names.
|
||||||
delete:groups: Delete groups.
|
delete:groups: Delete groups.
|
||||||
admin:services:
|
admin:services: Create, read, update, delete services, not including
|
||||||
Create, read, update, delete services, not including services
|
services defined from config files.
|
||||||
defined from config files.
|
|
||||||
list:services: List services, including at least their names.
|
list:services: List services, including at least their names.
|
||||||
read:services: Read service models.
|
read:services: Read service models.
|
||||||
read:services:name: Read service names.
|
read:services:name: Read service names.
|
||||||
@@ -2154,8 +2163,7 @@ components:
|
|||||||
read:groups:shares: Read servers shared with a group.
|
read:groups:shares: Read servers shared with a group.
|
||||||
read:shares: Read information about shared access to servers.
|
read:shares: Read information about shared access to servers.
|
||||||
shares: Manage access to shared servers.
|
shares: Manage access to shared servers.
|
||||||
proxy:
|
proxy: Read information about the proxy’s routing table, sync the
|
||||||
Read information about the proxy’s routing table, sync the Hub
|
Hub with the proxy and notify the Hub about a new proxy.
|
||||||
with the proxy and notify the Hub about a new proxy.
|
|
||||||
shutdown: Shutdown the hub.
|
shutdown: Shutdown the hub.
|
||||||
read:metrics: Read prometheus metrics.
|
read:metrics: Read prometheus metrics.
|
||||||
|
@@ -12,6 +12,7 @@ from pathlib import Path
|
|||||||
from urllib.request import urlretrieve
|
from urllib.request import urlretrieve
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
|
from intersphinx_registry import get_intersphinx_mapping
|
||||||
from ruamel.yaml import YAML
|
from ruamel.yaml import YAML
|
||||||
from sphinx.directives.other import SphinxDirective
|
from sphinx.directives.other import SphinxDirective
|
||||||
from sphinx.util import logging
|
from sphinx.util import logging
|
||||||
@@ -227,6 +228,7 @@ def setup(app):
|
|||||||
app.add_directive("jupyterhub-generate-config", ConfigDirective)
|
app.add_directive("jupyterhub-generate-config", ConfigDirective)
|
||||||
app.add_directive("jupyterhub-help-all", HelpAllDirective)
|
app.add_directive("jupyterhub-help-all", HelpAllDirective)
|
||||||
app.add_directive("jupyterhub-rest-api-links", RestAPILinksDirective)
|
app.add_directive("jupyterhub-rest-api-links", RestAPILinksDirective)
|
||||||
|
app.add_css_file("https://docs.jupyter.org/en/latest/_static/jupyter.css")
|
||||||
|
|
||||||
|
|
||||||
# -- Read The Docs -----------------------------------------------------------
|
# -- Read The Docs -----------------------------------------------------------
|
||||||
@@ -261,6 +263,8 @@ html_static_path = ["_static"]
|
|||||||
|
|
||||||
html_theme = "jupyterhub_sphinx_theme"
|
html_theme = "jupyterhub_sphinx_theme"
|
||||||
html_theme_options = {
|
html_theme_options = {
|
||||||
|
"announcement": "🚀 Join us in San Diego · JupyterCon 2025 · Nov 4-5 · <a href=\"https://events.linuxfoundation.org/jupytercon/program/schedule/?ajs_aid=53afb00d-be65-4a99-9112-28cdaac99463\">SCHEDULE</a> · <a href=\"https://events.linuxfoundation.org/jupytercon/register/?ajs_aid=53afb00d-be65-4a99-9112-28cdaac99463\">REGISTER NOW</a>",
|
||||||
|
"header_links_before_dropdown": 6,
|
||||||
"icon_links": [
|
"icon_links": [
|
||||||
{
|
{
|
||||||
"name": "GitHub",
|
"name": "GitHub",
|
||||||
@@ -294,7 +298,13 @@ linkcheck_ignore = [
|
|||||||
r"https://linux.die.net/.*", # linux.die.net seems to block requests from CI with 403 sometimes
|
r"https://linux.die.net/.*", # linux.die.net seems to block requests from CI with 403 sometimes
|
||||||
# don't check links to unpublished advisories
|
# don't check links to unpublished advisories
|
||||||
r"https://github.com/jupyterhub/jupyterhub/security/advisories/.*",
|
r"https://github.com/jupyterhub/jupyterhub/security/advisories/.*",
|
||||||
|
# Occasionally blocks CI checks with 403
|
||||||
|
r"https://www\.mysql\.com",
|
||||||
|
r"https://www\.npmjs\.com",
|
||||||
|
# Occasionally blocks CI checks with SSL error
|
||||||
|
r"https://mediaspace\.msu\.edu/.*",
|
||||||
]
|
]
|
||||||
|
|
||||||
linkcheck_anchors_ignore = [
|
linkcheck_anchors_ignore = [
|
||||||
"/#!",
|
"/#!",
|
||||||
"/#%21",
|
"/#%21",
|
||||||
@@ -303,12 +313,15 @@ linkcheck_anchors_ignore = [
|
|||||||
# -- Intersphinx -------------------------------------------------------------
|
# -- Intersphinx -------------------------------------------------------------
|
||||||
# ref: https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#configuration
|
# ref: https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#configuration
|
||||||
#
|
#
|
||||||
intersphinx_mapping = {
|
|
||||||
"python": ("https://docs.python.org/3/", None),
|
intersphinx_mapping = get_intersphinx_mapping(
|
||||||
"tornado": ("https://www.tornadoweb.org/en/stable/", None),
|
packages={
|
||||||
"jupyter-server": ("https://jupyter-server.readthedocs.io/en/stable/", None),
|
"python",
|
||||||
"nbgitpuller": ("https://nbgitpuller.readthedocs.io/en/latest", None),
|
"tornado",
|
||||||
|
"jupyter-server",
|
||||||
|
"nbgitpuller",
|
||||||
}
|
}
|
||||||
|
)
|
||||||
|
|
||||||
# -- Options for the opengraph extension -------------------------------------
|
# -- Options for the opengraph extension -------------------------------------
|
||||||
# ref: https://github.com/wpilibsuite/sphinxext-opengraph#options
|
# ref: https://github.com/wpilibsuite/sphinxext-opengraph#options
|
||||||
|
@@ -1,18 +1,32 @@
|
|||||||
|
(contributing:community)=
|
||||||
|
|
||||||
# Community communication channels
|
# Community communication channels
|
||||||
|
|
||||||
|
```{note}
|
||||||
|
Our community is distributed across the world in various timezones, so please be patient if you do not get a response immediately!
|
||||||
|
```
|
||||||
|
|
||||||
We use different channels of communication for different purposes. Whichever one you use will depend on what kind of communication you want to engage in.
|
We use different channels of communication for different purposes. Whichever one you use will depend on what kind of communication you want to engage in.
|
||||||
|
|
||||||
## Discourse (recommended)
|
## Discourse (recommended)
|
||||||
|
|
||||||
We use [Discourse](https://discourse.jupyter.org) for online discussions and support questions.
|
```{note}
|
||||||
You can ask questions here if you are a first-time contributor to the JupyterHub project.
|
[Discourse] is open source.
|
||||||
Everyone in the Jupyter community is welcome to bring ideas and questions there.
|
```
|
||||||
|
|
||||||
We recommend that you first use our Discourse as all past and current discussions on it are archived and searchable. Thus, all discussions remain useful and accessible to the whole community.
|
We use [Jupyter instance of Discourse] for online discussions and support questions.
|
||||||
|
You can ask questions at [Jupyter instance of Discourse] if you are a first-time contributor to the JupyterHub project.
|
||||||
|
Everyone is welcome to bring ideas and questions at [Jupyter instance of Discourse].
|
||||||
|
|
||||||
## Gitter
|
We recommend that you first use [Jupyter instance of Discourse] as all past and current discussions on it are archived and searchable. Thus, all discussions remain useful and accessible to the whole community.
|
||||||
|
|
||||||
We use [our Gitter channel](https://gitter.im/jupyterhub/jupyterhub) for online, real-time text chat; a place for more ephemeral discussions. When you're not on Discourse, you can stop here to have other discussions on the fly.
|
## Zulip
|
||||||
|
|
||||||
|
```{note}
|
||||||
|
[Zulip] is open source.
|
||||||
|
```
|
||||||
|
|
||||||
|
We use [Jupyter instance of Zulip] for online, real-time text chat; a place for more ephemeral discussions. When you're not on [Jupyter instance of Discourse], you can stop at [Jupyter instance of Zulip] to have other discussions on the fly.
|
||||||
|
|
||||||
## Github Issues
|
## Github Issues
|
||||||
|
|
||||||
@@ -22,6 +36,7 @@ We use [our Gitter channel](https://gitter.im/jupyterhub/jupyterhub) for online,
|
|||||||
- 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 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.
|
- 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}
|
[Discourse]: https://www.discourse.org/
|
||||||
Our community is distributed across the world in various timezones, so please be patient if you do not get a response immediately!
|
[Jupyter instance of Discourse]: https://discourse.jupyter.org
|
||||||
```
|
[Jupyter instance of Zulip]: https://jupyter.zulipchat.com/
|
||||||
|
[Zulip]: https://zulip.com/
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
(contributing:contributors)=
|
||||||
|
|
||||||
# Contributors
|
# Contributors
|
||||||
|
|
||||||
Project Jupyter thanks the following people for their help and
|
Project Jupyter thanks the following people for their help and
|
||||||
|
@@ -1,53 +1,46 @@
|
|||||||
(contributing-docs)=
|
(contributing:docs)=
|
||||||
|
|
||||||
# Contributing Documentation
|
# Contributing Documentation
|
||||||
|
|
||||||
Documentation is often more important than code. This page helps
|
Documentation is often more important than code. This page helps
|
||||||
you get set up on how to contribute to JupyterHub's documentation.
|
you get set up on how to contribute to JupyterHub's documentation.
|
||||||
|
|
||||||
|
We use [Sphinx](https://www.sphinx-doc.org) to build our documentation. It takes
|
||||||
|
our documentation source files (written in [Markedly Structured Text (MyST)](https://mystmd.org/) and
|
||||||
|
stored under the `docs/source` directory) and converts it into various
|
||||||
|
formats for people to read.
|
||||||
|
|
||||||
## Building documentation locally
|
## Building documentation locally
|
||||||
|
|
||||||
We use [sphinx](https://www.sphinx-doc.org) to build our documentation. It takes
|
To make sure the documentation you write or
|
||||||
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.
|
change renders correctly, it is good practice to test it locally.
|
||||||
|
|
||||||
1. Make sure you have successfully completed {ref}`contributing/setup`.
|
```{note}
|
||||||
|
You will need Python and Git installed. Installation details are avaiable at {ref}`contributing:setup`.
|
||||||
|
```
|
||||||
|
|
||||||
2. Install the packages required to build the docs.
|
1. Install the packages required to build the docs.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python3 -m pip install -r docs/requirements.txt
|
python3 -m pip install -r docs/requirements.txt
|
||||||
|
python3 -m pip install sphinx-autobuild
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Build the html version of the docs. This is the most commonly used
|
2. Build the HTML version of the docs. This is the most commonly used
|
||||||
output format, so verifying it renders correctly is usually good
|
output format, so verifying it renders correctly is usually good
|
||||||
enough.
|
enough.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd docs
|
sphinx-autobuild docs/source/ docs/_build/html
|
||||||
make html
|
|
||||||
```
|
```
|
||||||
|
|
||||||
This step will display any syntax or formatting errors in the documentation,
|
This step will display any syntax or formatting errors in the documentation,
|
||||||
along with the filename / line number in which they occurred. Fix them,
|
along with the filename / line number in which they occurred. Fix them,
|
||||||
and re-run the `make html` command to re-render the documentation.
|
and the HTML will be re-render automatically.
|
||||||
|
|
||||||
4. View the rendered documentation by opening `_build/html/index.html` in
|
3. View the rendered documentation by opening <http://127.0.0.1:8000> in
|
||||||
a web browser.
|
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)=
|
(contributing-docs-conventions)=
|
||||||
|
|
||||||
## Documentation conventions
|
## Documentation conventions
|
||||||
@@ -67,10 +60,10 @@ approach:
|
|||||||
python3 -m pip
|
python3 -m pip
|
||||||
```
|
```
|
||||||
|
|
||||||
This invokes pip explicitly using the python3 binary that you are
|
This invokes `pip` explicitly using the `python3` binary that you are
|
||||||
currently using. This is the **recommended way** to invoke pip
|
currently using. This is the **recommended way** to invoke pip
|
||||||
in our documentation, since it is least likely to cause problems
|
in our documentation, since it is least likely to cause problems
|
||||||
with python3 and pip being from different environments.
|
with `python3` and `pip` being from different environments.
|
||||||
|
|
||||||
For more information on how to invoke `pip` commands, see
|
For more information on how to invoke `pip` commands, see
|
||||||
[the pip documentation](https://pip.pypa.io/en/stable/).
|
[the `pip` documentation](https://pip.pypa.io/en/stable/).
|
||||||
|
@@ -1,7 +1,9 @@
|
|||||||
|
(contributing)=
|
||||||
|
|
||||||
# Contributing
|
# Contributing
|
||||||
|
|
||||||
We want you to contribute to JupyterHub in ways that are most exciting
|
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 useful to you. We value documentation, testing, bug reporting and code equally,
|
||||||
and are glad to have your contributions in whatever form you wish.
|
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)
|
Be sure to first check our [Code of Conduct](https://github.com/jupyter/governance/blob/HEAD/conduct/code_of_conduct.md)
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
(contributing:roadmap)=
|
||||||
|
|
||||||
# The JupyterHub roadmap
|
# The JupyterHub roadmap
|
||||||
|
|
||||||
This roadmap collects "next steps" for JupyterHub. It is about creating a
|
This roadmap collects "next steps" for JupyterHub. It is about creating a
|
||||||
|
@@ -1,9 +1,15 @@
|
|||||||
|
(contributing:security)=
|
||||||
|
|
||||||
# Reporting security issues in Jupyter or JupyterHub
|
# Reporting security issues in Jupyter or JupyterHub
|
||||||
|
|
||||||
If you find a security vulnerability 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)
|
whether it is a failure of the security model described in [Security Overview](explanation:security)
|
||||||
or a failure in implementation,
|
or a failure in implementation,
|
||||||
please report it to <mailto:security@ipython.org>.
|
please report it!
|
||||||
|
|
||||||
|
Please use GitHub's "Report a Vulnerability" button under Security > Advisories on the appropriate repo,
|
||||||
|
e.g. [report here for JupyterHub](https://github.com/jupyterhub/jupyterhub/security/advisories).
|
||||||
|
|
||||||
|
You may also send an email to <mailto:security@ipython.org>, but the GitHub reporting system is preferred.
|
||||||
If you prefer to encrypt your security reports,
|
If you prefer to encrypt your security reports,
|
||||||
you can use {download}`this PGP public key </ipython_security.asc>`.
|
you can use {download}`this PGP public key </ipython_security.asc>`.
|
||||||
|
@@ -1,38 +1,57 @@
|
|||||||
(contributing/setup)=
|
(contributing:setup)=
|
||||||
|
|
||||||
# Setting up a development install
|
# Setting up a development install
|
||||||
|
|
||||||
|
JupyterHub's continuous integration runs on [Ubuntu LTS](https://ubuntu.com/).
|
||||||
|
|
||||||
|
While JupyterHub is only tested on one [Linux distribution](https://en.wikipedia.org/wiki/Linux_distribution),
|
||||||
|
it should be fairly insensitive to variations between common [POXIS](https://en.wikipedia.org/wiki/POSIX) implementation,
|
||||||
|
though we don't have the bandwidth to verify this automatically and continuously.
|
||||||
|
|
||||||
|
Feel free to try it on your platform, and be sure to {ref}`let us know <contributing:community>` about any issues you encounter.
|
||||||
|
|
||||||
## System requirements
|
## System requirements
|
||||||
|
|
||||||
JupyterHub can only run on macOS or Linux operating systems. If you are
|
Your system **must** be able to run
|
||||||
using Windows, we recommend using [VirtualBox](https://virtualbox.org)
|
|
||||||
or a similar system to run [Ubuntu Linux](https://ubuntu.com) for
|
- Python
|
||||||
development.
|
- NodeJS
|
||||||
|
- Git
|
||||||
|
|
||||||
|
Our small team knows JupyterHub to work perfectly on macOS or Linux operating systems.
|
||||||
|
|
||||||
|
```{admonition} What about Windows?
|
||||||
|
Some users have reported that JupyterHub runs successfully on [Windows Subsystem for Linux (WSL)](https://learn.microsoft.com/en-us/windows/wsl/). We have no plans to support Windows outside of the WSL.
|
||||||
|
```
|
||||||
|
|
||||||
|
```{admonition} What about virtualization?
|
||||||
|
Using any form of virtualization (for example, [VirtualBox](https://www.virtualbox.org/), [Docker](https://www.docker.com/), [Podman](https://podman.io/), [WSL](https://learn.microsoft.com/en-us/windows/wsl/)) is a good way to get up and running quickly, though properly configuring the networking settings can be a bit tricky.
|
||||||
|
```
|
||||||
|
|
||||||
### Install Python
|
### Install Python
|
||||||
|
|
||||||
JupyterHub is written in the [Python](https://python.org) programming language and
|
JupyterHub is written in the [Python](https://www.python.org) programming language and
|
||||||
requires you have at least version {{python_min}} installed locally. If you haven’t
|
requires you have at least version {{python_min}} installed locally. If you haven’t
|
||||||
installed Python before, the recommended way to install it is to use
|
installed Python before, the recommended way to install it is to use
|
||||||
[Miniforge](https://github.com/conda-forge/miniforge#download).
|
[Miniforge](https://github.com/conda-forge/miniforge#download).
|
||||||
|
|
||||||
### Install nodejs
|
### Install NodeJS
|
||||||
|
|
||||||
[NodeJS {{node_min}}+](https://nodejs.org/en/) is required for building some JavaScript components.
|
Some JavaScript components require you have at least version {{node_min}} of [NodeJS](https://nodejs.org/en/) installed locally.
|
||||||
`configurable-http-proxy`, the default proxy implementation for JupyterHub, is written in Javascript.
|
`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.
|
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`.
|
You can do so with `conda install nodejs`.
|
||||||
|
|
||||||
Many in the Jupyter community use [`nvm`](https://github.com/nvm-sh/nvm) to
|
Many in the Jupyter community use [`nvm`](https://github.com/nvm-sh/nvm) to
|
||||||
managing node dependencies.
|
managing node dependencies.
|
||||||
|
|
||||||
### Install git
|
### Install Git
|
||||||
|
|
||||||
JupyterHub uses [Git](https://git-scm.com) & [GitHub](https://github.com)
|
JupyterHub uses [Git](https://git-scm.com) and [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
|
for development and 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.
|
JupyterHub. We also recommend getting a free account on GitHub.
|
||||||
|
|
||||||
## Setting up a development install
|
## Install JupyterHub for development
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
@@ -44,7 +63,7 @@ be achieved in many ways, for example, `tox`, `conda`, `docker`, etc. See this
|
|||||||
a more detailed discussion.
|
a more detailed discussion.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
1. Clone the [JupyterHub git repository](https://github.com/jupyterhub/jupyterhub)
|
1. Clone the [JupyterHub Git repository](https://github.com/jupyterhub/jupyterhub)
|
||||||
to your computer.
|
to your computer.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -65,7 +84,7 @@ a more detailed discussion.
|
|||||||
npm -v
|
npm -v
|
||||||
```
|
```
|
||||||
|
|
||||||
This should return a version number greater than or equal to 5.0.
|
This should return a version number greater than or equal to {{node_min}}.
|
||||||
|
|
||||||
3. Install `configurable-http-proxy` (required to run and test the default JupyterHub configuration):
|
3. Install `configurable-http-proxy` (required to run and test the default JupyterHub configuration):
|
||||||
|
|
||||||
@@ -92,7 +111,7 @@ a more detailed discussion.
|
|||||||
|
|
||||||
4. Install an editable version of JupyterHub and its requirements for
|
4. Install an editable version of JupyterHub and its requirements for
|
||||||
development and testing. This lets you edit JupyterHub code in a text editor
|
development and testing. This lets you edit JupyterHub code in a text editor
|
||||||
& restart the JupyterHub process to see your code changes immediately.
|
and restart the JupyterHub process to see your code changes immediately.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python3 -m pip install --editable ".[test]"
|
python3 -m pip install --editable ".[test]"
|
||||||
@@ -109,7 +128,7 @@ a more detailed discussion.
|
|||||||
|
|
||||||
Happy developing!
|
Happy developing!
|
||||||
|
|
||||||
## Using DummyAuthenticator & SimpleLocalProcessSpawner
|
## Using DummyAuthenticator and SimpleLocalProcessSpawner
|
||||||
|
|
||||||
To simplify testing of JupyterHub, it is helpful to use
|
To simplify testing of JupyterHub, it is helpful to use
|
||||||
{class}`~jupyterhub.auth.DummyAuthenticator` instead of the default JupyterHub
|
{class}`~jupyterhub.auth.DummyAuthenticator` instead of the default JupyterHub
|
||||||
@@ -132,17 +151,17 @@ The test configuration enables a few things to make testing easier:
|
|||||||
- disable caching of static files
|
- disable caching of static files
|
||||||
|
|
||||||
The default JupyterHub [authenticator](PAMAuthenticator)
|
The default JupyterHub [authenticator](PAMAuthenticator)
|
||||||
& [spawner](LocalProcessSpawner)
|
and [spawner](LocalProcessSpawner)
|
||||||
require your system to have user accounts for each user you want to log in to
|
require your system to have user accounts for each user you want to log in to
|
||||||
JupyterHub as.
|
JupyterHub as.
|
||||||
|
|
||||||
DummyAuthenticator allows you to log in with any username & password,
|
DummyAuthenticator allows you to log in with any username and password,
|
||||||
while SimpleLocalProcessSpawner allows you to start servers without having to
|
while SimpleLocalProcessSpawner allows you to start servers without having to
|
||||||
create a Unix user for each JupyterHub user. Together, these make it
|
create a Unix user for each JupyterHub user. Together, these make it
|
||||||
much easier to test JupyterHub.
|
much easier to test JupyterHub.
|
||||||
|
|
||||||
Tip: If you are working on parts of JupyterHub that are common to all
|
Tip: If you are working on parts of JupyterHub that are common to all
|
||||||
authenticators & spawners, we recommend using both DummyAuthenticator &
|
authenticators and spawners, we recommend using both DummyAuthenticator and
|
||||||
SimpleLocalProcessSpawner. If you are working on just authenticator-related
|
SimpleLocalProcessSpawner. If you are working on just authenticator-related
|
||||||
parts, use only SimpleLocalProcessSpawner. Similarly, if you are working on
|
parts, use only SimpleLocalProcessSpawner. Similarly, if you are working on
|
||||||
just spawner-related parts, use only DummyAuthenticator.
|
just spawner-related parts, use only DummyAuthenticator.
|
||||||
|
@@ -6,16 +6,22 @@ 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
|
and continues to do so when changes occur. They also help communicate
|
||||||
precisely what we expect our code to do.
|
precisely what we expect our code to do.
|
||||||
|
|
||||||
JupyterHub uses [pytest](https://pytest.org) for all the tests. You
|
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.
|
can find them under the [jupyterhub/tests](https://github.com/jupyterhub/jupyterhub/tree/main/jupyterhub/tests) directory in the Git repository.
|
||||||
|
|
||||||
## Running the tests
|
```{note}
|
||||||
|
Before run any test, make sure you have completed {ref}`contributing:setup`.
|
||||||
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.
|
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.
|
This ensures that the development environment is properly set up for tests to run.
|
||||||
|
```
|
||||||
|
|
||||||
2. You can run all tests in JupyterHub
|
```{note}
|
||||||
|
For details of `pytest`, refer to the [`pytest` usage documentation](https://pytest.readthedocs.io/en/latest/usage.html).
|
||||||
|
```
|
||||||
|
|
||||||
|
## Running all the tests
|
||||||
|
|
||||||
|
You can run all tests in JupyterHub
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pytest -v jupyterhub/tests
|
pytest -v jupyterhub/tests
|
||||||
@@ -30,13 +36,17 @@ can find them under the [jupyterhub/tests](https://github.com/jupyterhub/jupyter
|
|||||||
pytest -v --cov=jupyterhub jupyterhub/tests
|
pytest -v --cov=jupyterhub jupyterhub/tests
|
||||||
```
|
```
|
||||||
|
|
||||||
3. You can also run tests in just a specific file:
|
## Running tests from a specific file
|
||||||
|
|
||||||
|
You can also run tests in just a specific file:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pytest -v jupyterhub/tests/<test-file-name>
|
pytest -v jupyterhub/tests/<test-file-name>
|
||||||
```
|
```
|
||||||
|
|
||||||
4. To run a specific test only, you can do:
|
## Running a single test
|
||||||
|
|
||||||
|
To run a specific test only, you can do:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pytest -v jupyterhub/tests/<test-file-name>::<test-name>
|
pytest -v jupyterhub/tests/<test-file-name>::<test-name>
|
||||||
@@ -53,14 +63,12 @@ can find them under the [jupyterhub/tests](https://github.com/jupyterhub/jupyter
|
|||||||
pytest -v jupyterhub/tests/test_api.py::test_shutdown
|
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
|
## Test organisation
|
||||||
|
|
||||||
The tests live in `jupyterhub/tests` and are organized roughly into:
|
The tests live in `jupyterhub/tests` and are organized roughly into:
|
||||||
|
|
||||||
1. `test_api.py` tests the REST API
|
1. `test_api.py`: tests the REST API
|
||||||
2. `test_pages.py` tests loading the HTML pages
|
2. `test_pages.py`: tests loading the HTML pages
|
||||||
|
|
||||||
and other collections of tests for different components.
|
and other collections of tests for different components.
|
||||||
When writing a new test, there should usually be a test of
|
When writing a new test, there should usually be a test of
|
||||||
@@ -126,7 +134,7 @@ For more information on asyncio and event-loops, here are some resources:
|
|||||||
|
|
||||||
### All the tests are failing
|
### 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.
|
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
|
## Code formatting and linting
|
||||||
|
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
(explanation:capacity-planning)=
|
||||||
|
|
||||||
# Capacity planning
|
# Capacity planning
|
||||||
|
|
||||||
General capacity planning advice for JupyterHub is hard to give,
|
General capacity planning advice for JupyterHub is hard to give,
|
||||||
@@ -206,7 +208,7 @@ mybinder.org node CPU usage is low with 50-150 users sharing just 8 cores
|
|||||||
|
|
||||||
### Concurrent users and culling idle servers
|
### Concurrent users and culling idle servers
|
||||||
|
|
||||||
Related to [][idleness], all of these resource consumptions and limits are calculated based on **concurrently active users**,
|
Related to [](idleness), all of these resource consumptions and limits are calculated based on **concurrently active users**,
|
||||||
not total users.
|
not total users.
|
||||||
You might have 10,000 users of your JupyterHub deployment, but only 100 of them running at any given time.
|
You might have 10,000 users of your JupyterHub deployment, but only 100 of them running at any given time.
|
||||||
That 100 is the main number you need to use for your capacity planning.
|
That 100 is the main number you need to use for your capacity planning.
|
||||||
|
430
docs/source/explanation/concepts.md
Normal file
430
docs/source/explanation/concepts.md
Normal file
@@ -0,0 +1,430 @@
|
|||||||
|
(explanation:concepts)=
|
||||||
|
|
||||||
|
# JupyterHub: A conceptual overview
|
||||||
|
|
||||||
|
```{warning}
|
||||||
|
This page could be missing cross-links to other parts of
|
||||||
|
the documentation. You can help by adding them!
|
||||||
|
```
|
||||||
|
|
||||||
|
JupyterHub is not what you think it is. Most things you think are
|
||||||
|
part of JupyterHub are actually handled by some other component, for
|
||||||
|
example the spawner or notebook server itself, and it's not always
|
||||||
|
obvious how the parts relate. The knowledge contained here hasn't
|
||||||
|
been assembled in one place before, and is essential to understand
|
||||||
|
when setting up a sufficiently complex Jupyter(Hub) setup.
|
||||||
|
|
||||||
|
This document was originally written to assist in debugging: very
|
||||||
|
often, the actual problem is not where one thinks it is and thus
|
||||||
|
people can't easily debug. In order to tell this story, we start at
|
||||||
|
JupyterHub and go all the way down to the fundamental components of
|
||||||
|
Jupyter.
|
||||||
|
|
||||||
|
In this document, we occasionally leave things out or bend the truth
|
||||||
|
where it helps in explanation, and give our explanations in terms of
|
||||||
|
Python even though Jupyter itself is language-neutral. The "(&)"
|
||||||
|
symbol highlights important points where this page leaves out or bends
|
||||||
|
the truth for simplification of explanation, but there is more if you
|
||||||
|
dig deeper.
|
||||||
|
|
||||||
|
This guide is long, but after reading it you will be know of all major
|
||||||
|
components in the Jupyter ecosystem and everything else you read
|
||||||
|
should make sense.
|
||||||
|
|
||||||
|
## What is Jupyter?
|
||||||
|
|
||||||
|
Before we get too far, let's remember what our end goal is. A
|
||||||
|
**Jupyter Notebook** is nothing more than a Python(&) process
|
||||||
|
which is getting commands from a web browser and displaying the output
|
||||||
|
via that browser. What the process actually sees is roughly like
|
||||||
|
getting commands on standard input(&) and writing to standard
|
||||||
|
output(&). There is nothing intrinsically special about this process
|
||||||
|
|
||||||
|
- it can do anything a normal Python process can do, and nothing more.
|
||||||
|
The **Jupyter kernel** handles capturing output and converting things
|
||||||
|
such as graphics to a form usable by the browser.
|
||||||
|
|
||||||
|
Everything we explain below is building up to this, going through many
|
||||||
|
different layers which give you many ways of customizing how this
|
||||||
|
process runs.
|
||||||
|
|
||||||
|
## JupyterHub
|
||||||
|
|
||||||
|
**JupyterHub** is the central piece that provides multi-user
|
||||||
|
login capabilities. Despite this, the end user only briefly interacts with
|
||||||
|
JupyterHub and most of the actual Jupyter session does not relate to
|
||||||
|
the hub at all: the hub mainly handles authentication and creating (JupyterHub calls it "spawning") the
|
||||||
|
single-user server. In short, anything which is related to _starting_
|
||||||
|
the user's workspace/environment is about JupyterHub, anything about
|
||||||
|
_running_ usually isn't.
|
||||||
|
|
||||||
|
If you have problems connecting the authentication, spawning, and the
|
||||||
|
proxy (explained below), the issue is usually with JupyterHub. To
|
||||||
|
debug, JupyterHub has extensive logs which get printed to its console
|
||||||
|
and can be used to discover most problems.
|
||||||
|
|
||||||
|
The main pieces of JupyterHub are:
|
||||||
|
|
||||||
|
### Authenticator
|
||||||
|
|
||||||
|
JupyterHub itself doesn't actually manage your users. It has a
|
||||||
|
database of users, but it is usually connected with some other system
|
||||||
|
that manages the usernames and passwords. When someone tries to log
|
||||||
|
in to JupyteHub, it asks the
|
||||||
|
**authenticator**([basics](authenticators),
|
||||||
|
[reference](../reference/authenticators)) if the
|
||||||
|
username/password is valid(&). The authenticator returns a username(&),
|
||||||
|
which is passed on to the spawner, which has to use it to start that
|
||||||
|
user's environment. The authenticator can also return user
|
||||||
|
groups and admin status of users, so that JupyterHub can do some
|
||||||
|
higher-level management.
|
||||||
|
|
||||||
|
The following authenticators are included with JupyterHub:
|
||||||
|
|
||||||
|
- **PAMAuthenticator** uses the standard Unix/Linux operating system
|
||||||
|
functions to check users. Roughly, if someone already has access to
|
||||||
|
the machine (they can log in by ssh), they will be able to log in to
|
||||||
|
JupyterHub without any other setup. Thus, JupyterHub fills the role
|
||||||
|
of a ssh server, but providing a web-browser based way to access the
|
||||||
|
machine.
|
||||||
|
|
||||||
|
There are [plenty of others to choose from](authenticators-reference).
|
||||||
|
You can connect to almost any other existing service to manage your
|
||||||
|
users. You either use all users from this other service (e.g. your
|
||||||
|
company), or enable only the allowed users (e.g. your group's
|
||||||
|
Github usernames). Some other popular authenticators include:
|
||||||
|
|
||||||
|
- **OAuthenticator** uses the standard OAuth protocol to verify users.
|
||||||
|
For example, you can easily use Github to authenticate your users -
|
||||||
|
people have a "click to login with Github" button. This is often
|
||||||
|
done with a allowlist to only allow certain users.
|
||||||
|
|
||||||
|
- **NativeAuthenticator** actually stores and validates its own
|
||||||
|
usernames and passwords, unlike most other authenticators. Thus,
|
||||||
|
you can manage all your users within JupyterHub only.
|
||||||
|
|
||||||
|
- There are authenticators for LTI (learning management systems),
|
||||||
|
Shibboleth, Kerberos - and so on.
|
||||||
|
|
||||||
|
The authenticator is configured with the
|
||||||
|
`c.JupyterHub.authenticator_class` configuration option in the
|
||||||
|
`jupyterhub_config.py` file.
|
||||||
|
|
||||||
|
The authenticator runs internally to the Hub process but communicates
|
||||||
|
with outside services.
|
||||||
|
|
||||||
|
If you have trouble logging in, this is usually a problem of the
|
||||||
|
authenticator. The authenticator logs are part of the the JupyterHub
|
||||||
|
logs, but there may also be relevant information in whatever external
|
||||||
|
services you are using.
|
||||||
|
|
||||||
|
### Spawner
|
||||||
|
|
||||||
|
The **spawner** ([basics](spawners),
|
||||||
|
[reference](../reference/spawners)) is the real core of
|
||||||
|
JupyterHub: when someone wants a notebook server, the spawner allocates
|
||||||
|
resources and starts the server. The notebook server could run on the
|
||||||
|
same machine as JupyterHub, on another machine, on some cloud service,
|
||||||
|
or more. Administrators can limit resources (CPU, memory) or isolate users
|
||||||
|
from each other - if the spawner supports it. They can also do no
|
||||||
|
limiting and allow any user to access any other user's files if they
|
||||||
|
are not configured properly.
|
||||||
|
|
||||||
|
Some basic spawners included in JupyterHub are:
|
||||||
|
|
||||||
|
- **LocalProcessSpawner** is built into JupyterHub. Upon launch it tries
|
||||||
|
to switch users to the given username (`su` (&)) and start the
|
||||||
|
notebook server. It requires that the hub be run as root (because
|
||||||
|
only root has permission to start processes as other user IDs).
|
||||||
|
LocalProcessSpawner is no different than a user logging in with
|
||||||
|
something like `ssh` and running `jupyter notebook`. PAMAuthenticator and
|
||||||
|
LocalProcessSpawner is the most basic way of using JupyterHub (and
|
||||||
|
what it does out of the box) and makes the hub not too dissimilar to
|
||||||
|
an advanced ssh server.
|
||||||
|
|
||||||
|
There are [many more advanced spawners](/reference/spawners), and to
|
||||||
|
show the diversity of spawning strategys some are listed below:
|
||||||
|
|
||||||
|
- **SudoSpawner** is like LocalProcessSpawner but lets you run
|
||||||
|
JupyterHub without root. `sudo` has to be configured to allow the
|
||||||
|
hub's user to run processes under other user IDs.
|
||||||
|
|
||||||
|
- **SystemdSpawner** uses Systemd to start other processes. It can
|
||||||
|
isolate users from each other and provide resource limiting.
|
||||||
|
|
||||||
|
- **DockerSpawner** runs stuff in Docker, a containerization system.
|
||||||
|
This lets you fully isolate users, limit CPU, memory, and provide
|
||||||
|
other container images to fully customize the environment.
|
||||||
|
|
||||||
|
- **KubeSpawner** runs on the Kubernetes, a cloud orchestration
|
||||||
|
system. The spawner can easily limit users and provide cloud
|
||||||
|
scaling - but the spawner doesn't actually do that, Kubernetes
|
||||||
|
does. The spawner just tells Kubernetes what to do. If you want to
|
||||||
|
get KubeSpawner to do something, first you would figure out how to
|
||||||
|
do it in Kubernetes, then figure out how to tell KubeSpawner to tell
|
||||||
|
Kubernetes that. Actually... this is true for most spawners.
|
||||||
|
|
||||||
|
- **BatchSpawner** runs on computer clusters with batch job scheduling
|
||||||
|
systems (e.g Slurm, HTCondor, PBS, etc). The user processes are run
|
||||||
|
as batch jobs, having access to all the data and software that the
|
||||||
|
users normally will.
|
||||||
|
|
||||||
|
In short, spawners are the interface to the rest of the operating
|
||||||
|
system, and to configure them right you need to know a bit about how
|
||||||
|
the corresponding operating system service works.
|
||||||
|
|
||||||
|
The spawner is responsible for the environment of the single-user
|
||||||
|
notebook servers (described in the next section). In the end, it just
|
||||||
|
makes a choice about how to start these processes: for example, the
|
||||||
|
Docker spawner starts a normal Docker container and runs the right
|
||||||
|
command inside of it. Thus, the spawner is responsible for setting
|
||||||
|
what kind of software and data is available to the user.
|
||||||
|
|
||||||
|
The spawner runs internally to the Hub process but communicates with
|
||||||
|
outside services. It is configured by `c.JupyterHub.spawner_class` in
|
||||||
|
`jupyterhub_config.py`.
|
||||||
|
|
||||||
|
If a user tries to launch a notebook server and it doesn't work, the
|
||||||
|
error is usually with the spawner or the notebook server (as described
|
||||||
|
in the next section). Each spawner outputs some logs to the main
|
||||||
|
JupyterHub logs, but may also have logs in other places depending on
|
||||||
|
what services it interacts with (for example, the Docker spawner
|
||||||
|
somehow puts logs in the Docker system services, Kubernetes through
|
||||||
|
the `kubectl` API).
|
||||||
|
|
||||||
|
### Proxy
|
||||||
|
|
||||||
|
The JupyterHub **proxy** relays connections between the users
|
||||||
|
and their single-user notebook servers. What this basically means is
|
||||||
|
that the hub itself can shut down and the proxy can continue to
|
||||||
|
allow users to communicate with their notebook servers. (This
|
||||||
|
further emphasizes that the hub is responsible for starting, not
|
||||||
|
running, the notebooks). By default, the hub starts the proxy
|
||||||
|
automatically
|
||||||
|
and stops the proxy when the hub stops (so that connections get
|
||||||
|
interrupted). But when you [configure the proxy to run
|
||||||
|
separately](howto:separate-proxy),
|
||||||
|
user's connections will continue to work even without the hub.
|
||||||
|
|
||||||
|
The default proxy is **ConfigurableHttpProxy** which is simple but
|
||||||
|
effective. A more advanced option is the [**Traefik Proxy**](https://blog.jupyter.org/introducing-traefikproxy-a-new-jupyterhub-proxy-based-on-traefik-4839e972faf6),
|
||||||
|
which gives you redundancy and high-availability.
|
||||||
|
|
||||||
|
When users "connect to JupyterHub", they _always_ first connect to the
|
||||||
|
proxy and the proxy relays the connection to the hub. Thus, the proxy
|
||||||
|
is responsible for SSL and accepting connections from the rest of the
|
||||||
|
internet. The user uses the hub to authenticate and start the server,
|
||||||
|
and then the hub connects back to the proxy to adjust the proxy routes
|
||||||
|
for the user's server (e.g. the web path `/user/someone` redirects to
|
||||||
|
the server of someone at a certain internal address). The proxy has
|
||||||
|
to be able to internally connect to both the hub and all the
|
||||||
|
single-user servers.
|
||||||
|
|
||||||
|
The proxy always runs as a separate process to JupyterHub (even though
|
||||||
|
JupyterHub can start it for you). JupyterHub has one set of
|
||||||
|
configuration options for the proxy addresses (`bind_url`) and one for
|
||||||
|
the hub (`hub_bind_url`). If `bind_url` is given, it is just passed to
|
||||||
|
the automatic proxy to tell it what to do.
|
||||||
|
|
||||||
|
If you have problems after users are redirected to their single-user
|
||||||
|
notebook servers, or making the first connection to the hub, it is
|
||||||
|
usually caused by the proxy. The ConfigurableHttpProxy's logs are
|
||||||
|
mixed with JupyterHub's logs if it's started through the hub (the
|
||||||
|
default case), otherwise from whatever system runs the proxy (if you
|
||||||
|
do configure it, you'll know).
|
||||||
|
|
||||||
|
### Services
|
||||||
|
|
||||||
|
JupyterHub has the concept of **services** ([basics](tutorial:services),
|
||||||
|
[reference](services-reference)), which are other web services
|
||||||
|
started by the hub, but otherwise are not necessarily related to the
|
||||||
|
hub itself. They are often used to do things related to Jupyter
|
||||||
|
(things that user interacts with, usually not the hub), but could
|
||||||
|
always be run some other way. Running from the hub provides an easy
|
||||||
|
way to get Hub API tokens and authenticate users against the hub. It
|
||||||
|
can also automatically add a proxy route to forward web requests to
|
||||||
|
that service.
|
||||||
|
|
||||||
|
A common example of a service is the [cull idle
|
||||||
|
servers](https://github.com/jupyterhub/jupyterhub-idle-culler)
|
||||||
|
service. When started by the hub, it automatically gets admin API
|
||||||
|
tokens. It uses the API to list all running servers, compare against
|
||||||
|
activity timeouts, and shut down servers exceeding the limits. Even
|
||||||
|
though this is an intrinsic part of JupyterHub, it is only loosely
|
||||||
|
coupled and running as a service provides convenience of
|
||||||
|
authentication - it could be just as well run some other way, with a
|
||||||
|
manually provided API token.
|
||||||
|
|
||||||
|
The configuration option `c.JupyterHub.services` is used to start
|
||||||
|
services from the hub.
|
||||||
|
|
||||||
|
When a service is started from JupyterHub automatically, its logs are
|
||||||
|
included in the JupyterHub logs.
|
||||||
|
|
||||||
|
## Single-user notebook server
|
||||||
|
|
||||||
|
The **single-user notebook server** is the same thing you get by
|
||||||
|
running `jupyter notebook` or `jupyter lab` from the command line -
|
||||||
|
the actual Jupyter user interface for a single person.
|
||||||
|
|
||||||
|
The role of the spawner is to start this server - basically, running
|
||||||
|
the command `jupyter notebook`. Actually it doesn't run that, it runs
|
||||||
|
`jupyterhub-singleuser` which first communicates with the hub to say
|
||||||
|
"I'm alive" before running a completely normal Jupyter server. The
|
||||||
|
single-user server can be JupyterLab or classic notebooks. By this
|
||||||
|
point, the hub is almost completely out of the picture (the web
|
||||||
|
traffic is going through proxy unchanged). Also by this time, the
|
||||||
|
spawner has already decided the environment which this single-user
|
||||||
|
server will have and the single-user server has to deal with that.
|
||||||
|
|
||||||
|
The spawner starts the server using `jupyterhub-singleuser` with some
|
||||||
|
environment variables like `JUPYTERHUB_API_TOKEN` and
|
||||||
|
`JUPYTERHUB_BASE_URL` which tell the single-user server how to connect
|
||||||
|
back to the hub in order to say that it's ready.
|
||||||
|
|
||||||
|
The single-user server options are **JupyterLab** and **classic
|
||||||
|
Jupyter Notebook**. They both run through the same backend server process--the web
|
||||||
|
frontend is an option when it is starting. The spawner can choose the
|
||||||
|
command line when it starts the single-user server. Extensions are a
|
||||||
|
property of the single-user server (in two parts: there can be a part
|
||||||
|
that runs in the Python server process, and parts that run in
|
||||||
|
javascript in lab or notebook).
|
||||||
|
|
||||||
|
If one wants to install software for users, it is not a matter of
|
||||||
|
"installing it for JupyerHub" - it's a matter of installing it for the
|
||||||
|
single-user server, which might be the same environment as the hub,
|
||||||
|
but not necessarily. (see below - it's a matter of the kernels!)
|
||||||
|
|
||||||
|
After the single-user notebook server is started, any errors are only
|
||||||
|
an issue of the single-user notebook server. Sometimes, it seems like
|
||||||
|
the spawner is failing, but really the spawner is working but the
|
||||||
|
single-user notebook server dies right away (in this case, you need to
|
||||||
|
find the problem with the single-user server and adjust the spawner to
|
||||||
|
start it correctly or fix the environment). This can happen, for
|
||||||
|
example, if the spawner doesn't set an environment variable or doesn't
|
||||||
|
provide storage.
|
||||||
|
|
||||||
|
The single-user server's logs are printed to stdout/stderr, and the
|
||||||
|
spawer decides where those streams are directed, so if you
|
||||||
|
notice problems at this phase you need to check your spawner for
|
||||||
|
instructions for accessing the single-user logs. For example, the
|
||||||
|
LocalProcessSpawner logs are just outputted to the same JupyterHub
|
||||||
|
output logs, the SystemdSpawner logs are
|
||||||
|
written to the Systemd journal, Docker and Kubernetes logs are written
|
||||||
|
to Docker and Kubernetes respectively, and batchspawner output goes to
|
||||||
|
the normal output places of batch jobs and is an explicit
|
||||||
|
configuration option of the spawner.
|
||||||
|
|
||||||
|
**(Jupyter) Notebook** is the classic interface, where each notebook
|
||||||
|
opens in a separate tab. It is traditionally started by `jupyter
|
||||||
|
notebook`. Does anything need to be said here?
|
||||||
|
|
||||||
|
**JupyterLab** is the new interface, where multiple notebooks are
|
||||||
|
openable in the same tab in an IDE-like environment. It is
|
||||||
|
traditionally started with `jupyter lab`. Both Notebook and Lab use
|
||||||
|
the same `.ipynb` file format.
|
||||||
|
|
||||||
|
JupyterLab is run thorugh the same server file, but at a path `/lab`
|
||||||
|
instead of `/tree`. Thus, they can be active at the same time in the
|
||||||
|
backend and you can switch between them at runtime by changing your
|
||||||
|
URL path.
|
||||||
|
|
||||||
|
Extensions need to be re-written for JupyterLab (if moving from
|
||||||
|
classic notebooks). But, the server-side of the extensions can be
|
||||||
|
shared by both.
|
||||||
|
|
||||||
|
## Kernel
|
||||||
|
|
||||||
|
The commands you run in the notebook session are not executed in the same process as
|
||||||
|
the notebook itself, but in a separate **Jupyter kernel**. There are [many
|
||||||
|
kernels
|
||||||
|
available](https://github.com/jupyter/jupyter/wiki/Jupyter-kernels).
|
||||||
|
|
||||||
|
As a basic approximation, a **Jupyter kernel** is a process which
|
||||||
|
accepts commands (cells that are run) and returns the output to
|
||||||
|
Jupyter to display. One example is the **IPython Jupyter kernel**,
|
||||||
|
which runs Python. There is nothing special about it, it can be
|
||||||
|
considered a \*normal Python process. The kernel process can be
|
||||||
|
approximated in UNIX terms as a process that takes commands on stdin
|
||||||
|
and returns stuff on stdout(&). Obviously, it's more because it has
|
||||||
|
to be able to disentangle all the possible outputs, such as figures,
|
||||||
|
and present it to the user in a web browser.
|
||||||
|
|
||||||
|
Kernel communication is via the the ZeroMQ protocol on the local
|
||||||
|
computer. Kernels are separate processes from the main single-user
|
||||||
|
notebook server (and thus obviously, different from the JupyterHub
|
||||||
|
process and everything else). By default (and unless you do something
|
||||||
|
special), kernels share the same environment as the notebook server
|
||||||
|
(data, resource limits, permissions, user id, etc.). But they _can_
|
||||||
|
run in a separate Python environment from the single-user server
|
||||||
|
(search `--prefix` in the [ipykernel installation
|
||||||
|
instructions](https://ipython.readthedocs.io/en/stable/install/kernel_install.html))
|
||||||
|
There are also more fancy techniques such as the [Jupyter Kernel
|
||||||
|
Gateway](https://jupyter-kernel-gateway.readthedocs.io/) and [Enterprise
|
||||||
|
Gateway](https://jupyter-enterprise-gateway.readthedocs.io/), which
|
||||||
|
allow you to run the kernels on a different machine and possibly with
|
||||||
|
a different environment.
|
||||||
|
|
||||||
|
A kernel doesn't just execute it's language - cell magics such as `%`,
|
||||||
|
`%%`, and `!` are a property of the kernel - in particular, these are
|
||||||
|
IPython kernel commands and don't necessarily work in any other
|
||||||
|
kernel unless they specifically support them.
|
||||||
|
|
||||||
|
Kernels are yet _another_ layer of configurability.
|
||||||
|
Each kernel can run a different programming language, with different
|
||||||
|
software, and so on. By default, they would run in the same
|
||||||
|
environment as the single-user notebook server, and the most common
|
||||||
|
other way they are configured is by
|
||||||
|
running in different Python virtual environments or conda
|
||||||
|
environments. They can be started and killed independently (there is
|
||||||
|
normally one per notebook you have open). The kernel uses
|
||||||
|
most of your memory and CPU when running Jupyter - the rest of the web
|
||||||
|
interface has a small footprint.
|
||||||
|
|
||||||
|
You can list your installed kernels with `jupyter kernelspec list`.
|
||||||
|
If you look at one of `kernel.json` files in those directories, you
|
||||||
|
will see exactly what command is run. These are normally
|
||||||
|
automatically made by the kernels, but can be edited as needed. [The
|
||||||
|
spec](https://jupyter-client.readthedocs.io/en/stable/kernels.html)
|
||||||
|
tells you even more.
|
||||||
|
|
||||||
|
The kernel normally has to be reachable by the single-user notebook server
|
||||||
|
but the gateways mentioned above can get around that limitation.
|
||||||
|
|
||||||
|
If you get problems with "Kernel died" or some other error in a single
|
||||||
|
notebook but the single-user notebook server stays working, it is
|
||||||
|
usually a problem with the kernel. It could be that you are trying to
|
||||||
|
use more resources than you are allowed and the symptom is the kernel
|
||||||
|
getting killed. It could be that it crashes for some other reason.
|
||||||
|
In these cases, you need to find the kernel logs and investigate.
|
||||||
|
|
||||||
|
The debug logs for the kernel are normally mixed in with the
|
||||||
|
single-user notebook server logs.
|
||||||
|
|
||||||
|
## JupyterHub distributions
|
||||||
|
|
||||||
|
There are several "distributions" which automatically install all of
|
||||||
|
the things above and configure them for a certain purpose. They are
|
||||||
|
good ways to get started, but if you have custom needs, eventually it
|
||||||
|
may become hard to adapt them to your requirements.
|
||||||
|
|
||||||
|
- [**Zero to JupyterHub with
|
||||||
|
Kubernetes**](https://zero-to-jupyterhub.readthedocs.io/) installs
|
||||||
|
an entire scaleable system using Kubernetes. Uses KubeSpawner,
|
||||||
|
....Authenticator, ....
|
||||||
|
|
||||||
|
- [**The Littlest JupyterHub**](https://tljh.jupyter.org/) installs JupyterHub on a single system
|
||||||
|
using SystemdSpawner and NativeAuthenticator (which manages users
|
||||||
|
itself).
|
||||||
|
|
||||||
|
- [**JupyterHub the hard way**](https://github.com/jupyterhub/jupyterhub-the-hard-way/blob/master/docs/installation-guide-hard.md)
|
||||||
|
takes you through everything yourself. It is a natural companion to
|
||||||
|
this guide, since you get to experience every little bit.
|
||||||
|
|
||||||
|
## What's next?
|
||||||
|
|
||||||
|
Now you know everything. Well, you know how everything relates, but
|
||||||
|
there are still plenty of details, implementations, and exceptions.
|
||||||
|
When setting up JupyterHub, the first step is to consider the above
|
||||||
|
layers, decide the right option for each of them, then begin putting
|
||||||
|
everything together.
|
@@ -1,4 +1,4 @@
|
|||||||
(hub-database)=
|
(explanation:hub-database)=
|
||||||
|
|
||||||
# The Hub's Database
|
# The Hub's Database
|
||||||
|
|
||||||
@@ -108,26 +108,29 @@ Doing so generally involves:
|
|||||||
### Default backend: SQLite
|
### Default backend: SQLite
|
||||||
|
|
||||||
The default database backend for JupyterHub is [SQLite](https://sqlite.org).
|
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).
|
We have chosen SQLite as JupyterHub's default because it's simple (the 'database' is a single file), ubiquitous (it is in the Python standard library), and it does not require maintaining a separate database server.
|
||||||
It works very well for testing, small deployments, and workshops.
|
|
||||||
|
|
||||||
For production systems, SQLite has some disadvantages when used with JupyterHub:
|
The main disadvantage of SQLite is it does not support remote backup tools or replication.
|
||||||
|
You should backup your database by taking snapshots of the file (`jupyterhub.sqlite`).
|
||||||
|
|
||||||
- `upgrade-db` may not always work, and you may need to start with a fresh database
|
SQLite is ideal for testing, small deployments, workshops, and production servers where you do not require remote backup or replication.
|
||||||
- `downgrade-db` **will not** work if you want to rollback to an earlier
|
|
||||||
version, so backup the `jupyterhub.sqlite` file before upgrading (JupyterHub automatically creates a date-stamped backup file when upgrading sqlite)
|
### Picking your database backend (PostgreSQL, MySQL)
|
||||||
|
|
||||||
The sqlite documentation provides a helpful page about [when to use SQLite and
|
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).
|
where traditional RDBMS may be a better choice](https://sqlite.org/whentouse.html).
|
||||||
|
|
||||||
### Picking your database backend (PostgreSQL, MySQL)
|
|
||||||
|
|
||||||
When running a long term deployment or a production system, we recommend using a full-fledged relational database, such as [PostgreSQL](https://www.postgresql.org) or [MySQL](https://www.mysql.com), that supports the SQL `ALTER TABLE` statement, which is used in some database upgrade steps.
|
|
||||||
|
|
||||||
In general, you select your database backend with [](JupyterHub.db_url), and can further configure it (usually not necessary) with [](JupyterHub.db_kwargs).
|
In general, you select your database backend with [](JupyterHub.db_url), and can further configure it (usually not necessary) with [](JupyterHub.db_kwargs).
|
||||||
|
|
||||||
## Notes and Tips
|
## Notes and Tips
|
||||||
|
|
||||||
|
### Upgrading the JupyterHub database
|
||||||
|
|
||||||
|
[Upgrading JupyterHub to a new major release](howto:upgrading-jupyterhub) often requires an upgrade to the database schema.
|
||||||
|
|
||||||
|
- `jupyterhub upgrade-db` will execute a schema upgrade. You should backup your database before running this.
|
||||||
|
- `jupyterhub downgrade-db` may be able to revert a schema upgrade on PostgreSQL and MySQL, but this is not guaranteed to work, and is not supported.
|
||||||
|
|
||||||
### SQLite
|
### SQLite
|
||||||
|
|
||||||
The SQLite database should not be used on NFS. SQLite uses reader/writer locks
|
The SQLite database should not be used on NFS. SQLite uses reader/writer locks
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
(explanation)=
|
||||||
|
|
||||||
# Explanation
|
# Explanation
|
||||||
|
|
||||||
_Explanation_ documentation provide big-picture descriptions of how JupyterHub works. This section is meant to build your understanding of particular topics.
|
_Explanation_ documentation provide big-picture descriptions of how JupyterHub works. This section is meant to build your understanding of particular topics.
|
||||||
@@ -5,6 +7,7 @@ _Explanation_ documentation provide big-picture descriptions of how JupyterHub w
|
|||||||
```{toctree}
|
```{toctree}
|
||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
|
|
||||||
|
concepts
|
||||||
capacity-planning
|
capacity-planning
|
||||||
database
|
database
|
||||||
websecurity
|
websecurity
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
(jupyterhub-oauth)=
|
(explanation:hub-oauth)=
|
||||||
|
|
||||||
# JupyterHub and OAuth
|
# JupyterHub and OAuth
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ the OAuth callback request.
|
|||||||
to retrieve information about the owner of the token (the user).
|
to retrieve information about the owner of the token (the user).
|
||||||
This is the step where behavior diverges for different OAuth providers.
|
This is the step where behavior diverges for different OAuth providers.
|
||||||
Up to this point, all OAuth providers are the same, following the OAuth specification.
|
Up to this point, all OAuth providers are the same, following the OAuth specification.
|
||||||
However, OAuth does not define a standard for issuing tokens in exchange for information about their owner or permissions ([OpenID Connect](https://openid.net/connect/) does that),
|
However, OAuth does not define a standard for issuing tokens in exchange for information about their owner or permissions ([OpenID Connect](https://openid.net/developers/how-connect-works/) does that),
|
||||||
so this step may be different for each OAuth provider.
|
so this step may be different for each OAuth provider.
|
||||||
- Finally, the OAuth client stores its own record that the user is authorized in a cookie.
|
- Finally, the OAuth client stores its own record that the user is authorized in a cookie.
|
||||||
This could be the token itself, or any other appropriate representation of successful authentication.
|
This could be the token itself, or any other appropriate representation of successful authentication.
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
(singleuser)=
|
(explanation:singleuser)=
|
||||||
|
|
||||||
# The JupyterHub single-user server
|
# The JupyterHub single-user server
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ It's the same!
|
|||||||
|
|
||||||
## Single-user server authentication
|
## Single-user server authentication
|
||||||
|
|
||||||
Implementation-wise, JupyterHub single-user servers are a special-case of {ref}`services`
|
Implementation-wise, JupyterHub single-user servers are a special-case of {ref}`services-reference`
|
||||||
and as such use the same (OAuth) authentication mechanism (more on OAuth in JupyterHub at [](oauth)).
|
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 is primarily implemented in the {class}`~.HubOAuth` class.
|
||||||
|
|
||||||
@@ -104,6 +104,6 @@ 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
|
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)
|
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`.
|
which means that you can customize JupyterHub to launch _any_ web application that meets these criteria, by following the specifications in {ref}`services-reference`.
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
(web-security)=
|
(explanation:security)=
|
||||||
|
|
||||||
# Security Overview
|
# Security Overview
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ matching `*.jupyter.example.org`.
|
|||||||
Unfortunately, for many institutional domains, wildcard DNS and SSL may not be available.
|
Unfortunately, for many institutional domains, wildcard DNS and SSL may not be available.
|
||||||
|
|
||||||
We also **strongly encourage** serving JupyterHub and user content on a domain that is _not_ a subdomain of any sensitive content.
|
We also **strongly encourage** serving JupyterHub and user content on a domain that is _not_ a subdomain of any sensitive content.
|
||||||
For reasoning, see [GitHub's discussion of moving user content to github.io from \*.github.com](https://github.blog/2013-04-09-yummy-cookies-across-domains/).
|
For reasoning, see [GitHub's discussion of moving user content to github.io from \*.github.com](https://github.blog/engineering/yummy-cookies-across-domains/).
|
||||||
|
|
||||||
**If you do plan to serve untrusted users, enabling subdomains is highly encouraged**,
|
**If you do plan to serve untrusted users, enabling subdomains is highly encouraged**,
|
||||||
as it resolves many security issues, which are difficult to unavoidable when JupyterHub is on a single-domain.
|
as it resolves many security issues, which are difficult to unavoidable when JupyterHub is on a single-domain.
|
||||||
@@ -186,7 +186,6 @@ For example:
|
|||||||
|
|
||||||
- `Content-Security-Policy` header must prohibit popups and iframes from the same origin.
|
- `Content-Security-Policy` header must prohibit popups and iframes from the same origin.
|
||||||
The following Content-Security-Policy rules are _insecure_ and readily enable users to access each others' servers:
|
The following Content-Security-Policy rules are _insecure_ and readily enable users to access each others' servers:
|
||||||
|
|
||||||
- `frame-ancestors: 'self'`
|
- `frame-ancestors: 'self'`
|
||||||
- `frame-ancestors: '*'`
|
- `frame-ancestors: '*'`
|
||||||
- `sandbox allow-popups`
|
- `sandbox allow-popups`
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
(faq)=
|
||||||
|
|
||||||
# Frequently asked questions
|
# Frequently asked questions
|
||||||
|
|
||||||
## How do I share links to notebooks?
|
## How do I share links to notebooks?
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
(faq:institutional)=
|
||||||
|
|
||||||
# Institutional FAQ
|
# Institutional FAQ
|
||||||
|
|
||||||
This page contains common questions from users of JupyterHub,
|
This page contains common questions from users of JupyterHub,
|
||||||
@@ -64,7 +66,7 @@ industry, and government research labs. It is most-commonly used by two kinds of
|
|||||||
Here is a sample of organizations that use JupyterHub:
|
Here is a sample of organizations that use JupyterHub:
|
||||||
|
|
||||||
- **Universities and colleges**: UC Berkeley, UC San Diego, Cal Poly SLO, Harvard University, University of Chicago,
|
- **Universities and colleges**: UC Berkeley, UC San Diego, Cal Poly SLO, Harvard University, University of Chicago,
|
||||||
University of Oslo, University of Sheffield, Université Paris Sud, University of Versailles
|
University of Oslo, University of Sheffield, Université Paris Sud, University of Versailles, University of Portland
|
||||||
- **Research laboratories**: NASA, NCAR, NOAA, the Large Synoptic Survey Telescope, Brookhaven National Lab,
|
- **Research laboratories**: NASA, NCAR, NOAA, the Large Synoptic Survey Telescope, Brookhaven National Lab,
|
||||||
Minnesota Supercomputing Institute, ALCF, CERN, Lawrence Livermore National Laboratory, HUNT
|
Minnesota Supercomputing Institute, ALCF, CERN, Lawrence Livermore National Laboratory, HUNT
|
||||||
- **Online communities**: Pangeo, Quantopian, mybinder.org, MathHub, Open Humans
|
- **Online communities**: Pangeo, Quantopian, mybinder.org, MathHub, Open Humans
|
||||||
@@ -130,7 +132,7 @@ level for several years, and makes a number of "default" security decisions that
|
|||||||
users.
|
users.
|
||||||
|
|
||||||
- For security considerations in the base JupyterHub application,
|
- For security considerations in the base JupyterHub application,
|
||||||
[see the JupyterHub security page](web-security).
|
[see the JupyterHub security page](explanation:security).
|
||||||
- For security considerations when deploying JupyterHub on Kubernetes, see the
|
- For security considerations when deploying JupyterHub on Kubernetes, see the
|
||||||
[JupyterHub on Kubernetes security page](https://z2jh.jupyter.org/en/latest/security.html).
|
[JupyterHub on Kubernetes security page](https://z2jh.jupyter.org/en/latest/security.html).
|
||||||
|
|
||||||
@@ -140,7 +142,7 @@ in a variety of deployment setups. This often entails connecting your JupyterHub
|
|||||||
in these cases, and the security of your JupyterHub deployment will often depend on these decisions.
|
in these cases, and the security of your JupyterHub deployment will often depend on these decisions.
|
||||||
|
|
||||||
If you are worried about security, don't hesitate to reach out to the JupyterHub community in the
|
If you are worried about security, don't hesitate to reach out to the JupyterHub community in the
|
||||||
[Jupyter Community Forum](https://discourse.jupyter.org/c/jupyterhub). This community of practice has many
|
[Jupyter Community Forum](https://discourse.jupyter.org/c/jupyterhub/10). This community of practice has many
|
||||||
individuals with experience running secure JupyterHub deployments and will be very glad to help you out.
|
individuals with experience running secure JupyterHub deployments and will be very glad to help you out.
|
||||||
|
|
||||||
### Does JupyterHub provide computing or data infrastructure?
|
### Does JupyterHub provide computing or data infrastructure?
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
(troubleshooting)=
|
(faq:troubleshooting)=
|
||||||
|
|
||||||
# Troubleshooting
|
# Troubleshooting
|
||||||
|
|
||||||
@@ -167,7 +167,7 @@ When your whole JupyterHub sits behind an organization proxy (_not_ a reverse pr
|
|||||||
|
|
||||||
### Launching Jupyter Notebooks to run as an externally managed JupyterHub service with the `jupyterhub-singleuser` command returns a `JUPYTERHUB_API_TOKEN` error
|
### Launching Jupyter Notebooks to run as an externally managed JupyterHub service with the `jupyterhub-singleuser` command returns a `JUPYTERHUB_API_TOKEN` error
|
||||||
|
|
||||||
{ref}`services` allow processes to interact with JupyterHub's REST API. Example use-cases include:
|
{ref}`services-reference` allow processes to interact with JupyterHub's REST API. Example use-cases include:
|
||||||
|
|
||||||
- **Secure Testing**: provide a canonical Jupyter Notebook for testing production data to reduce the number of entry points into production systems.
|
- **Secure Testing**: provide a canonical Jupyter Notebook for testing production data to reduce the number of entry points into production systems.
|
||||||
- **Grading Assignments**: provide access to shared Jupyter Notebooks that may be used for management tasks such as grading assignments.
|
- **Grading Assignments**: provide access to shared Jupyter Notebooks that may be used for management tasks such as grading assignments.
|
||||||
@@ -198,6 +198,23 @@ With a docker container, pass in the environment variable with the run command:
|
|||||||
|
|
||||||
[This example](https://github.com/jupyterhub/jupyterhub/tree/HEAD/examples/service-notebook/external) demonstrates how to combine the use of the `jupyterhub-singleuser` environment variables when launching a Notebook as an externally managed service.
|
[This example](https://github.com/jupyterhub/jupyterhub/tree/HEAD/examples/service-notebook/external) demonstrates how to combine the use of the `jupyterhub-singleuser` environment variables when launching a Notebook as an externally managed service.
|
||||||
|
|
||||||
|
### Jupyter Notebook/Lab can be launched, but notebooks seem to hang when trying to execute a cell
|
||||||
|
|
||||||
|
This often occurs when your browser is unable to open a websocket connection to a Jupyter kernel.
|
||||||
|
|
||||||
|
#### Diagnose
|
||||||
|
|
||||||
|
Open your browser console, e.g. [Chrome](https://developer.chrome.com/docs/devtools/console), [Firefox](https://firefox-source-docs.mozilla.org/devtools-user/web_console/).
|
||||||
|
If you see errors related to opening websockets this is likely to be the problem.
|
||||||
|
|
||||||
|
#### Solutions
|
||||||
|
|
||||||
|
This could be caused by anything related to the network between your computer/browser and the server running JupyterHub, such as:
|
||||||
|
|
||||||
|
- reverse proxies (see {ref}`howto:config:reverse-proxy` for example configurations)
|
||||||
|
- anti-virus or firewalls running on your computer or JupyterHub server
|
||||||
|
- transparent proxies running on your network
|
||||||
|
|
||||||
## How do I...?
|
## How do I...?
|
||||||
|
|
||||||
### Use a chained SSL certificate
|
### Use a chained SSL certificate
|
||||||
@@ -259,17 +276,6 @@ the entire filesystem and set the default to the user's home directory.
|
|||||||
c.Spawner.notebook_dir = '/'
|
c.Spawner.notebook_dir = '/'
|
||||||
c.Spawner.default_url = '/home/%U' # %U will be replaced with the username
|
c.Spawner.default_url = '/home/%U' # %U will be replaced with the username
|
||||||
|
|
||||||
### How do I increase the number of pySpark executors on YARN?
|
|
||||||
|
|
||||||
From the command line, pySpark executors can be configured using a command
|
|
||||||
similar to this one:
|
|
||||||
|
|
||||||
pyspark --total-executor-cores 2 --executor-memory 1G
|
|
||||||
|
|
||||||
[Cloudera documentation for configuring spark on YARN applications](https://www.cloudera.com/documentation/enterprise/latest/topics/cdh_ig_running_spark_on_yarn.html#spark_on_yarn_config_apps)
|
|
||||||
provides additional information. The [pySpark configuration documentation](https://spark.apache.org/docs/0.9.0/configuration.html)
|
|
||||||
is also helpful for programmatic configuration examples.
|
|
||||||
|
|
||||||
### How do I use JupyterLab's pre-release version with JupyterHub?
|
### How do I use JupyterLab's pre-release version with JupyterHub?
|
||||||
|
|
||||||
While JupyterLab is still under active development, we have had users
|
While JupyterLab is still under active development, we have had users
|
||||||
@@ -300,6 +306,52 @@ notebook servers to default to JupyterLab:
|
|||||||
|
|
||||||
Users will need a GitHub account to log in and be authenticated by the Hub.
|
Users will need a GitHub account to log in and be authenticated by the Hub.
|
||||||
|
|
||||||
|
### I'm seeing "403 Forbidden XSRF cookie does not match POST" when users try to login
|
||||||
|
|
||||||
|
During login, JupyterHub takes the request IP into account for CSRF protection.
|
||||||
|
If proxies are not configured to properly set forwarded ips,
|
||||||
|
JupyterHub will see all requests as coming from an internal ip,
|
||||||
|
likely the ip of the proxy itself.
|
||||||
|
You can see this in the JupyterHub logs, which log the ip address of requests.
|
||||||
|
If most requests look like they are coming from a small number `10.0.x.x` or `172.16.x.x` ips, the proxy is not forwarding the true request ip properly.
|
||||||
|
If the proxy has multiple replicas,
|
||||||
|
then it is likely the ip may change from one request to the next,
|
||||||
|
leading to this error during login:
|
||||||
|
|
||||||
|
> 403 Forbidden XSRF cookie does not match POST argument
|
||||||
|
|
||||||
|
The best way to fix this is to ensure your proxies set the forwarded headers, e.g. for nginx:
|
||||||
|
|
||||||
|
```nginx
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
```
|
||||||
|
|
||||||
|
But if this is not available to you, you can instruct jupyterhub to ignore IPs from certain networks
|
||||||
|
with the environment variable `$JUPYTERHUB_XSRF_ANONYMOUS_IP_CIDRS`.
|
||||||
|
For example, to ignore the common [private networks](https://en.wikipedia.org/wiki/Private_network#Private_IPv4_addresses):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export JUPYTERHUB_XSRF_ANONYMOUS_IP_CIDRS="10.0.0.0/8;172.16.0.0/12;192.168.0.0/16"
|
||||||
|
```
|
||||||
|
|
||||||
|
The result will be that any request from an ip on one of these networks will be treated as coming from the same source.
|
||||||
|
|
||||||
|
To totally disable taking the ip into consideration, set
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export JUPYTERHUB_XSRF_ANONYMOUS_IP_CIDRS="0.0.0.0/0"
|
||||||
|
```
|
||||||
|
|
||||||
|
If your proxy sets its own headers to identify a browser origin, you can instruct JupyterHub to use those:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export JUPYTERHUB_XSRF_ANONYMOUS_ID_HEADERS="My-Custom-Header;User-Agent"
|
||||||
|
```
|
||||||
|
|
||||||
|
Again, these things are only used to compute the XSRF token used while a user is not logged in (i.e. during login itself).
|
||||||
|
|
||||||
### How do I set up rotating daily logs?
|
### How do I set up rotating daily logs?
|
||||||
|
|
||||||
You can do this with [logrotate](https://linux.die.net/man/8/logrotate),
|
You can do this with [logrotate](https://linux.die.net/man/8/logrotate),
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
(api-only)=
|
(howto:api-only)=
|
||||||
|
|
||||||
# Deploying JupyterHub in "API only mode"
|
# Deploying JupyterHub in "API only mode"
|
||||||
|
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
(howto:config:gh-oauth)=
|
||||||
|
|
||||||
# Configure GitHub OAuth
|
# Configure GitHub OAuth
|
||||||
|
|
||||||
In this example, we show a configuration file for a fairly standard JupyterHub
|
In this example, we show a configuration file for a fairly standard JupyterHub
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
(howto:config:reverse-proxy)=
|
||||||
|
|
||||||
# Using a reverse proxy
|
# Using a reverse proxy
|
||||||
|
|
||||||
In the following example, we show configuration files for a JupyterHub server
|
In the following example, we show configuration files for a JupyterHub server
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
(howto:config:no-sudo)=
|
||||||
|
|
||||||
# Run JupyterHub without root privileges using `sudo`
|
# Run JupyterHub without root privileges using `sudo`
|
||||||
|
|
||||||
**Note:** Setting up `sudo` permissions involves many pieces of system
|
**Note:** Setting up `sudo` permissions involves many pieces of system
|
||||||
@@ -33,7 +35,7 @@ This user shouldn't have a login shell or password (possible with -r).
|
|||||||
|
|
||||||
## Set up sudospawner
|
## Set up sudospawner
|
||||||
|
|
||||||
Next, you will need [sudospawner](https://github.com/jupyter/sudospawner)
|
Next, you will need [sudospawner](https://github.com/jupyterhub/sudospawner)
|
||||||
to enable monitoring the single-user servers with sudo:
|
to enable monitoring the single-user servers with sudo:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -70,7 +72,7 @@ rhea ALL=(JUPYTER_USERS) NOPASSWD:JUPYTER_CMD
|
|||||||
```
|
```
|
||||||
|
|
||||||
It might be useful to modify `secure_path` to add commands in path. (Search for
|
It might be useful to modify `secure_path` to add commands in path. (Search for
|
||||||
`secure_path` in the [sudo docs](https://www.sudo.ws/man/1.8.14/sudoers.man.html)
|
`secure_path` in the [sudo docs](https://www.sudo.ws)
|
||||||
|
|
||||||
As an alternative to adding every user to the `/etc/sudoers` file, you can
|
As an alternative to adding every user to the `/etc/sudoers` file, you can
|
||||||
use a group in the last line above, instead of `JUPYTER_USERS`:
|
use a group in the last line above, instead of `JUPYTER_USERS`:
|
||||||
@@ -123,7 +125,7 @@ the shadow password database.
|
|||||||
**Note:** On [Fedora based distributions](https://fedoraproject.org/wiki/List_of_Fedora_remixes) there is no clear way to configure
|
**Note:** On [Fedora based distributions](https://fedoraproject.org/wiki/List_of_Fedora_remixes) there is no clear way to configure
|
||||||
the PAM database to allow sufficient access for authenticating with the target user's password
|
the PAM database to allow sufficient access for authenticating with the target user's password
|
||||||
from JupyterHub. As a workaround we recommend use an
|
from JupyterHub. As a workaround we recommend use an
|
||||||
[alternative authentication method](https://github.com/jupyterhub/jupyterhub/wiki/Authenticators).
|
[alternative authentication method](authenticators-reference).
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ ls -l /etc/shadow
|
$ ls -l /etc/shadow
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
(howto:config:user-env)=
|
||||||
|
|
||||||
# Configuring user environments
|
# Configuring user environments
|
||||||
|
|
||||||
To deploy JupyterHub means you are providing Jupyter notebook environments for
|
To deploy JupyterHub means you are providing Jupyter notebook environments for
|
||||||
|
130
docs/source/howto/forced-login.md
Normal file
130
docs/source/howto/forced-login.md
Normal file
@@ -0,0 +1,130 @@
|
|||||||
|
# Logging users in via URL
|
||||||
|
|
||||||
|
Sometimes, JupyterHub is integrated into an existing application that has already handled user login, etc..
|
||||||
|
It is often preferable in these applications to be able to link users to their running JupyterHub server without _prompting_ the user to login again with the Hub when the Hub should really be an implementation detail,
|
||||||
|
and not part of the user experience.
|
||||||
|
|
||||||
|
One way to do this has been to use [API only mode](#howto:api-only), issue tokens for users, and redirect users to a URL like `/users/name/?token=abc123`.
|
||||||
|
This is [disabled by default](#HubAuth.allow_token_in_url) in JupyterHub 5, because it presents a vulnerability for users to craft links that let _other_ users login as them, which can lead to inter-user attacks.
|
||||||
|
|
||||||
|
But that leaves the question: how do I as an _application developer_ embedding JupyterHub link users to their own running server without triggering another login prompt?
|
||||||
|
|
||||||
|
The problem with `?token=...` in the URL is specifically that _users_ can get and create these tokens, and share URLs.
|
||||||
|
This wouldn't be an issue if only authorized applications could issue tokens that behave this way.
|
||||||
|
The single-user server doesn't exactly have the hooks to manage this easily, but the [Authenticator](#Authenticator) API does.
|
||||||
|
|
||||||
|
## Problem statement
|
||||||
|
|
||||||
|
We want our external application to be able to:
|
||||||
|
|
||||||
|
1. authenticate users
|
||||||
|
2. (maybe) create JupyterHub users
|
||||||
|
3. start JupyterHub servers
|
||||||
|
4. redirect users into running servers _without_ any login prompts/loading pages from JupyterHub, and without any prior JupyterHub credentials
|
||||||
|
|
||||||
|
Step 1 is up to the application and not JupyterHub's problem.
|
||||||
|
Step 2 and 3 use the JupyterHub [REST API](#jupyterhub-rest-API).
|
||||||
|
The service would need the scopes:
|
||||||
|
|
||||||
|
```
|
||||||
|
admin:users # creating users
|
||||||
|
servers # start/stop servers
|
||||||
|
```
|
||||||
|
|
||||||
|
That leaves the last step: sending users to their running server with credentials, without prompting login.
|
||||||
|
This is where things can get tricky!
|
||||||
|
|
||||||
|
### Ideal case: oauth
|
||||||
|
|
||||||
|
_Ideally_, the best way to set this up is with the external service as an OAuth provider,
|
||||||
|
though in some cases it works best to use proxy-based authentication like Shibboleth / [REMOTE_USER](https://github.com/cwaldbieser/jhub_remote_user_authenticator).
|
||||||
|
The main things to know are:
|
||||||
|
|
||||||
|
- Links to `/hub/user-redirect/some/path` will ultimately land users at `/users/theirserver/some/path` after completing login, ensuring the server is running, etc.
|
||||||
|
- Setting `Authenticator.auto_login = True` allows beginning the login process without JupyterHub's "Login with..." prompt
|
||||||
|
|
||||||
|
_If_ your OAuth provider allows logging in to external services via your oauth provider without prompting, this is enough.
|
||||||
|
Not all do, though.
|
||||||
|
|
||||||
|
If you've already ensured the server is running, this will _appear_ to the user as if they are being sent directly to their running server.
|
||||||
|
But what _actually_ happens is quite a series of redirects, state checks, and cookie-setting:
|
||||||
|
|
||||||
|
1. visiting `/hub/user-redirect/some/path` checks if the user is logged in
|
||||||
|
1. if not, begin the login process (`/hub/login?next=/hub/user-redirect/...`)
|
||||||
|
2. redirects to your oauth provider to authenticate the user
|
||||||
|
3. redirects back to `/hub/oauth_callback` to complete login
|
||||||
|
4. redirects back to `/hub/user-redirect/...`
|
||||||
|
2. once authenticated, checks that the user's server is running
|
||||||
|
1. if not running, begins launch of the server
|
||||||
|
2. redirects to `/hub/spawn-pending/?next=...`
|
||||||
|
3. once the server is running, redirects to the actual user server `/users/username/some/path`
|
||||||
|
|
||||||
|
Now we're done, right? Actually, no, because the browser doesn't have credentials for their user server!
|
||||||
|
This sequence of redirects happens all the time in JupyterHub launch, and is usually totally transparent.
|
||||||
|
|
||||||
|
4. at the user server, check for a token in cookie
|
||||||
|
1. if not present or not valid, begin oauth with the Hub (redirect to `/hub/api/oauth2/authorize/...`)
|
||||||
|
2. hub redirects back to `/users/user/oauth_callback` to complete oauth
|
||||||
|
3. redirect again to the URL that started this internal oauth
|
||||||
|
5. finally, arrive at `/users/username/some/path`, the ultimate destination, with valid JupyterHub credentials
|
||||||
|
|
||||||
|
The steps that will show users something other than the page you want them to are:
|
||||||
|
|
||||||
|
- Step 1.1 will be a prompt e.g. with "Login with..." unless you set `c.Authenticator.auto_login = True`
|
||||||
|
- Step 1.2 _may_ be a prompt from your oauth provider. This isn't controlled by JupyterHub, and may not be avoidable.
|
||||||
|
- Step 2.2 will show the spawn pending page only if the server is not already running
|
||||||
|
|
||||||
|
Otherwise, this is all transparent redirects to the final destination.
|
||||||
|
|
||||||
|
#### Using an authentication proxy (REMOTE_USER)
|
||||||
|
|
||||||
|
If you use an Authentication proxy like Shibboleth that sets e.g. the REMOTE_USER header,
|
||||||
|
you can use an Authenticator like [RemoteUserAuthenticator](https://github.com/cwaldbieser/jhub_remote_user_authenticator) to automatically login users based on headers in the request.
|
||||||
|
The same process will work, but instead of step 1.1 redirecting to the oauth provider, it logs in immediately.
|
||||||
|
If you do support an auth proxy, you also need to be extremely sure that requests only come from the auth proxy, and don't accept any requests setting the REMOTE_USER header coming from other sources.
|
||||||
|
|
||||||
|
### Custom case
|
||||||
|
|
||||||
|
But let's say you can't use OAuth or REMOTE_USER, and you still want to hide JupyterHub implementation details.
|
||||||
|
All you really want is a way to write a URL that will take users to their servers without any login prompts.
|
||||||
|
|
||||||
|
You can do this if you create an Authenticator with `auto_login=True` that logs users in based on something in the _request_, e.g. a query parameter.
|
||||||
|
|
||||||
|
We have an _example_ in the JupyterHub repo in `examples/forced-login` that does this.
|
||||||
|
It is a sample 'external service' where you type in a username and a destination path.
|
||||||
|
When you 'login' with this username:
|
||||||
|
|
||||||
|
1. a token is issued
|
||||||
|
2. the token is stored and associated with the username
|
||||||
|
3. redirect to `/hub/login?login_token=...&next=/hub/user-redirect/destination/path`
|
||||||
|
|
||||||
|
Then on the JupyterHub side, there is the `ForcedLoginAuthenticator`.
|
||||||
|
This class implements `authenticate`, which:
|
||||||
|
|
||||||
|
1. has `auto_login = True` so visiting `/hub/login` calls `authenticate()` directly instead of serving a page
|
||||||
|
2. gets the token from the `login_token` URL parameter
|
||||||
|
3. makes a POST request to the external application with the token, requesting a username
|
||||||
|
4. the external application returns the username and deletes the token, so it cannot be re-used
|
||||||
|
5. Authenticator returns the username
|
||||||
|
|
||||||
|
This doesn't _bypass_ JupyterHub authentication, as some deployments have done, but it does _hide_ it.
|
||||||
|
If your service launches servers via the API, you could run this in [API only mode](#howto:api-only) by adding `/hub/login` as well:
|
||||||
|
|
||||||
|
```python
|
||||||
|
c.JupyterHub.hub_routespec = "/hub/api/"
|
||||||
|
c.Proxy.additional_routes = {"/hub/login": "http://hub:8080"}
|
||||||
|
```
|
||||||
|
|
||||||
|
```{literalinclude} ../../../examples/forced-login/jupyterhub_config.py
|
||||||
|
:language: python
|
||||||
|
:start-at: class ForcedLoginAuthenticator
|
||||||
|
:end-before: c = get_config()
|
||||||
|
```
|
||||||
|
|
||||||
|
**Why does this work?**
|
||||||
|
|
||||||
|
This is still logging in with a token in the URL, right?
|
||||||
|
Yes, but the key difference is that users cannot issue these tokens.
|
||||||
|
The sample application is still technically vulnerable, because the token link should really be non-transferrable, even if it can only be used once.
|
||||||
|
The only defense the sample application has against this is rapidly expiring tokens (they expire after 30 seconds).
|
||||||
|
You can use state cookies, etc. to manage that more rigorously, as done in OAuth (at which point, maybe implement OAuth itself, why not?).
|
@@ -14,7 +14,7 @@ separate-proxy
|
|||||||
templates
|
templates
|
||||||
upgrading
|
upgrading
|
||||||
log-messages
|
log-messages
|
||||||
|
forced-login
|
||||||
```
|
```
|
||||||
|
|
||||||
(config-examples)=
|
(config-examples)=
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
(howto:log-messages)=
|
||||||
|
|
||||||
# Interpreting common log messages
|
# Interpreting common log messages
|
||||||
|
|
||||||
When debugging errors and outages, looking at the logs emitted by
|
When debugging errors and outages, looking at the logs emitted by
|
||||||
@@ -69,4 +71,4 @@ aligned, rather than as an indicator of an existing problem.
|
|||||||
Upgrade the version of the `jupyterhub` package in your user environment or image
|
Upgrade the version of the `jupyterhub` package in your user environment or image
|
||||||
so that it matches the version of JupyterHub running your JupyterHub server! If you
|
so that it matches the version of JupyterHub running your JupyterHub server! If you
|
||||||
are using the [zero-to-jupyterhub](https://z2jh.jupyter.org) helm chart, you can find the appropriate
|
are using the [zero-to-jupyterhub](https://z2jh.jupyter.org) helm chart, you can find the appropriate
|
||||||
version of the `jupyterhub` package to install in your user image [here](https://jupyterhub.github.io/helm-chart/)
|
version of the `jupyterhub` package to install in your user image [here](https://hub.jupyter.org/helm-chart/)
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
(howto:custom-proxy)=
|
||||||
|
|
||||||
# Writing a custom Proxy implementation
|
# Writing a custom Proxy implementation
|
||||||
|
|
||||||
JupyterHub 0.8 introduced the ability to write a custom implementation of the
|
JupyterHub 0.8 introduced the ability to write a custom implementation of the
|
||||||
@@ -230,4 +232,4 @@ A list of the proxies that are currently available for JupyterHub (that we know
|
|||||||
|
|
||||||
1. [`jupyterhub/configurable-http-proxy`](https://github.com/jupyterhub/configurable-http-proxy) The default proxy which uses node-http-proxy
|
1. [`jupyterhub/configurable-http-proxy`](https://github.com/jupyterhub/configurable-http-proxy) The default proxy which uses node-http-proxy
|
||||||
2. [`jupyterhub/traefik-proxy`](https://github.com/jupyterhub/traefik-proxy) The proxy which configures traefik proxy server for jupyterhub
|
2. [`jupyterhub/traefik-proxy`](https://github.com/jupyterhub/traefik-proxy) The proxy which configures traefik proxy server for jupyterhub
|
||||||
3. [`AbdealiJK/configurable-http-proxy`](https://github.com/AbdealiJK/configurable-http-proxy) A pure python implementation of the configurable-http-proxy
|
3. [`AbdealiJK/configurable-http-proxy`](https://github.com/corridor/configurable-http-proxy) A pure python implementation of the configurable-http-proxy
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
(using-jupyterhub-rest-api)=
|
(howto:rest-api)=
|
||||||
|
|
||||||
# Using JupyterHub's REST API
|
# Using JupyterHub's REST API
|
||||||
|
|
||||||
@@ -201,7 +201,7 @@ Authorization header.
|
|||||||
|
|
||||||
### Use requests
|
### Use requests
|
||||||
|
|
||||||
Using the popular Python [requests](https://docs.python-requests.org)
|
Using the popular Python [requests](https://requests.readthedocs.io)
|
||||||
library, an API GET request is made to [/users](rest-api-get-users), and the request sends an API token for
|
library, an API GET request is made to [/users](rest-api-get-users), and the request sends an API token for
|
||||||
authorization. The response contains information about the users, here's example code to make an API request for the users of a JupyterHub deployment
|
authorization. The response contains information about the users, here's example code to make an API request for the users of a JupyterHub deployment
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
(separate-proxy)=
|
(howto:separate-proxy)=
|
||||||
|
|
||||||
# Running proxy separately from the hub
|
# Running proxy separately from the hub
|
||||||
|
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
(howto:templates)=
|
||||||
|
|
||||||
# Working with templates and UI
|
# Working with templates and UI
|
||||||
|
|
||||||
The pages of the JupyterHub application are generated from
|
The pages of the JupyterHub application are generated from
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
(upgrading-v5)=
|
(howto:upgrading-v5)=
|
||||||
|
|
||||||
# Upgrading to JupyterHub 5
|
# Upgrading to JupyterHub 5
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
(upgrading-jupyterhub)=
|
(howto:upgrading-jupyterhub)=
|
||||||
|
|
||||||
# Upgrading JupyterHub
|
# Upgrading JupyterHub
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ For specific version migrations:
|
|||||||
The [changelog](changelog) contains information on what has
|
The [changelog](changelog) contains information on what has
|
||||||
changed with the new JupyterHub release and any deprecation warnings.
|
changed with the new JupyterHub release and any deprecation warnings.
|
||||||
Read these notes to familiarize yourself with the coming changes. There
|
Read these notes to familiarize yourself with the coming changes. There
|
||||||
might be new releases of the authenticators & spawners you use, so
|
might be new releases of the authenticators and spawners you use, so
|
||||||
read the changelogs for those too!
|
read the changelogs for those too!
|
||||||
|
|
||||||
## Notify your users
|
## Notify your users
|
||||||
@@ -41,7 +41,7 @@ If you use a different proxy or run `configurable-http-proxy`
|
|||||||
independent of JupyterHub, your users will be able to continue using notebook
|
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.
|
servers they had already launched, but will not be able to launch new servers or sign in.
|
||||||
|
|
||||||
## Backup database & config
|
## Backup database and config
|
||||||
|
|
||||||
Before doing an upgrade, it is critical to back up:
|
Before doing an upgrade, it is critical to back up:
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ with:
|
|||||||
conda install -c conda-forge jupyterhub==<version>
|
conda install -c conda-forge jupyterhub==<version>
|
||||||
```
|
```
|
||||||
|
|
||||||
You should also check for new releases of the authenticator & spawner you
|
You should also check for new releases of the authenticator and spawner you
|
||||||
are using. You might wish to upgrade those packages, too, along with JupyterHub
|
are using. You might wish to upgrade those packages, too, along with JupyterHub
|
||||||
or upgrade them separately.
|
or upgrade them separately.
|
||||||
|
|
||||||
@@ -107,17 +107,6 @@ jupyterhub upgrade-db
|
|||||||
This should find the location of your database, and run the necessary upgrades
|
This should find the location of your database, and run the necessary upgrades
|
||||||
for it.
|
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?
|
### What happens if I delete my database?
|
||||||
|
|
||||||
Losing the Hub database is often not a big deal. Information that
|
Losing the Hub database is often not a big deal. Information that
|
||||||
|
@@ -17,7 +17,7 @@ It has two main distributions which are developed to serve the needs of each of
|
|||||||
|
|
||||||
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.
|
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.
|
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).
|
This distribution runs JupyterHub on top of [Kubernetes](https://kubernetes.io/).
|
||||||
|
|
||||||
```{note}
|
```{note}
|
||||||
It is important to evaluate these distributions before you can continue with the
|
It is important to evaluate these distributions before you can continue with the
|
||||||
|
@@ -14,26 +14,52 @@ The files are:
|
|||||||
scopes descriptions are updated in it.
|
scopes descriptions are updated in it.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from subprocess import run
|
|
||||||
|
|
||||||
from pytablewriter import MarkdownTableWriter
|
from pytablewriter import MarkdownTableWriter
|
||||||
from ruamel.yaml import YAML
|
from ruamel.yaml import YAML
|
||||||
|
|
||||||
|
HERE = Path(__file__).parent.absolute()
|
||||||
|
DOCS = HERE / ".." / ".."
|
||||||
|
REST_API_YAML = DOCS.joinpath("source", "_static", "rest-api.yml")
|
||||||
|
SCOPE_TABLE_MD = HERE.joinpath("scope-table.md")
|
||||||
|
|
||||||
|
|
||||||
|
def _load_jupyterhub_info():
|
||||||
|
"""
|
||||||
|
The equivalent of
|
||||||
|
|
||||||
from jupyterhub import __version__
|
from jupyterhub import __version__
|
||||||
from jupyterhub.scopes import scope_definitions
|
from jupyterhub.scopes import scope_definitions
|
||||||
|
|
||||||
HERE = os.path.abspath(os.path.dirname(__file__))
|
but without needing to install JupyterHub and dependencies
|
||||||
DOCS = Path(HERE).parent.parent.absolute()
|
so that we can run this pre-commit
|
||||||
REST_API_YAML = DOCS.joinpath("source", "_static", "rest-api.yml")
|
"""
|
||||||
SCOPE_TABLE_MD = Path(HERE).joinpath("scope-table.md")
|
root = HERE / ".." / ".." / ".."
|
||||||
|
g = {}
|
||||||
|
exec((root / "jupyterhub" / "_version.py").read_text(), g)
|
||||||
|
|
||||||
|
# To avoid parsing the whole of scope_definitions.py just pull out
|
||||||
|
# the relevant lines
|
||||||
|
scopes_file = root / "jupyterhub" / "scopes.py"
|
||||||
|
scopes_lines = []
|
||||||
|
for line in scopes_file.read_text().splitlines():
|
||||||
|
if not scopes_lines and line == "scope_definitions = {":
|
||||||
|
scopes_lines.append(line)
|
||||||
|
elif scopes_lines:
|
||||||
|
scopes_lines.append(line)
|
||||||
|
if line == "}":
|
||||||
|
break
|
||||||
|
|
||||||
|
exec("\n".join(scopes_lines), g)
|
||||||
|
|
||||||
|
return g["__version__"], g["scope_definitions"]
|
||||||
|
|
||||||
|
|
||||||
class ScopeTableGenerator:
|
class ScopeTableGenerator:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.scopes = scope_definitions
|
self.version, self.scopes = _load_jupyterhub_info()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create_writer(cls, table_name, headers, values):
|
def create_writer(cls, table_name, headers, values):
|
||||||
@@ -131,7 +157,7 @@ class ScopeTableGenerator:
|
|||||||
with open(filename) as f:
|
with open(filename) as f:
|
||||||
content = yaml.load(f.read())
|
content = yaml.load(f.read())
|
||||||
|
|
||||||
content["info"]["version"] = __version__
|
content["info"]["version"] = self.version
|
||||||
for scope in self.scopes:
|
for scope in self.scopes:
|
||||||
description = self.scopes[scope]['description']
|
description = self.scopes[scope]['description']
|
||||||
doc_description = self.scopes[scope].get('doc_description', '')
|
doc_description = self.scopes[scope].get('doc_description', '')
|
||||||
@@ -145,12 +171,6 @@ class ScopeTableGenerator:
|
|||||||
with open(filename, 'w') as f:
|
with open(filename, 'w') as f:
|
||||||
yaml.dump(content, f)
|
yaml.dump(content, f)
|
||||||
|
|
||||||
run(
|
|
||||||
['pre-commit', 'run', 'prettier', '--files', filename],
|
|
||||||
cwd=HERE,
|
|
||||||
check=False,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
table_generator = ScopeTableGenerator()
|
table_generator = ScopeTableGenerator()
|
||||||
|
58
docs/source/rbac/scope-table.md
Normal file
58
docs/source/rbac/scope-table.md
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
Table 1. Available scopes and their hierarchy
|
||||||
|
| Scope | Grants permission to: |
|
||||||
|
| --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `(no_scope)` | Identify the owner of the requesting entity. |
|
||||||
|
| `self` | The user’s own resources _(metascope for users, resolves to (no_scope) for services)_ |
|
||||||
|
| `inherit` | Everything that the token-owning entity can access _(metascope for tokens)_ |
|
||||||
|
| `admin-ui` | Access the admin page. Permission to take actions via the admin page granted separately. |
|
||||||
|
| `admin:users` | Read, modify, create, and delete users and their authentication state, not including their servers or tokens. This is an extremely privileged scope and should be considered tantamount to superuser. |
|
||||||
|
| `admin:auth_state` | Read a user’s authentication state. |
|
||||||
|
| `users` | Read and write permissions to user models (excluding servers, tokens and authentication state). |
|
||||||
|
| `read:users` | Read user models (including the URL of the default server if it is running). |
|
||||||
|
| `read:users:name` | Read names of users. |
|
||||||
|
| `read:users:groups` | Read users’ group membership. |
|
||||||
|
| `read:users:activity` | Read time of last user activity. |
|
||||||
|
| `list:users` | List users, including at least their names. |
|
||||||
|
| `read:users:name` | Read names of users. |
|
||||||
|
| `users:activity` | Update time of last user activity. |
|
||||||
|
| `read:users:activity` | Read time of last user activity. |
|
||||||
|
| `read:roles:users` | Read user role assignments. |
|
||||||
|
| `delete:users` | Delete users. |
|
||||||
|
| `read:roles` | Read role assignments. |
|
||||||
|
| `read:roles:users` | Read user role assignments. |
|
||||||
|
| `read:roles:services` | Read service role assignments. |
|
||||||
|
| `read:roles:groups` | Read group role assignments. |
|
||||||
|
| `admin:servers` | Read, start, stop, create and delete user servers and their state. |
|
||||||
|
| `admin:server_state` | Read and write users’ server state. |
|
||||||
|
| `servers` | Start and stop user servers. |
|
||||||
|
| `read:servers` | Read users’ names and their server models (excluding the server state). |
|
||||||
|
| `read:users:name` | Read names of users. |
|
||||||
|
| `delete:servers` | Stop and delete users' servers. |
|
||||||
|
| `tokens` | Read, write, create and delete user tokens. |
|
||||||
|
| `read:tokens` | Read user tokens. |
|
||||||
|
| `admin:groups` | Read and write group information, create and delete groups. |
|
||||||
|
| `groups` | Read and write group information, including adding/removing any users to/from groups. Note: adding users to groups may affect permissions. |
|
||||||
|
| `read:groups` | Read group models. |
|
||||||
|
| `read:groups:name` | Read group names. |
|
||||||
|
| `list:groups` | List groups, including at least their names. |
|
||||||
|
| `read:groups:name` | Read group names. |
|
||||||
|
| `read:roles:groups` | Read group role assignments. |
|
||||||
|
| `delete:groups` | Delete groups. |
|
||||||
|
| `admin:services` | Create, read, update, delete services, not including services defined from config files. |
|
||||||
|
| `list:services` | List services, including at least their names. |
|
||||||
|
| `read:services:name` | Read service names. |
|
||||||
|
| `read:services` | Read service models. |
|
||||||
|
| `read:services:name` | Read service names. |
|
||||||
|
| `read:roles:services` | Read service role assignments. |
|
||||||
|
| `read:hub` | Read detailed information about the Hub. |
|
||||||
|
| `access:services` | Access services via API or browser. |
|
||||||
|
| `shares` | Manage access to shared servers. |
|
||||||
|
| `access:servers` | Access user servers via API or browser. |
|
||||||
|
| `read:shares` | Read information about shared access to servers. |
|
||||||
|
| `users:shares` | Read and revoke a user's access to shared servers. |
|
||||||
|
| `read:users:shares` | Read servers shared with a user. |
|
||||||
|
| `groups:shares` | Read and revoke a group's access to shared servers. |
|
||||||
|
| `read:groups:shares` | Read servers shared with a group. |
|
||||||
|
| `proxy` | Read information about the proxy’s routing table, sync the Hub with the proxy and notify the Hub about a new proxy. |
|
||||||
|
| `shutdown` | Shutdown the hub. |
|
||||||
|
| `read:metrics` | Read prometheus metrics. |
|
@@ -186,14 +186,14 @@ An **access scope** is used to govern _access_ to a JupyterHub service or a user
|
|||||||
This means making API requests, or visiting via a browser using OAuth.
|
This means making API requests, or visiting via a browser using OAuth.
|
||||||
Without the appropriate access scope, a user or token should not be permitted to make requests of the service.
|
Without the appropriate access scope, a user or token should not be permitted to make requests of the service.
|
||||||
|
|
||||||
When you attempt to access a service or server authenticated with JupyterHub, it will begin the [oauth flow](jupyterhub-oauth) for issuing a token that can be used to access the service.
|
When you attempt to access a service or server authenticated with JupyterHub, it will begin the [oauth flow](explanation:hub-oauth) for issuing a token that can be used to access the service.
|
||||||
If the user does not have the access scope for the relevant service or server, JupyterHub will not permit the oauth process to complete.
|
If the user does not have the access scope for the relevant service or server, JupyterHub will not permit the oauth process to complete.
|
||||||
If oauth completes, the token will have at least the access scope for the service.
|
If oauth completes, the token will have at least the access scope for the service.
|
||||||
For minimal permissions, this is the _only_ scope granted to tokens issued during oauth by default,
|
For minimal permissions, this is the _only_ scope granted to tokens issued during oauth by default,
|
||||||
but can be expanded via {attr}`.Spawner.oauth_client_allowed_scopes` or a service's [`oauth_client_allowed_scopes`](service-credentials) configuration.
|
but can be expanded via {attr}`.Spawner.oauth_client_allowed_scopes` or a service's [`oauth_client_allowed_scopes`](service-credentials) configuration.
|
||||||
|
|
||||||
:::{seealso}
|
:::{seealso}
|
||||||
[Further explanation of OAuth in JupyterHub](jupyterhub-oauth)
|
[Further explanation of OAuth in JupyterHub](explanation:hub-oauth)
|
||||||
:::
|
:::
|
||||||
|
|
||||||
If a given service or single-user server can be governed by a single boolean "yes, you can use this service" or "no, you can't," or limiting via other existing scopes, access scopes are enough to manage access to the service.
|
If a given service or single-user server can be governed by a single boolean "yes, you can use this service" or "no, you can't," or limiting via other existing scopes, access scopes are enough to manage access to the service.
|
||||||
@@ -229,6 +229,32 @@ access:servers!server
|
|||||||
access:servers!server=username/
|
access:servers!server=username/
|
||||||
: access to only `username`'s _default_ server.
|
: access to only `username`'s _default_ server.
|
||||||
|
|
||||||
|
(granting-scopes)=
|
||||||
|
|
||||||
|
### Considerations when allowing users to grant permissions via the `groups` scope
|
||||||
|
|
||||||
|
In general, permissions are fixed by role assignments in configuration (or via [Authenticator-managed roles](#authenticator-roles) in JupyterHub 5) and can only be modified by administrators who can modify the Hub configuration.
|
||||||
|
|
||||||
|
There is only one scope that allows users to modify permissions of themselves or others at runtime instead of via configuration:
|
||||||
|
the `groups` scope, which allows adding and removing users from one or more groups.
|
||||||
|
With the `groups` scope, a user can add or remove any users to/from any group.
|
||||||
|
With the `groups!group=name` filtered scope, a user can add or remove any users to/from a specific group.
|
||||||
|
There are two ways in which adding a user to a group may affect their permissions:
|
||||||
|
|
||||||
|
- if the group is assigned one or more roles, adding a user to the group may increase their permissions (this is usually the point!)
|
||||||
|
- if the group is the _target_ of a filter on this or another group, such as `access:servers!group=students`, adding a user to the group can grant _other_ users elevated access to that user's resources.
|
||||||
|
|
||||||
|
With these in mind, when designing your roles, do not grant users the `groups` scope for any groups which:
|
||||||
|
|
||||||
|
- have roles the user should not have authority over, or
|
||||||
|
- would grant them access they shouldn't have for _any_ user (e.g. don't grant `teachers` both `access:servers!group=students` and `groups!group=students` which is tantamount to the unrestricted `access:servers` because they control which users the `group=students` filter applies to).
|
||||||
|
|
||||||
|
If a group does not have role assignments and the group is not present in any `!group=` filter, there should be no permissions-related consequences for adding users to groups.
|
||||||
|
|
||||||
|
:::{note}
|
||||||
|
The legacy `admin` property of users, which grants extreme superuser permissions and is generally discouraged in favor of more specific roles and scopes, may be modified only by other users with the `admin` property (e.g. added via `admin_users`).
|
||||||
|
:::
|
||||||
|
|
||||||
(custom-scopes)=
|
(custom-scopes)=
|
||||||
|
|
||||||
### Custom scopes
|
### Custom scopes
|
||||||
|
@@ -84,7 +84,6 @@ The passed scopes are compared to the scopes required to access the API as follo
|
|||||||
- if the API scopes are present within the set of passed scopes, the access is granted and the API returns its "full" response
|
- if the API scopes are present within the set of passed scopes, the access is granted and the API returns its "full" response
|
||||||
|
|
||||||
- if that is not the case, another check is utilized to determine if subscopes of the required API scopes can be found in the passed scope set:
|
- if that is not the case, another check is utilized to determine if subscopes of the required API scopes can be found in the passed scope set:
|
||||||
|
|
||||||
- if found, the RBAC framework employs the {ref}`filtering <vertical-filtering-target>` procedures to refine the API response to access only resource attributes corresponding to the passed scopes. For example, providing a scope `read:users:activity!group=class-C` for the `GET /users` API will return a list of user models from group `class-C` containing only the `last_activity` attribute for each user model
|
- if found, the RBAC framework employs the {ref}`filtering <vertical-filtering-target>` procedures to refine the API response to access only resource attributes corresponding to the passed scopes. For example, providing a scope `read:users:activity!group=class-C` for the `GET /users` API will return a list of user models from group `class-C` containing only the `last_activity` attribute for each user model
|
||||||
|
|
||||||
- if not found, the access to API is denied
|
- if not found, the access to API is denied
|
||||||
|
@@ -11,7 +11,7 @@ No other database records are affected.
|
|||||||
## Upgrade steps
|
## Upgrade steps
|
||||||
|
|
||||||
1. All running **servers must be stopped** before proceeding with the upgrade.
|
1. All running **servers must be stopped** before proceeding with the upgrade.
|
||||||
2. To upgrade the Hub, follow the [Upgrading JupyterHub](upgrading-jupyterhub) instructions.
|
2. To upgrade the Hub, follow the [Upgrading JupyterHub](howto:upgrading-jupyterhub) instructions.
|
||||||
```{attention}
|
```{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.
|
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.
|
||||||
```
|
```
|
||||||
|
@@ -1,33 +1,42 @@
|
|||||||
# Authenticators
|
# Authenticators
|
||||||
|
|
||||||
## Module: {mod}`jupyterhub.auth`
|
|
||||||
|
|
||||||
```{eval-rst}
|
```{eval-rst}
|
||||||
.. automodule:: jupyterhub.auth
|
.. module:: jupyterhub.auth
|
||||||
```
|
```
|
||||||
|
|
||||||
### {class}`Authenticator`
|
## {class}`Authenticator`
|
||||||
|
|
||||||
```{eval-rst}
|
```{eval-rst}
|
||||||
.. autoconfigurable:: Authenticator
|
.. autoconfigurable:: Authenticator
|
||||||
:members:
|
:members:
|
||||||
```
|
```
|
||||||
|
|
||||||
### {class}`LocalAuthenticator`
|
## {class}`LocalAuthenticator`
|
||||||
|
|
||||||
```{eval-rst}
|
```{eval-rst}
|
||||||
.. autoconfigurable:: LocalAuthenticator
|
.. autoconfigurable:: LocalAuthenticator
|
||||||
:members:
|
:members:
|
||||||
```
|
```
|
||||||
|
|
||||||
### {class}`PAMAuthenticator`
|
## {class}`PAMAuthenticator`
|
||||||
|
|
||||||
```{eval-rst}
|
```{eval-rst}
|
||||||
.. autoconfigurable:: PAMAuthenticator
|
.. autoconfigurable:: PAMAuthenticator
|
||||||
```
|
```
|
||||||
|
|
||||||
### {class}`DummyAuthenticator`
|
## {class}`DummyAuthenticator`
|
||||||
|
|
||||||
```{eval-rst}
|
```{eval-rst}
|
||||||
.. autoconfigurable:: DummyAuthenticator
|
.. autoconfigurable:: DummyAuthenticator
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```{eval-rst}
|
||||||
|
.. module:: jupyterhub.authenticators.shared
|
||||||
|
```
|
||||||
|
|
||||||
|
## {class}`SharedPasswordAuthenticator`
|
||||||
|
|
||||||
|
```{eval-rst}
|
||||||
|
.. autoconfigurable:: SharedPasswordAuthenticator
|
||||||
|
:no-inherited-members:
|
||||||
|
```
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
:Release: {{ version }}
|
:Release: {{ version }}
|
||||||
|
|
||||||
JupyterHub also provides a REST API for administration of the Hub and users.
|
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
|
The documentation on [Using JupyterHub's REST API](howto:rest-api) provides
|
||||||
information on:
|
information on:
|
||||||
|
|
||||||
- what you can do with the API
|
- what you can do with the API
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
```{eval-rst}
|
```{eval-rst}
|
||||||
.. autoconfigurable:: Spawner
|
.. autoconfigurable:: Spawner
|
||||||
:members: options_from_form, poll, start, stop, get_args, get_env, get_state, template_namespace, format_string, create_certs, move_certs
|
:members: options_from_form, user_options, poll, start, stop, get_args, get_env, get_state, template_namespace, format_string, create_certs, move_certs
|
||||||
```
|
```
|
||||||
|
|
||||||
### {class}`LocalProcessSpawner`
|
### {class}`LocalProcessSpawner`
|
||||||
|
@@ -36,16 +36,56 @@ A [generic implementation](https://github.com/jupyterhub/oauthenticator/blob/mas
|
|||||||
|
|
||||||
## The Dummy Authenticator
|
## The Dummy Authenticator
|
||||||
|
|
||||||
When testing, it may be helpful to use the
|
When testing, it may be helpful to use the {class}`~.jupyterhub.auth.DummyAuthenticator`:
|
||||||
{class}`~.jupyterhub.auth.DummyAuthenticator`. This allows for any username and
|
|
||||||
password unless a global password has been set. Once set, any username will
|
```python
|
||||||
still be accepted but the correct password will need to be provided.
|
c.JupyterHub.authenticator_class = "dummy"
|
||||||
|
# always a good idea to limit to localhost when testing with an insecure config
|
||||||
|
c.JupyterHub.ip = "127.0.0.1"
|
||||||
|
```
|
||||||
|
|
||||||
|
This allows for any username and password to login, and is _wildly_ insecure.
|
||||||
|
|
||||||
|
To use, specify
|
||||||
|
|
||||||
|
```python
|
||||||
|
c.JupyterHub.authenticator_class = "dummy"
|
||||||
|
```
|
||||||
|
|
||||||
:::{versionadded} 5.0
|
:::{versionadded} 5.0
|
||||||
The DummyAuthenticator's default `allow_all` is True,
|
The DummyAuthenticator's default `allow_all` is True,
|
||||||
unlike most other Authenticators.
|
unlike most other Authenticators.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
:::{deprecated} 5.3
|
||||||
|
Setting a password on DummyAuthenticator is deprecated.
|
||||||
|
Use the new {class}`~.jupyterhub.authenticators.shared.SharedPasswordAuthenticator`
|
||||||
|
if you want to set a shared password for users.
|
||||||
|
:::
|
||||||
|
|
||||||
|
## Shared Password Authenticator
|
||||||
|
|
||||||
|
:::{versionadded} 5.3
|
||||||
|
{class}`~.jupyterhub.authenticators.shared.SharedPasswordAuthenticator` is added and [DummyAuthenticator.password](#DummyAuthenticator.password) is deprecated.
|
||||||
|
:::
|
||||||
|
|
||||||
|
For short-term deployments like workshops where there is no real user data to protect and you trust users to not abuse the system or each other,
|
||||||
|
{class}`~.jupyterhub.authenticators.shared.SharedPasswordAuthenticator` can be used.
|
||||||
|
|
||||||
|
Set a [user password](#SharedPasswordAuthenticator.user_password) for users to login:
|
||||||
|
|
||||||
|
```python
|
||||||
|
c.JupyterHub.authenticator_class = "shared-password"
|
||||||
|
c.SharedPasswordAuthenticator.user_password = "my-workshop-2042"
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also grant admin users access by adding them to `admin_users` and setting a separate [admin password](#SharedPasswordAuthenticator.admin_password):
|
||||||
|
|
||||||
|
```python
|
||||||
|
c.Authenticator.admin_users = {"danger", "eggs"}
|
||||||
|
c.SharedPasswordAuthenticator.admin_password = "extra-super-secret-secure-password"
|
||||||
|
```
|
||||||
|
|
||||||
## Additional Authenticators
|
## Additional Authenticators
|
||||||
|
|
||||||
Additional authenticators can be found on GitHub
|
Additional authenticators can be found on GitHub
|
||||||
@@ -469,8 +509,19 @@ which is a list of group names the user should be a member of:
|
|||||||
- If `None` is returned, no changes are made to the user's group membership
|
- If `None` is returned, no changes are made to the user's group membership
|
||||||
|
|
||||||
If authenticator-managed groups are enabled,
|
If authenticator-managed groups are enabled,
|
||||||
all group-management via the API is disabled,
|
groups cannot be specified with `load_groups` traitlet.
|
||||||
and roles cannot be specified with `load_groups` traitlet.
|
|
||||||
|
:::{warning}
|
||||||
|
When `manage_groups` is True,
|
||||||
|
managing groups via the API is still permitted via the `admin:groups` scope (starting with 5.3),
|
||||||
|
but any time a user logs in their group membership is completely reset via the login process.
|
||||||
|
So it only really makes sense to make manual changes via the API that reflect upstream changes which are not automatically propagated, such as group deletion.
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
|
:::{versionchanged} 5.3
|
||||||
|
Prior to JupyterHub 5.3, all group management via the API was disabled if `Authenticator.manage_groups` is True.
|
||||||
|
:::
|
||||||
|
|
||||||
(authenticator-roles)=
|
(authenticator-roles)=
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@@ -16,17 +16,13 @@ Please submit pull requests to update information or to add new institutions or
|
|||||||
|
|
||||||
- [BIDS - Berkeley Institute for Data Science](https://bids.berkeley.edu/)
|
- [BIDS - Berkeley Institute for Data Science](https://bids.berkeley.edu/)
|
||||||
|
|
||||||
- [Data 8](http://data8.org/)
|
- [Data 8](https://www.data8.org/)
|
||||||
|
|
||||||
- [GitHub organization](https://github.com/data-8)
|
- [GitHub organization](https://github.com/data-8)
|
||||||
|
|
||||||
- [NERSC](https://www.nersc.gov/)
|
- [NERSC](https://www.nersc.gov/)
|
||||||
|
|
||||||
- [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](https://research-it.berkeley.edu)
|
- [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)
|
- [JupyterHub server supports campus research computation](https://research-it.berkeley.edu/news/free-fully-loaded-jupyterhub-server-supports-campus-research-computation)
|
||||||
|
|
||||||
### University of California Davis
|
### University of California Davis
|
||||||
|
|
||||||
@@ -82,20 +78,11 @@ Within CERN, there are two noteworthy JupyterHub deployments in operation:
|
|||||||
- Advanced Computing
|
- Advanced Computing
|
||||||
- [Palmetto cluster and JupyterHub](https://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://curc.readthedocs.io/en/latest/gateways/jupyterhub.html)
|
|
||||||
- Slurm job dispatched on Crestone compute cluster
|
|
||||||
- log troubleshooting
|
|
||||||
- Profiles in IPython Clusters tab
|
|
||||||
|
|
||||||
### ETH Zurich
|
### ETH Zurich
|
||||||
|
|
||||||
[ETH Zurich](https://ethz.ch/en.html), (Federal Institute of Technology Zurich), is a public research university in Zürich, Switzerland, with focus on science, technology, engineering, and mathematics, although its 16 departments span a variety of disciplines and subjects.
|
[ETH Zurich](https://ethz.ch/en.html), (Federal Institute of Technology Zurich), is a public research university in Zürich, Switzerland, with focus on science, technology, engineering, and mathematics, although its 16 departments span a variety of disciplines and subjects.
|
||||||
|
|
||||||
The [Educational Development and Technology](https://ethz.ch/en/the-eth-zurich/organisation/departments/educational-development-and-technology.html) unit provides JupyterHub exclusively for teaching and learning, integrated in the learning management system [Moodle](https://ethz.ch/staffnet/en/teaching/academic-support/it-services-teaching/teaching-applications/moodle-service.html). Each course gets its individually configured JupyterHub environment deployed on a on-premise Kubernetes cluster.
|
The [Educational Development and Technology](https://ethz.ch/en/the-eth-zurich/organisation/departments/teaching-and-learning.html) unit provides JupyterHub exclusively for teaching and learning, integrated in the learning management system [Moodle](https://ethz.ch/staffnet/en/teaching/academic-support/it-services-teaching/teaching-applications/moodle-service.html). Each course gets its individually configured JupyterHub environment deployed on a on-premise Kubernetes cluster.
|
||||||
|
|
||||||
- [ETH JupyterHub](https://ethz.ch/staffnet/en/teaching/academic-support/it-services-teaching/teaching-applications/jupyterhub.html) for teaching and learning
|
- [ETH JupyterHub](https://ethz.ch/staffnet/en/teaching/academic-support/it-services-teaching/teaching-applications/jupyterhub.html) for teaching and learning
|
||||||
|
|
||||||
@@ -134,16 +121,15 @@ The [Educational Development and Technology](https://ethz.ch/en/the-eth-zurich/o
|
|||||||
### Paderborn University
|
### Paderborn University
|
||||||
|
|
||||||
- [Data Science (DICE) group](https://dice-research.org)
|
- [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.
|
- [JavaOnlineExercises](https://github.com/dice-group/JavaOnlineExercises): Use JupyterHub + nbgrader + iJava kernel for online Java exercises. Used in lecture Statistical Natural Language Processing.
|
||||||
|
|
||||||
### Penn State University
|
### 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"
|
- [Press release](https://www.psu.edu/news/academics/story/new-open-source-web-apps-available-students-and-faculty): "New open-source web apps available for students and faculty"
|
||||||
|
|
||||||
### University of California San Diego
|
### University of California San Diego
|
||||||
|
|
||||||
- San Diego Supercomputer Center - Andrea Zonca
|
- San Diego Supercomputer Center - Andrea Zonca
|
||||||
|
|
||||||
- [Deploy JupyterHub on a Supercomputer with SSH](https://zonca.github.io/2017/05/jupyterhub-hpc-batchspawner-ssh.html)
|
- [Deploy JupyterHub on a Supercomputer with SSH](https://zonca.github.io/2017/05/jupyterhub-hpc-batchspawner-ssh.html)
|
||||||
- [Run Jupyterhub on a Supercomputer](https://zonca.github.io/2015/04/jupyterhub-hpc.html)
|
- [Run Jupyterhub on a Supercomputer](https://zonca.github.io/2015/04/jupyterhub-hpc.html)
|
||||||
- [Deploy JupyterHub on a VM for a Workshop](https://zonca.github.io/2016/04/jupyterhub-sdsc-cloud.html)
|
- [Deploy JupyterHub on a VM for a Workshop](https://zonca.github.io/2016/04/jupyterhub-sdsc-cloud.html)
|
||||||
@@ -163,7 +149,7 @@ The [Educational Development and Technology](https://ethz.ch/en/the-eth-zurich/o
|
|||||||
|
|
||||||
### Elucidata
|
### Elucidata
|
||||||
|
|
||||||
- What's new in Jupyter Notebooks @[Elucidata](https://elucidata.io/):
|
- What's new in Jupyter Notebooks @[Elucidata](https://www.elucidata.io/):
|
||||||
- [Using Jupyter Notebooks with Jupyterhub on GCP, managed by GKE](https://medium.com/elucidata/why-you-should-be-using-a-jupyter-notebook-8385a4ccd93d)
|
- [Using Jupyter Notebooks with Jupyterhub on GCP, managed by GKE](https://medium.com/elucidata/why-you-should-be-using-a-jupyter-notebook-8385a4ccd93d)
|
||||||
|
|
||||||
## Service Providers
|
## Service Providers
|
||||||
@@ -183,7 +169,7 @@ The [Educational Development and Technology](https://ethz.ch/en/the-eth-zurich/o
|
|||||||
|
|
||||||
### Microsoft Azure
|
### Microsoft Azure
|
||||||
|
|
||||||
- [Azure Data Science Virtual Machine release notes](https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-data-science-linux-dsvm-intro)
|
- [Azure Data Science Virtual Machine release notes](https://learn.microsoft.com/en-us/azure/machine-learning/machine-learning-data-science-linux-dsvm-intro)
|
||||||
|
|
||||||
### Rackspace Carina
|
### Rackspace Carina
|
||||||
|
|
||||||
@@ -211,5 +197,5 @@ The [Educational Development and Technology](https://ethz.ch/en/the-eth-zurich/o
|
|||||||
- https://www.walkingrandomly.com/?p=5734
|
- https://www.walkingrandomly.com/?p=5734
|
||||||
- https://wrdrd.com/docs/consulting/education-technology
|
- https://wrdrd.com/docs/consulting/education-technology
|
||||||
- https://bitbucket.org/jackhale/fenics-jupyter
|
- https://bitbucket.org/jackhale/fenics-jupyter
|
||||||
- [LinuxCluster blog](https://linuxcluster.wordpress.com/category/application/jupyterhub/)
|
- [LinuxCluster blog](https://thelinuxcluster.com/category/application/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/)
|
- [Spark Cluster on OpenStack with Multi-User Jupyter Notebook](https://arnesund.com/2015/09/21/spark-cluster-on-openstack-with-multi-user-jupyter-notebook/)
|
||||||
|
@@ -32,3 +32,28 @@ export JUPYTERHUB_METRICS_PREFIX=jupyterhub_prod
|
|||||||
```
|
```
|
||||||
|
|
||||||
would result in the metric `jupyterhub_prod_active_users`, etc.
|
would result in the metric `jupyterhub_prod_active_users`, etc.
|
||||||
|
|
||||||
|
(monitoring_bucket_sizes)=
|
||||||
|
|
||||||
|
## Customizing bucket sizes
|
||||||
|
|
||||||
|
As of JupyterHub 5.3, the following environment variables in the Hub's environment can be overridden to support custom bucket sizes - below are the defaults:
|
||||||
|
|
||||||
|
| Variable | Default |
|
||||||
|
| -------------------------------------------------- | ------------------------------------------------------------------ |
|
||||||
|
| `JUPYTERHUB_SERVER_SPAWN_DURATION_SECONDS_BUCKETS` | `0.5,1,2.5,5,10,15,30,60,120,180,300,600,inf` |
|
||||||
|
| `JUPYTERHUB_SERVER_STOP_DURATION_SECONDS_BUCKETS` | `0.005,0.01,0.025,0.05,0.075,0.1,0.25,0.5,0.75,1,2.5,5,7.5,10,inf` |
|
||||||
|
|
||||||
|
For example,
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export JUPYTERHUB_SERVER_SPAWN_DURATION_SECONDS_BUCKETS="1,2,4,6,12,30,60,120,inf"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Configuring metrics
|
||||||
|
|
||||||
|
```{eval-rst}
|
||||||
|
.. currentmodule:: jupyterhub.metrics
|
||||||
|
|
||||||
|
.. autoconfigurable:: PeriodicMetricsCollector
|
||||||
|
```
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
(services)=
|
(services-reference)=
|
||||||
|
|
||||||
# Services
|
# Services
|
||||||
|
|
||||||
@@ -213,7 +213,7 @@ c.JupyterHub.load_roles = [
|
|||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
When a service has a configured URL or explicit `oauth_client_id` or `oauth_redirect_uri`, it can operate as an [OAuth client](jupyterhub-oauth).
|
When a service has a configured URL or explicit `oauth_client_id` or `oauth_redirect_uri`, it can operate as an [OAuth client](explanation:hub-oauth).
|
||||||
When a user visits an oauth-authenticated service,
|
When a user visits an oauth-authenticated service,
|
||||||
completion of authentication results in issuing an oauth token.
|
completion of authentication results in issuing an oauth token.
|
||||||
|
|
||||||
@@ -563,7 +563,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]
|
nbviewer can also be run as a Hub-Managed Service as described [nbviewer README][nbviewer example]
|
||||||
section on securing the notebook viewer.
|
section on securing the notebook viewer.
|
||||||
|
|
||||||
[requests]: https://docs.python-requests.org/en/master/
|
[requests]: https://requests.readthedocs.io
|
||||||
[services_auth]: ../api/services.auth.html
|
[services_auth]: ../api/services.auth.html
|
||||||
[nbviewer example]: https://github.com/jupyter/nbviewer#securing-the-notebook-viewer
|
[nbviewer example]: https://github.com/jupyter/nbviewer#securing-the-notebook-viewer
|
||||||
[fastapi example]: https://github.com/jupyterhub/jupyterhub/tree/HEAD/examples/service-fastapi
|
[fastapi example]: https://github.com/jupyterhub/jupyterhub/tree/HEAD/examples/service-fastapi
|
||||||
|
@@ -201,13 +201,13 @@ To revoke sharing permissions from the perspective of the user or group being sh
|
|||||||
you need the permissions `users:shares` or `groups:shares` with the appropriate _user_ or _group_ filter.
|
you need the permissions `users:shares` or `groups:shares` with the appropriate _user_ or _group_ filter.
|
||||||
This allows users to 'leave' shared servers, without needing permission to manage the server's sharing permissions.
|
This allows users to 'leave' shared servers, without needing permission to manage the server's sharing permissions.
|
||||||
|
|
||||||
```
|
```{parsed-literal}
|
||||||
[DELETE /api/users/:username/shared/:ownername/:servername](rest-api-delete-user-shared-server)
|
[DELETE /api/users/:username/shared/:ownername/:servername](rest-api-delete-user-shared-server)
|
||||||
```
|
```
|
||||||
|
|
||||||
or
|
or
|
||||||
|
|
||||||
```
|
```{parsed-literal}
|
||||||
[DELETE /api/groups/:groupname/shared/:ownername/:servername](rest-api-delete-group-shared-server)
|
[DELETE /api/groups/:groupname/shared/:ownername/:servername](rest-api-delete-group-shared-server)
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -264,7 +264,7 @@ Share codes are much like shares, except:
|
|||||||
To create a share code:
|
To create a share code:
|
||||||
|
|
||||||
```{parsed-literal}
|
```{parsed-literal}
|
||||||
[POST /api/share-code/:username/:servername](rest-api-post-share-code)
|
[POST /api/share-codes/:username/:servername](rest-api-post-share-code)
|
||||||
```
|
```
|
||||||
|
|
||||||
where the body should include the scopes to be granted and expiration.
|
where the body should include the scopes to be granted and expiration.
|
||||||
@@ -286,6 +286,7 @@ The response contains the code itself:
|
|||||||
{
|
{
|
||||||
"code": "abc1234....",
|
"code": "abc1234....",
|
||||||
"accept_url": "/hub/accept-share?code=abc1234",
|
"accept_url": "/hub/accept-share?code=abc1234",
|
||||||
|
"full_accept_url": "https://hub.example.org/hub/accept-share?code=abc1234",
|
||||||
"id": "sc_1234",
|
"id": "sc_1234",
|
||||||
"scopes": [...],
|
"scopes": [...],
|
||||||
...
|
...
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Spawners
|
# Spawners
|
||||||
|
|
||||||
A [Spawner][] starts each single-user notebook server.
|
A [Spawner](#Spawner) starts each single-user notebook server.
|
||||||
The Spawner represents an abstract interface to a process,
|
The Spawner represents an abstract interface to a process,
|
||||||
and a custom Spawner needs to be able to take three actions:
|
and a custom Spawner needs to be able to take three actions:
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ Some examples include:
|
|||||||
|
|
||||||
### Spawner.start
|
### Spawner.start
|
||||||
|
|
||||||
`Spawner.start` should start a single-user server for a single user.
|
[](#Spawner.start) should start a single-user server for a single user.
|
||||||
Information about the user can be retrieved from `self.user`,
|
Information about the user can be retrieved from `self.user`,
|
||||||
an object encapsulating the user's name, authentication, and server info.
|
an object encapsulating the user's name, authentication, and server info.
|
||||||
|
|
||||||
@@ -68,11 +68,11 @@ async def start(self):
|
|||||||
When `Spawner.start` returns, the single-user server process should actually be running,
|
When `Spawner.start` returns, the single-user server process should actually be running,
|
||||||
not just requested. JupyterHub can handle `Spawner.start` being very slow
|
not just requested. JupyterHub can handle `Spawner.start` being very slow
|
||||||
(such as PBS-style batch queues, or instantiating whole AWS instances)
|
(such as PBS-style batch queues, or instantiating whole AWS instances)
|
||||||
via relaxing the `Spawner.start_timeout` config value.
|
via relaxing the [](#Spawner.start_timeout) config value.
|
||||||
|
|
||||||
#### Note on IPs and ports
|
#### Note on IPs and ports
|
||||||
|
|
||||||
`Spawner.ip` and `Spawner.port` attributes set the _bind_ URL,
|
[](#Spawner.ip) and [](#Spawner.port) attributes set the _bind_ URL,
|
||||||
which the single-user server should listen on
|
which the single-user server should listen on
|
||||||
(passed to the single-user process via the `JUPYTERHUB_SERVICE_URL` environment variable).
|
(passed to the single-user process via the `JUPYTERHUB_SERVICE_URL` environment variable).
|
||||||
The _return_ value is the IP and port (or full URL) the Hub should _connect to_.
|
The _return_ value is the IP and port (or full URL) the Hub should _connect to_.
|
||||||
@@ -124,7 +124,7 @@ If both attributes are not present, the Exception will be shown to the user as u
|
|||||||
|
|
||||||
### Spawner.poll
|
### Spawner.poll
|
||||||
|
|
||||||
`Spawner.poll` checks if the spawner is still running.
|
[](#Spawner.poll) checks if the spawner is still running.
|
||||||
It should return `None` if it is still running,
|
It should return `None` if it is still running,
|
||||||
and an integer exit status, otherwise.
|
and an integer exit status, otherwise.
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ to check if the local process is still running. On Windows, it uses `psutil.pid_
|
|||||||
|
|
||||||
### Spawner.stop
|
### Spawner.stop
|
||||||
|
|
||||||
`Spawner.stop` should stop the process. It must be a tornado coroutine, which should return when the process has finished exiting.
|
[](#Spawner.stop) should stop the process. It must be a tornado coroutine, which should return when the process has finished exiting.
|
||||||
|
|
||||||
## Spawner state
|
## Spawner state
|
||||||
|
|
||||||
@@ -166,17 +166,18 @@ def clear_state(self):
|
|||||||
self.pid = 0
|
self.pid = 0
|
||||||
```
|
```
|
||||||
|
|
||||||
|
(spawner_user_options)=
|
||||||
|
|
||||||
## Spawner options form
|
## Spawner options form
|
||||||
|
|
||||||
(new in 0.4)
|
|
||||||
|
|
||||||
Some deployments may want to offer options to users to influence how their servers are started.
|
Some deployments may want to offer options to users to influence how their servers are started.
|
||||||
This may include cluster-based deployments, where users specify what resources should be available,
|
This may include cluster-based deployments, where users specify what memory or cpu resources should be available,
|
||||||
or docker-based deployments where users can select from a list of base images.
|
or container-based deployments where users can select from a list of base images,
|
||||||
|
or more complex configurations where users select a "profile" representing a bundle of settings to be applied together.
|
||||||
|
|
||||||
This feature is enabled by setting `Spawner.options_form`, which is an HTML form snippet
|
This feature is enabled by setting [](#Spawner.options_form), which is an HTML form snippet
|
||||||
inserted unmodified into the spawn form.
|
inserted unmodified into the spawn form.
|
||||||
If the `Spawner.options_form` is defined, when a user tries to start their server, they will be directed to a form page, like this:
|
If the `Spawner.options_form` is defined, when a user tries to start their server they will be directed to a form page, like this:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -186,28 +187,40 @@ See [this example](https://github.com/jupyterhub/jupyterhub/blob/HEAD/examples/s
|
|||||||
|
|
||||||
### `Spawner.options_from_form`
|
### `Spawner.options_from_form`
|
||||||
|
|
||||||
Options from this form will always be a dictionary of lists of strings, e.g.:
|
Inputs from an HTML form always arrive as a dictionary of lists of strings, e.g.:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
{
|
formdata = {
|
||||||
'integer': ['5'],
|
'integer': ['5'],
|
||||||
|
'checkbox': ['on'],
|
||||||
'text': ['some text'],
|
'text': ['some text'],
|
||||||
'select': ['a', 'b'],
|
'select': ['a', 'b'],
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
When `formdata` arrives, it is passed through `Spawner.options_from_form(formdata)`,
|
When `formdata` arrives, it is passed through [](#Spawner.options_from_form):
|
||||||
which is a method to turn the form data into the correct structure.
|
|
||||||
This method must return a dictionary, and is meant to interpret the lists-of-strings into the correct types. For example, the `options_from_form` for the above form would look like:
|
|
||||||
|
|
||||||
```python
|
```python
|
||||||
def options_from_form(self, formdata):
|
spawner.user_options = spawner.options_from_form(formdata, spawner=spawner)
|
||||||
|
```
|
||||||
|
|
||||||
|
to create `spawner.user_options`.
|
||||||
|
|
||||||
|
[](#Spawner.options_from_form) is a configurable function to turn the HTTP form data into the correct structure for [](#Spawner.user_options).
|
||||||
|
`options_from_form` must return a dictionary, _may_ be async, and is meant to interpret the lists-of-strings a web form produces into the correct types.
|
||||||
|
For example, the `options_from_form` for the above form might look like:
|
||||||
|
|
||||||
|
```python
|
||||||
|
def options_from_form(formdata, spawner=None):
|
||||||
options = {}
|
options = {}
|
||||||
options['integer'] = int(formdata['integer'][0]) # single integer value
|
options['integer'] = int(formdata['integer'][0]) # single integer value
|
||||||
|
options['checkbox'] = formdata['checkbox'] == ['on']
|
||||||
options['text'] = formdata['text'][0] # single string value
|
options['text'] = formdata['text'][0] # single string value
|
||||||
options['select'] = formdata['select'] # list already correct
|
options['select'] = formdata['select'] # list already correct
|
||||||
options['notinform'] = 'extra info' # not in the form at all
|
options['notinform'] = 'extra info' # not in the form at all
|
||||||
return options
|
return options
|
||||||
|
|
||||||
|
c.Spawner.options_from_form = options_from_form
|
||||||
```
|
```
|
||||||
|
|
||||||
which would return:
|
which would return:
|
||||||
@@ -215,15 +228,115 @@ which would return:
|
|||||||
```python
|
```python
|
||||||
{
|
{
|
||||||
'integer': 5,
|
'integer': 5,
|
||||||
|
'checkbox': True,
|
||||||
'text': 'some text',
|
'text': 'some text',
|
||||||
'select': ['a', 'b'],
|
'select': ['a', 'b'],
|
||||||
'notinform': 'extra info',
|
'notinform': 'extra info',
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
When `Spawner.start` is called, this dictionary is accessible as `self.user_options`.
|
### Applying user options
|
||||||
|
|
||||||
[spawner]: https://github.com/jupyterhub/jupyterhub/blob/HEAD/jupyterhub/spawner.py
|
The base Spawner class doesn't do anything with `user_options`, that is also up to your deployment and/or chosen Spawner.
|
||||||
|
This is because the users can specify arbitrary option dictionary by using the API,
|
||||||
|
so it is part of your Spawner and/or deployment configuration to expose the options you trust your users to set.
|
||||||
|
|
||||||
|
[](#Spawner.apply_user_options) is the hook for taking `user_options` and applying whatever configuration it may represent.
|
||||||
|
It is critical that `apply_user_options` validates all input, since these are provided by the user.
|
||||||
|
|
||||||
|
```python
|
||||||
|
def apply_user_options(spawner, user_options):
|
||||||
|
if "image" in user_options and isinstance(user_options["image"], str):
|
||||||
|
spawner.image = user_options["image"]
|
||||||
|
|
||||||
|
c.Spawner.apply_user_options = apply_user_options
|
||||||
|
```
|
||||||
|
|
||||||
|
:::{versionadded} 5.3
|
||||||
|
JupyterHub 5.3 introduces [](#Spawner.apply_user_options) configuration.
|
||||||
|
Previously, [](#Spawner.user_options) could only be consumed during [](#Spawner.start),
|
||||||
|
at which point `user_options` is available to the Spawner instance as `self.user_options`.
|
||||||
|
This approach requires subclassing, so it was not possible to apply new `user_options` via configuration.
|
||||||
|
In JupyterHub 5.3, it is possible to fully expose user options,
|
||||||
|
and for some simple cases, fully with _declarative_ configuration.
|
||||||
|
:::
|
||||||
|
|
||||||
|
### Declarative configuration for user options
|
||||||
|
|
||||||
|
While [](#Spawner.options_from_form) and [](#Spawner.apply_user_options) are callables by nature,
|
||||||
|
some simple cases can be represented by declarative configuration,
|
||||||
|
which is most conveniently expressed in e.g. the yaml of the JupyterHub helm chart.
|
||||||
|
The cases currently handled are:
|
||||||
|
|
||||||
|
```python
|
||||||
|
c.Spawner.options_form = """
|
||||||
|
<input name="image_input" type="text" value="quay.io/jupyterhub/singleuser:5.2"/>
|
||||||
|
<input name="debug_checkbox" type="checkbox" />
|
||||||
|
"""
|
||||||
|
c.Spawner.options_from_form = "simple"
|
||||||
|
c.Spawner.apply_user_options = {"image_input": "image", "debug_checkbox": "debug"}
|
||||||
|
```
|
||||||
|
|
||||||
|
`options_from_form = "simple"` uses a built-in method to do the very simplest interpretation of an html form,
|
||||||
|
casting the lists of strings to single strings by getting the first item when there is only one.
|
||||||
|
The only extra processing it performs is casting the checkbox value of `on` to True.
|
||||||
|
|
||||||
|
So it turns this formdata:
|
||||||
|
|
||||||
|
```python
|
||||||
|
{
|
||||||
|
"image_input": ["my_image"],
|
||||||
|
"debug_checkbox": ["on"],
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
into this `user_options`
|
||||||
|
|
||||||
|
```python
|
||||||
|
{
|
||||||
|
"image_input": "my_image",
|
||||||
|
"debug_checkbox": True
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
When `apply_user_options` is a dictionary, any input in `user_options` is looked up in this dictionary,
|
||||||
|
and assigned to the corresponding Spawner attribute.
|
||||||
|
Strings are passed through traitlets' `from_string` logic (what is used for setting values on the command-line),
|
||||||
|
which means you can set numbers and things this way as well,
|
||||||
|
even though `options_from_form` leaves these as strings.
|
||||||
|
|
||||||
|
So in the above configuration, we have exposed `Spawner.debug` and `Spawner.image` without needing to write any functions.
|
||||||
|
In the JupyterHub helm chart YAML, this would look like:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
hub:
|
||||||
|
config:
|
||||||
|
KubeSpawner:
|
||||||
|
options_form: |
|
||||||
|
<input name="image_input" type="text" value="quay.io/jupyterhub/singleuser:5.2"/>
|
||||||
|
<input name="debug_checkbox" type="checkbox" />
|
||||||
|
options_from_form: simple
|
||||||
|
apply_user_options:
|
||||||
|
image_input: image
|
||||||
|
debug_checkbox: debug
|
||||||
|
```
|
||||||
|
|
||||||
|
### Setting `user_options` directly via the REST API
|
||||||
|
|
||||||
|
In addition to going through the options form, `user_options` may be set directly, via the REST API.
|
||||||
|
The body of a POST request to spawn a server may be a JSON dictionary,
|
||||||
|
which will be used to set `user_options` directly.
|
||||||
|
When used this way, neither `options_form` nor `options_from_form` are involved,
|
||||||
|
`user_options` is set directly, and only `apply_user_options` is called.
|
||||||
|
|
||||||
|
```
|
||||||
|
POST /hub/api/users/servers/:name
|
||||||
|
{
|
||||||
|
"option": 5,
|
||||||
|
"bool": True,
|
||||||
|
"string": "value"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Writing a custom spawner
|
## Writing a custom spawner
|
||||||
|
|
||||||
@@ -354,7 +467,7 @@ spawner, does not support limits and guarantees. One of the spawners
|
|||||||
that supports limits and guarantees is the
|
that supports limits and guarantees is the
|
||||||
[`systemdspawner`](https://github.com/jupyterhub/systemdspawner).
|
[`systemdspawner`](https://github.com/jupyterhub/systemdspawner).
|
||||||
|
|
||||||
### Memory Limits & Guarantees
|
### Memory Limits and Guarantees
|
||||||
|
|
||||||
`c.Spawner.mem_limit`: A **limit** specifies the _maximum amount of memory_
|
`c.Spawner.mem_limit`: A **limit** specifies the _maximum amount of memory_
|
||||||
that may be allocated, though there is no promise that the maximum amount will
|
that may be allocated, though there is no promise that the maximum amount will
|
||||||
@@ -374,7 +487,7 @@ available for the single-user notebook server to use. The environment variable
|
|||||||
limits and providing these guarantees.** If these values are set to `None`, no
|
limits and providing these guarantees.** If these values are set to `None`, no
|
||||||
limits or guarantees are provided, and no environment values are set.
|
limits or guarantees are provided, and no environment values are set.
|
||||||
|
|
||||||
### CPU Limits & Guarantees
|
### CPU Limits and Guarantees
|
||||||
|
|
||||||
`c.Spawner.cpu_limit`: In supported spawners, you can set
|
`c.Spawner.cpu_limit`: In supported spawners, you can set
|
||||||
`c.Spawner.cpu_limit` to limit the total number of cpu-cores that a
|
`c.Spawner.cpu_limit` to limit the total number of cpu-cores that a
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
This document describes how JupyterHub routes requests.
|
This document describes how JupyterHub routes requests.
|
||||||
|
|
||||||
This does not include the [REST API](using-jupyterhub-rest-api) URLs.
|
This does not include the [REST API](howto:rest-api) URLs.
|
||||||
|
|
||||||
In general, all URLs can be prefixed with `c.JupyterHub.base_url` to
|
In general, all URLs can be prefixed with `c.JupyterHub.base_url` to
|
||||||
run the whole JupyterHub application on a prefix.
|
run the whole JupyterHub application on a prefix.
|
||||||
@@ -169,27 +169,20 @@ _Version changed: 1.0_
|
|||||||
JupyterHub version 0.9 failed these API requests with status `404`,
|
JupyterHub version 0.9 failed these API requests with status `404`,
|
||||||
but version 1.0 uses 503.
|
but version 1.0 uses 503.
|
||||||
|
|
||||||
## `/user-redirect/...`
|
## `/hub/user-redirect/...`
|
||||||
|
|
||||||
The `/user-redirect/...` URL is for sharing a URL that will redirect a user
|
The `/hub/user-redirect/...` URL is for sharing a URL that will redirect a user
|
||||||
to a path on their own default server.
|
to a path on their own default server.
|
||||||
This is useful when different users have the same file at the same URL on their servers,
|
This is useful when different users have the same file at the same URL on their servers,
|
||||||
and you want a single link to give to any user that will open that file on their server.
|
and you want a single link to give to any user that will open that file on their server.
|
||||||
|
|
||||||
e.g. a link to `/user-redirect/notebooks/Index.ipynb`
|
e.g. a link to `/hub/user-redirect/notebooks/Index.ipynb`
|
||||||
will send user `hortense` to `/user/hortense/notebooks/Index.ipynb`
|
will send user `hortense` to `/user/hortense/notebooks/Index.ipynb`
|
||||||
|
|
||||||
**DO NOT** share links to your own server with other users.
|
**DO NOT** share links to your own server with other users.
|
||||||
This will not work in general,
|
This will not work in general,
|
||||||
unless you grant those users access to your server.
|
unless you grant those users access to your server.
|
||||||
|
|
||||||
**Contributions welcome:** The JupyterLab "shareable link" should share this link
|
|
||||||
when run with JupyterHub, but it does not.
|
|
||||||
See [jupyterlab-hub](https://github.com/jupyterhub/jupyterlab-hub)
|
|
||||||
where this should probably be done and
|
|
||||||
[this issue in JupyterLab](https://github.com/jupyterlab/jupyterlab/issues/5388)
|
|
||||||
that is intended to make it possible.
|
|
||||||
|
|
||||||
## Spawning
|
## Spawning
|
||||||
|
|
||||||
### `/hub/spawn[/:username[/:servername]]`
|
### `/hub/spawn[/:username[/:servername]]`
|
||||||
@@ -240,7 +233,7 @@ and the page will show a link back to `/hub/spawn/...`.
|
|||||||
|
|
||||||
On this page, users can manage their JupyterHub API tokens.
|
On this page, users can manage their JupyterHub API tokens.
|
||||||
They can revoke access and request new tokens for writing scripts
|
They can revoke access and request new tokens for writing scripts
|
||||||
against the [JupyterHub REST API](using-jupyterhub-rest-api).
|
against the [JupyterHub REST API](howto:rest-api).
|
||||||
|
|
||||||
## `/hub/admin`
|
## `/hub/admin`
|
||||||
|
|
||||||
|
@@ -78,7 +78,7 @@ c.JupyterHub.load_roles = []
|
|||||||
c.JupyterHub.load_groups = {
|
c.JupyterHub.load_groups = {
|
||||||
# collaborative accounts get added to this group
|
# collaborative accounts get added to this group
|
||||||
# so it's easy to see which accounts are collaboration accounts
|
# so it's easy to see which accounts are collaboration accounts
|
||||||
"collaborative": [],
|
"collaborative": {"users": []},
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -102,12 +102,12 @@ for project_name, project in project_config["projects"].items():
|
|||||||
members = project.get("members", [])
|
members = project.get("members", [])
|
||||||
print(f"Adding project {project_name} with members {members}")
|
print(f"Adding project {project_name} with members {members}")
|
||||||
# add them to a group for the project
|
# add them to a group for the project
|
||||||
c.JupyterHub.load_groups[project_name] = members
|
c.JupyterHub.load_groups[project_name] = {"users": members}
|
||||||
# define a new user for the collaboration
|
# define a new user for the collaboration
|
||||||
collab_user = f"{project_name}-collab"
|
collab_user = f"{project_name}-collab"
|
||||||
# add the collab user to the 'collaborative' group
|
# add the collab user to the 'collaborative' group
|
||||||
# so we can identify it as a collab account
|
# so we can identify it as a collab account
|
||||||
c.JupyterHub.load_groups["collaborative"].append(collab_user)
|
c.JupyterHub.load_groups["collaborative"]["users"].append(collab_user)
|
||||||
|
|
||||||
# finally, grant members of the project collaboration group
|
# finally, grant members of the project collaboration group
|
||||||
# access to the collab user's server,
|
# access to the collab user's server,
|
||||||
|
@@ -2,9 +2,15 @@
|
|||||||
|
|
||||||
# Authentication and User Basics
|
# Authentication and User Basics
|
||||||
|
|
||||||
The default Authenticator uses [PAM][] (Pluggable Authentication Module) to authenticate system users with
|
The default Authenticator uses [PAM][] (Pluggable Authentication Module) to authenticate users already defined on the system with their usernames and passwords.
|
||||||
their usernames and passwords. With the default Authenticator, any user
|
With the default Authenticator,
|
||||||
with an account and password on the system will be allowed to login.
|
any user with an account and password on the system will be able to login.
|
||||||
|
But that does not mean they will be **allowed** to access JupyterHub.
|
||||||
|
|
||||||
|
:::{important}
|
||||||
|
Only _explicitly allowed_ users can login to JupyterHub
|
||||||
|
(a user who can login but is not allowed will see a permission error after successful login).
|
||||||
|
:::
|
||||||
|
|
||||||
## Deciding who is allowed
|
## Deciding who is allowed
|
||||||
|
|
||||||
@@ -93,6 +99,25 @@ A set of initial admin users, `admin_users` can be configured as follows:
|
|||||||
c.Authenticator.admin_users = {'mal', 'zoe'}
|
c.Authenticator.admin_users = {'mal', 'zoe'}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
:::{warning}
|
||||||
|
`admin_users` config can only be used to _grant_ admin permissions.
|
||||||
|
Removing users from this set **does not** remove their admin permissions,
|
||||||
|
which must be done via the admin page or API.
|
||||||
|
|
||||||
|
Role assignments via `load_roles` are the only way to _revoke_ past permissions from configuration:
|
||||||
|
|
||||||
|
```python
|
||||||
|
c.JupyterHub.load_roles = [
|
||||||
|
{
|
||||||
|
"name": "admin",
|
||||||
|
"users": ["admin1", "..."],
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
or, better yet, [specify your own roles](define-role-target) with only the permissions your admins actually need.
|
||||||
|
:::
|
||||||
|
|
||||||
Users in the admin set are automatically added to the user `allowed_users` set,
|
Users in the admin set are automatically added to the user `allowed_users` set,
|
||||||
if they are not already present.
|
if they are not already present.
|
||||||
|
|
||||||
|
@@ -99,4 +99,4 @@ maintenance, re-configuration, etc.), then user connections are not
|
|||||||
interrupted. For simplicity, by default the hub starts the proxy
|
interrupted. For simplicity, by default the hub starts the proxy
|
||||||
automatically, so if the hub restarts, the proxy restarts, and user
|
automatically, so if the hub restarts, the proxy restarts, and user
|
||||||
connections are interrupted. It is easy to run the proxy separately,
|
connections are interrupted. It is easy to run the proxy separately,
|
||||||
for information see [the separate proxy page](separate-proxy).
|
for information see [the separate proxy page](howto:separate-proxy).
|
||||||
|
@@ -43,7 +43,7 @@ is important that these files be put in a secure location on your server, where
|
|||||||
they are not readable by regular users.
|
they are not readable by regular users.
|
||||||
|
|
||||||
If you are using a **chain certificate**, see also chained certificate for SSL
|
If you are using a **chain certificate**, see also chained certificate for SSL
|
||||||
in the JupyterHub [Troubleshooting FAQ](troubleshooting).
|
in the JupyterHub [Troubleshooting FAQ](faq:troubleshooting).
|
||||||
|
|
||||||
### Using letsencrypt
|
### Using letsencrypt
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ c.JupyterHub.ssl_cert = '/etc/letsencrypt/live/example.com/fullchain.pem'
|
|||||||
### If SSL termination happens outside of the Hub
|
### If SSL termination happens outside of the Hub
|
||||||
|
|
||||||
In certain cases, for example, if the hub is running behind a reverse proxy, and
|
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/),
|
[SSL termination is being provided by NGINX](https://docs.nginx.com/nginx/admin-guide/security-controls/terminating-ssl-http/),
|
||||||
it is reasonable to run the hub without SSL.
|
it is reasonable to run the hub without SSL.
|
||||||
|
|
||||||
To achieve this, remove `c.JupyterHub.ssl_key` and `c.JupyterHub.ssl_cert`
|
To achieve this, remove `c.JupyterHub.ssl_key` and `c.JupyterHub.ssl_cert`
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
(tutorial:services)=
|
||||||
|
|
||||||
# External services
|
# External services
|
||||||
|
|
||||||
When working with JupyterHub, a **Service** is defined as a process
|
When working with JupyterHub, a **Service** is defined as a process
|
||||||
|
@@ -46,7 +46,7 @@ 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
|
(as in MUST) **secure it with ssl** by adding ssl options to your docker
|
||||||
configuration or using an ssl enabled proxy.
|
configuration or using an ssl enabled proxy.
|
||||||
|
|
||||||
[Mounting volumes](https://docs.docker.com/engine/admin/volumes/volumes/)
|
[Mounting volumes](https://docs.docker.com/engine/storage/volumes/)
|
||||||
enables you to persist and store the data generated by the docker container, even when you stop the container.
|
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.
|
The persistent data can be stored on the host system, outside the container.
|
||||||
|
|
||||||
|
@@ -11,7 +11,6 @@ Before installing JupyterHub, you will need:
|
|||||||
installing Python packages is helpful.
|
installing Python packages is helpful.
|
||||||
- [Node.js {{node_min}}](https://www.npmjs.com/) or greater, along with npm. [Install Node.js/npm](https://docs.npmjs.com/getting-started/installing-node),
|
- [Node.js {{node_min}}](https://www.npmjs.com/) or greater, along with npm. [Install Node.js/npm](https://docs.npmjs.com/getting-started/installing-node),
|
||||||
using your operating system's package manager.
|
using your operating system's package manager.
|
||||||
|
|
||||||
- If you are using **`conda`**, the nodejs and npm dependencies will be installed for
|
- If you are using **`conda`**, the nodejs and npm dependencies will be installed for
|
||||||
you by conda.
|
you by conda.
|
||||||
|
|
||||||
@@ -72,6 +71,35 @@ jupyterhub -h
|
|||||||
configurable-http-proxy -h
|
configurable-http-proxy -h
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
At this point, we could start jupyterhub, but nobody would be able to use it!
|
||||||
|
Only users who are explicitly **allowed** can use JupyterHub.
|
||||||
|
To allow users, we need to create a configuration file.
|
||||||
|
JupyterHub uses a configuration file called `jupyterhub_config.py`,
|
||||||
|
which is a regular Python script with one function `get_config()` pre-defined, returning the "config object".
|
||||||
|
Assigning attributes to this object is how we configure JupyterHub.
|
||||||
|
|
||||||
|
At this point, we have two choices:
|
||||||
|
|
||||||
|
1. allow any user who can successfully login with our Authenticator (often a good choice for local machines with PAM)
|
||||||
|
2. allow one or more users by name.
|
||||||
|
|
||||||
|
We'll start with the first one.
|
||||||
|
Create the file `jupyerhub_config.py` with the content:
|
||||||
|
|
||||||
|
```python
|
||||||
|
c = get_config() # noqa
|
||||||
|
c.Authenticator.allow_all = True
|
||||||
|
# alternative: c.Authenticator.allowed_users = {"yourusername"}
|
||||||
|
```
|
||||||
|
|
||||||
|
This configuration means that anyone who can login with PAM (any existing user on the system) should have access to JupyterHub.
|
||||||
|
|
||||||
|
:::{seealso}
|
||||||
|
[](authenticators)
|
||||||
|
:::
|
||||||
|
|
||||||
## Start the Hub server
|
## Start the Hub server
|
||||||
|
|
||||||
To start the Hub server, run the command:
|
To start the Hub server, run the command:
|
||||||
@@ -90,6 +118,6 @@ To **allow multiple users to sign in** to the Hub server, you must start
|
|||||||
sudo jupyterhub
|
sudo jupyterhub
|
||||||
```
|
```
|
||||||
|
|
||||||
The [wiki](https://github.com/jupyterhub/jupyterhub/wiki/Using-sudo-to-run-JupyterHub-without-root-privileges)
|
[](howto:config:no-sudo)
|
||||||
describes how to run the server as a _less privileged user_. This requires
|
describes how to run the server as a _less privileged user_. This requires
|
||||||
additional configuration of the system.
|
additional configuration of the system.
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
# Starting servers with the JupyterHub API
|
# Starting servers with the JupyterHub API
|
||||||
|
|
||||||
Sometimes, when working with applications such as [BinderHub](https://binderhub.readthedocs.io), it may be necessary to launch Jupyter-based services on behalf of your users.
|
Sometimes, when working with applications such as [BinderHub](https://binderhub.readthedocs.io), it may be necessary to launch Jupyter-based services on behalf of your users.
|
||||||
Doing so can be achieved through JupyterHub's [REST API](using-jupyterhub-rest-api), which allows one to launch and manage servers on behalf of users through API calls instead of the JupyterHub UI.
|
Doing so can be achieved through JupyterHub's [REST API](howto:rest-api), which allows one to launch and manage servers on behalf of users through API calls instead of the JupyterHub UI.
|
||||||
This way, you can take advantage of other user/launch/lifecycle patterns that are not natively supported by the JupyterHub UI, all without the need to develop the server management features of JupyterHub Spawners and/or Authenticators.
|
This way, you can take advantage of other user/launch/lifecycle patterns that are not natively supported by the JupyterHub UI, all without the need to develop the server management features of JupyterHub Spawners and/or Authenticators.
|
||||||
|
|
||||||
This tutorial goes through working with the JupyterHub API to manage servers for users.
|
This tutorial goes through working with the JupyterHub API to manage servers for users.
|
||||||
|
@@ -51,25 +51,31 @@ Any shared permissions previously granted by a user will remain and must be revo
|
|||||||
if desired.
|
if desired.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
### Grant servers permission to share themselves (optional, admin)
|
### Grant servers permission to share themselves (admin)
|
||||||
|
|
||||||
The most natural place to want to grant access to a server is when viewing that server.
|
When you want users to be able to share access while viewing a server, grant the appropriate
|
||||||
By default, the tokens used when talking to a server have extremely limited permissions.
|
sharing scopes so the server or the browser token can manage sharing. By default, tokens used
|
||||||
You can grant sharing permissions to servers themselves in one of two ways.
|
to talk to a server have limited permissions.
|
||||||
|
|
||||||
The first is to grant sharing permission to the tokens used by browser requests.
|
Granting browser-originating tokens the sharing scopes is the recommended approach when using
|
||||||
This is what you would do if you had a JupyterLab extension that presented UI for managing shares
|
JupyterLab with the `jupyter-collaboration` extension, which provides a UI for managing shares.
|
||||||
(this should exist! We haven't made it yet).
|
The minimal permissions required to allow browser tokens to request sharing-related scopes are:
|
||||||
To grant these tokens sharing permissions:
|
|
||||||
|
|
||||||
```python
|
```python
|
||||||
c.Spawner.oauth_client_allowed_scopes = ["access:servers!server", "shares!server"]
|
c.Spawner.oauth_client_allowed_scopes = ["access:servers!server", "shares!server"]
|
||||||
```
|
```
|
||||||
|
|
||||||
JupyterHub's `user-sharing` example does it this way.
|
JupyterHub's `user-sharing` example does it this way.
|
||||||
|
The `jupyter-collaboration` UI requires additional Hub scopes to share their server with specific users on the Hub:
|
||||||
|
|
||||||
|
```python
|
||||||
|
c.Spawner.oauth_client_allowed_scopes = [
|
||||||
|
"read:users:name", "shares!user", "list:users", "servers!user"
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
The nice thing about this approach is that only users who already have those permissions will get a token which can take these actions.
|
The nice thing about this approach is that only users who already have those permissions will get a token which can take these actions.
|
||||||
The downside (in terms of convenience) is that the browser token is only accessible to the javascript (e.g. JupyterLab) and/or jupyter-server request handlers,
|
The downside is that the browser token is only accessible to the javascript (e.g. JupyterLab) and/or jupyter-server request handlers, but not notebooks or terminals.
|
||||||
but not notebooks or terminals.
|
|
||||||
|
|
||||||
The second way, which is less secure, but perhaps more convenient for demonstration purposes,
|
The second way, which is less secure, but perhaps more convenient for demonstration purposes,
|
||||||
is to grant the _server itself_ permission to grant access to itself.
|
is to grant the _server itself_ permission to grant access to itself.
|
||||||
@@ -159,11 +165,14 @@ which will have a JSON response:
|
|||||||
'last_exchanged_at': None,
|
'last_exchanged_at': None,
|
||||||
'code': 'U-eYLFT1lGstEqfMHpAIvTZ1MRjZ1Y1a-loGQ0K86to',
|
'code': 'U-eYLFT1lGstEqfMHpAIvTZ1MRjZ1Y1a-loGQ0K86to',
|
||||||
'accept_url': '/hub/accept-share?code=U-eYLFT1lGstEqfMHpAIvTZ1MRjZ1Y1a-loGQ0K86to',
|
'accept_url': '/hub/accept-share?code=U-eYLFT1lGstEqfMHpAIvTZ1MRjZ1Y1a-loGQ0K86to',
|
||||||
|
'full_accept_url': 'https://hub.example.org/accept-share?code=U-eYLFT1lGstEqfMHpAIvTZ1MRjZ1Y1a-loGQ0K86to',
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The most relevant fields here are `code`, which contains the code itself, and `accept_url`, which is the URL path for the page another user.
|
The most relevant fields here are `code`, which contains the code itself, and `accept_url`, which is the URL path for the page another user.
|
||||||
Note: it does not contain the _hostname_ of the hub, which JupyterHub often does not know.
|
Note: it does not contain the _hostname_ of the hub, which JupyterHub often does not know.
|
||||||
|
If `public_url` configuration is defined, `full_accept_url` will be the full URL including the host.
|
||||||
|
Otherwise, it will be null.
|
||||||
|
|
||||||
Share codes are guaranteed to be url-safe, so no encoding is required.
|
Share codes are guaranteed to be url-safe, so no encoding is required.
|
||||||
|
|
||||||
|
51
examples/forced-login/README.md
Normal file
51
examples/forced-login/README.md
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
# Forced login example
|
||||||
|
|
||||||
|
Example for forcing user login via URL without disabling token-in-url protection.
|
||||||
|
|
||||||
|
An external application issues tokens associated with usernames.
|
||||||
|
A JupyterHub Authenticator only allows login via these tokens in a URL parameter (`/hub/login?login_token=....`),
|
||||||
|
which are then exchanged for a username, which is used to login the user.
|
||||||
|
|
||||||
|
Each token can be used for login only once, and must be used within 30 seconds of issue.
|
||||||
|
|
||||||
|
To run:
|
||||||
|
|
||||||
|
in one shell:
|
||||||
|
|
||||||
|
```
|
||||||
|
python3 external_app.py
|
||||||
|
```
|
||||||
|
|
||||||
|
in another:
|
||||||
|
|
||||||
|
```
|
||||||
|
jupyterhub
|
||||||
|
```
|
||||||
|
|
||||||
|
Then visit http://127.0.0.1:9000
|
||||||
|
|
||||||
|
Sometimes, JupyterHub is integrated into an existing application,
|
||||||
|
which has already handled login, etc.
|
||||||
|
It is often preferable in these applications to be able to link users to their running JupyterHub server without _prompting_ the user for login to the Hub when the Hub should really be an implementation detail.
|
||||||
|
|
||||||
|
One way to do this has been to use "API only mode", issue tokens for users, and redirect users to a URL like `/users/name/?token=abc123`.
|
||||||
|
This is [disabled by default]() in JupyterHub 5, because it presents a vulnerability for users to craft links that let _other_ users login as them, which can lead to inter-user attacks.
|
||||||
|
|
||||||
|
But that leaves the question: how do I as an _application developer_ generate a link that can login a user?
|
||||||
|
|
||||||
|
_Ideally_, the best way to set this up is with the external service as an OAuth provider,
|
||||||
|
though in some cases it works best to use proxy-based authentication like Shibboleth / [REMOTE_USER]().
|
||||||
|
|
||||||
|
If your service is an OAuth provider, sharing links to `/hub/user-redirect/lab/tree/path/to/notebook...` should work just fine.
|
||||||
|
JupyterHub will:
|
||||||
|
|
||||||
|
1. authenticate the user
|
||||||
|
2. redirect to your identity provider via oauth (you can set `Authenticator.auto_login = True` if you want to skip prompting the user)
|
||||||
|
3. complete oauth
|
||||||
|
4. start their single-user server if it's not running (show the launch progress page while it's waiting)
|
||||||
|
5. redirect to their server once it's up
|
||||||
|
6. oauth (again), this time between the single-user server and the Hub
|
||||||
|
|
||||||
|
If your application chooses to launch the server and wait for it to be ready before redirecting
|
||||||
|
|
||||||
|
[API only mode]() is sometimes useful
|
100
examples/forced-login/external_app.py
Normal file
100
examples/forced-login/external_app.py
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
"""An external app for laucnhing JupyuterHub with specified usernames
|
||||||
|
|
||||||
|
This one serves a form with a single username input field
|
||||||
|
|
||||||
|
After entering the username, generate a token and redirect to hub login with that token,
|
||||||
|
which is then exchanged for a username.
|
||||||
|
|
||||||
|
Users cannot login to JupyterHub directly, only via this app.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import hashlib
|
||||||
|
import logging
|
||||||
|
import os
|
||||||
|
import secrets
|
||||||
|
import time
|
||||||
|
from pathlib import Path
|
||||||
|
from typing import Annotated
|
||||||
|
|
||||||
|
from fastapi import Body, FastAPI, Form, status
|
||||||
|
from fastapi.responses import HTMLResponse, JSONResponse, RedirectResponse
|
||||||
|
from yarl import URL
|
||||||
|
|
||||||
|
from jupyterhub.utils import url_path_join
|
||||||
|
|
||||||
|
app_dir = Path(__file__).parent.resolve()
|
||||||
|
index_html = app_dir / "index.html"
|
||||||
|
app = FastAPI()
|
||||||
|
|
||||||
|
log = logging.getLogger("uvicorn.error")
|
||||||
|
|
||||||
|
_tokens_to_username = {}
|
||||||
|
|
||||||
|
jupyterhub_url = URL(os.environ.get("JUPYTERHUB_URL", "http://127.0.0.1:8000/"))
|
||||||
|
|
||||||
|
# how many seconds do they have to complete the exchange before the token expires?
|
||||||
|
token_lifetime = 30
|
||||||
|
|
||||||
|
|
||||||
|
def _hash(token):
|
||||||
|
"""Hash a token for storage"""
|
||||||
|
return hashlib.sha256(token.encode("utf8", "replace")).hexdigest()
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/")
|
||||||
|
async def get():
|
||||||
|
with index_html.open() as f:
|
||||||
|
return HTMLResponse(f.read())
|
||||||
|
|
||||||
|
|
||||||
|
@app.post("/")
|
||||||
|
async def launch(username: Annotated[str, Form()], path: Annotated[str, Form()]):
|
||||||
|
"""Begin login
|
||||||
|
|
||||||
|
1. issue token for login
|
||||||
|
2. associate token with username
|
||||||
|
3. redirect to /hub/login?login_token=...
|
||||||
|
"""
|
||||||
|
token = secrets.token_urlsafe(32)
|
||||||
|
hashed_token = _hash(token)
|
||||||
|
log.info(f"Creating token for {username}, redirecting to {path}")
|
||||||
|
_tokens_to_username[hashed_token] = (username, time.monotonic() + token_lifetime)
|
||||||
|
login_url = (jupyterhub_url / "hub/login").extend_query(
|
||||||
|
login_token=token, next=url_path_join("/hub/user-redirect", path)
|
||||||
|
)
|
||||||
|
log.info(login_url)
|
||||||
|
|
||||||
|
return RedirectResponse(login_url, status_code=status.HTTP_303_SEE_OTHER)
|
||||||
|
|
||||||
|
|
||||||
|
@app.post("/login", response_class=JSONResponse)
|
||||||
|
async def login(token: Annotated[str, Body(embed=True)]):
|
||||||
|
"""
|
||||||
|
Callback to exchange a token for a username
|
||||||
|
|
||||||
|
token is consumed, can only be used once
|
||||||
|
"""
|
||||||
|
now = time.monotonic()
|
||||||
|
hashed_token = _hash(token)
|
||||||
|
if hashed_token not in _tokens_to_username:
|
||||||
|
return JSONResponse(
|
||||||
|
status_code=status.HTTP_404_NOT_FOUND, content={"message": "invalid token"}
|
||||||
|
)
|
||||||
|
username, expires_at = _tokens_to_username.pop(hashed_token)
|
||||||
|
if expires_at < now:
|
||||||
|
return JSONResponse(
|
||||||
|
status_code=status.HTTP_400_BAD_REQUEST,
|
||||||
|
content={"message": "token expired"},
|
||||||
|
)
|
||||||
|
return {"name": username}
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
"""Launches the application on port 5000 with uvicorn"""
|
||||||
|
import uvicorn
|
||||||
|
|
||||||
|
uvicorn.run(app, port=9000)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
22
examples/forced-login/index.html
Normal file
22
examples/forced-login/index.html
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>External Service Login</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Login to JupyterHub</h1>
|
||||||
|
<form action="" method="POST">
|
||||||
|
<label for="username">
|
||||||
|
Username:
|
||||||
|
<input type="text" name="username" autocomplete="off" />
|
||||||
|
</label>
|
||||||
|
<br />
|
||||||
|
<label for="path">
|
||||||
|
Redirect path:
|
||||||
|
<input type="text" name="path" autocomplete="off" value="/lab" />
|
||||||
|
</label>
|
||||||
|
<br />
|
||||||
|
<button>Login</button>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
65
examples/forced-login/jupyterhub_config.py
Normal file
65
examples/forced-login/jupyterhub_config.py
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
import json
|
||||||
|
|
||||||
|
from tornado import web
|
||||||
|
from tornado.httpclient import AsyncHTTPClient, HTTPClientError
|
||||||
|
from traitlets import Unicode
|
||||||
|
|
||||||
|
from jupyterhub.auth import Authenticator
|
||||||
|
from jupyterhub.utils import url_path_join
|
||||||
|
|
||||||
|
|
||||||
|
class ForcedLoginAuthenticator(Authenticator):
|
||||||
|
"""Authenticator to force login with a token provided by an external service
|
||||||
|
|
||||||
|
The external service issues tokens, which are exchanged for a username.
|
||||||
|
Visiting `/hub/login?login_token=...` logs in a user
|
||||||
|
Each token can be used only once.
|
||||||
|
"""
|
||||||
|
|
||||||
|
auto_login = True # begin login without prompt (token is in url)
|
||||||
|
allow_all = True # external login app controls this
|
||||||
|
token_provider_url = Unicode(
|
||||||
|
config=True, help="""The URL of the token/username provider"""
|
||||||
|
)
|
||||||
|
|
||||||
|
async def authenticate(self, handler, data):
|
||||||
|
token = handler.get_argument("login_token", None)
|
||||||
|
if not token:
|
||||||
|
raise web.HTTPError(
|
||||||
|
400, f"Login with external provider at {self.token_provider_url}"
|
||||||
|
)
|
||||||
|
client = AsyncHTTPClient()
|
||||||
|
try:
|
||||||
|
response = await client.fetch(
|
||||||
|
url_path_join(self.token_provider_url, "/login"),
|
||||||
|
method="POST",
|
||||||
|
headers={"Content-Type": "application/json"},
|
||||||
|
body=json.dumps({"token": token}),
|
||||||
|
)
|
||||||
|
except HTTPClientError as e:
|
||||||
|
self.log.info(
|
||||||
|
"Error exchanging token for username: %s",
|
||||||
|
e.response.body.decode("utf8", "replace"),
|
||||||
|
)
|
||||||
|
if e.code == 404:
|
||||||
|
raise web.HTTPError(
|
||||||
|
403,
|
||||||
|
f"Invalid token. Login with external provider at {self.token_provider_url}",
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
raise
|
||||||
|
# pass through the response
|
||||||
|
return json.loads(response.body.decode())
|
||||||
|
|
||||||
|
|
||||||
|
c = get_config() # noqa
|
||||||
|
|
||||||
|
# use our Authenticator
|
||||||
|
c.JupyterHub.authenticator_class = ForcedLoginAuthenticator
|
||||||
|
# tell it where the external launch app is
|
||||||
|
c.ForcedLoginAuthenticator.token_provider_url = "http://127.0.0.1:9000/"
|
||||||
|
|
||||||
|
|
||||||
|
# local testing config (fake spawner, localhost only)
|
||||||
|
c.JupyterHub.ip = "127.0.0.1"
|
||||||
|
c.JupyterHub.spawner_class = "simple"
|
3
examples/forced-login/requirements.txt
Normal file
3
examples/forced-login/requirements.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fastapi
|
||||||
|
jupyterhub
|
||||||
|
yarl
|
@@ -60,7 +60,7 @@ sudo docker build . -t service-fastapi
|
|||||||
sudo docker run -it -p 8000:8000 service-fastapi
|
sudo docker run -it -p 8000:8000 service-fastapi
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Visit http://127.0.0.1:8000/services/fastapi/docs. When going through the OAuth flow or getting a token from the control panel, you can log in with `testuser` / `passwd`.
|
2. Visit http://127.0.0.1:8000/services/fastapi/docs. When going through the OAuth flow or getting a token from the control panel, you can log in with 'test-user' and any password.
|
||||||
|
|
||||||
# PUBLIC_HOST
|
# PUBLIC_HOST
|
||||||
|
|
||||||
|
@@ -1,44 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": ["plugin:react/recommended"],
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaVersion": 2018,
|
|
||||||
"sourceType": "module",
|
|
||||||
"ecmaFeatures": {
|
|
||||||
"jsx": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"settings": {
|
|
||||||
"react": {
|
|
||||||
"version": "detect"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"plugins": ["eslint-plugin-react", "prettier", "unused-imports"],
|
|
||||||
"env": {
|
|
||||||
"es6": true,
|
|
||||||
"browser": true
|
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"semi": "off",
|
|
||||||
"quotes": "off",
|
|
||||||
"prettier/prettier": "warn",
|
|
||||||
"no-unused-vars": "off",
|
|
||||||
"unused-imports/no-unused-imports": "error",
|
|
||||||
"unused-imports/no-unused-vars": [
|
|
||||||
"warn",
|
|
||||||
{
|
|
||||||
"vars": "all",
|
|
||||||
"varsIgnorePattern": "^regeneratorRuntime|^_",
|
|
||||||
"args": "after-used",
|
|
||||||
"argsIgnorePattern": "^_"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"overrides": [
|
|
||||||
{
|
|
||||||
"files": ["**/*.test.js", "**/*.test.jsx"],
|
|
||||||
"env": {
|
|
||||||
"jest": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
77
jsx/eslint.config.mjs
Normal file
77
jsx/eslint.config.mjs
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
import { defineConfig } from "eslint/config";
|
||||||
|
import react from "eslint-plugin-react";
|
||||||
|
import prettier from "eslint-plugin-prettier";
|
||||||
|
import unusedImports from "eslint-plugin-unused-imports";
|
||||||
|
import globals from "globals";
|
||||||
|
import path from "node:path";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
import js from "@eslint/js";
|
||||||
|
import { FlatCompat } from "@eslint/eslintrc";
|
||||||
|
|
||||||
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
|
const __dirname = path.dirname(__filename);
|
||||||
|
const compat = new FlatCompat({
|
||||||
|
baseDirectory: __dirname,
|
||||||
|
recommendedConfig: js.configs.recommended,
|
||||||
|
allConfig: js.configs.all,
|
||||||
|
});
|
||||||
|
|
||||||
|
export default defineConfig([
|
||||||
|
{
|
||||||
|
extends: compat.extends("plugin:react/recommended"),
|
||||||
|
|
||||||
|
plugins: {
|
||||||
|
react,
|
||||||
|
prettier,
|
||||||
|
"unused-imports": unusedImports,
|
||||||
|
},
|
||||||
|
|
||||||
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
...globals.browser,
|
||||||
|
},
|
||||||
|
|
||||||
|
ecmaVersion: 2018,
|
||||||
|
sourceType: "module",
|
||||||
|
|
||||||
|
parserOptions: {
|
||||||
|
ecmaFeatures: {
|
||||||
|
jsx: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
settings: {
|
||||||
|
react: {
|
||||||
|
version: "detect",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
rules: {
|
||||||
|
semi: "off",
|
||||||
|
quotes: "off",
|
||||||
|
"prettier/prettier": "warn",
|
||||||
|
"no-unused-vars": "off",
|
||||||
|
"unused-imports/no-unused-imports": "error",
|
||||||
|
|
||||||
|
"unused-imports/no-unused-vars": [
|
||||||
|
"warn",
|
||||||
|
{
|
||||||
|
vars: "all",
|
||||||
|
varsIgnorePattern: "^regeneratorRuntime|^_",
|
||||||
|
args: "after-used",
|
||||||
|
argsIgnorePattern: "^_",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ["**/*.test.js", "**/*.test.jsx"],
|
||||||
|
|
||||||
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
...globals.jest,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]);
|
10268
jsx/package-lock.json
generated
10268
jsx/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -22,51 +22,58 @@
|
|||||||
"plugins": []
|
"plugins": []
|
||||||
},
|
},
|
||||||
"jest": {
|
"jest": {
|
||||||
|
"fakeTimers": {
|
||||||
|
"enableGlobally": true
|
||||||
|
},
|
||||||
"moduleNameMapper": {
|
"moduleNameMapper": {
|
||||||
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
|
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
|
||||||
"\\.(css|less)$": "identity-obj-proxy"
|
"\\.(css|less)$": "identity-obj-proxy"
|
||||||
},
|
},
|
||||||
|
"setupFiles": [
|
||||||
|
"./testing/setup.jest.js"
|
||||||
|
],
|
||||||
"testEnvironment": "jsdom"
|
"testEnvironment": "jsdom"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bootstrap": "^5.2.3",
|
"bootstrap": "^5.3.8",
|
||||||
"history": "^5.3.0",
|
"history": "^5.3.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"prop-types": "^15.8.1",
|
"prop-types": "^15.8.1",
|
||||||
"react": "^17.0.2",
|
"react": "^19.1.1",
|
||||||
"react-bootstrap": "^2.10.1",
|
"react-bootstrap": "^2.10.10",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^19.1.1",
|
||||||
"react-icons": "^4.8.0",
|
"react-icons": "^5.5.0",
|
||||||
"react-multi-select-component": "^4.3.4",
|
"react-redux": "^9.2.0",
|
||||||
"react-redux": "^7.2.8",
|
"react-router": "^7.9.3",
|
||||||
"react-router-dom": "^6.22.2",
|
"redux": "^5.0.1",
|
||||||
"recompose": "npm:react-recompose@^0.33.0",
|
"regenerator-runtime": "^0.14.1"
|
||||||
"redux": "^4.2.1",
|
|
||||||
"regenerator-runtime": "^0.13.11"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.21.4",
|
"@babel/core": "^7.28.3",
|
||||||
"@babel/preset-env": "^7.21.4",
|
"@babel/preset-env": "^7.28.3",
|
||||||
"@babel/preset-react": "^7.18.6",
|
"@babel/preset-react": "^7.27.1",
|
||||||
"@testing-library/jest-dom": "^5.16.5",
|
"@eslint/eslintrc": "^3.3.1",
|
||||||
"@testing-library/react": "^12.1.5",
|
"@eslint/js": "^9.36.0",
|
||||||
"@testing-library/user-event": "^13.5.0",
|
"@testing-library/jest-dom": "^6.8.0",
|
||||||
"@webpack-cli/serve": "^2.0.1",
|
"@testing-library/react": "^16.3.0",
|
||||||
"babel-jest": "^29.5.0",
|
"@testing-library/user-event": "^14.6.1",
|
||||||
"babel-loader": "^9.1.2",
|
"@webpack-cli/serve": "^3.0.1",
|
||||||
"css-loader": "^6.7.3",
|
"babel-jest": "^30.2.0",
|
||||||
"eslint": "^8.38.0",
|
"babel-loader": "^10.0.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"css-loader": "^7.1.2",
|
||||||
"eslint-plugin-react": "^7.32.2",
|
"eslint": "^9.36.0",
|
||||||
"eslint-plugin-unused-imports": "^2.0.0",
|
"eslint-plugin-prettier": "^5.5.4",
|
||||||
|
"eslint-plugin-react": "^7.37.5",
|
||||||
|
"eslint-plugin-unused-imports": "^4.2.0",
|
||||||
"file-loader": "^6.2.0",
|
"file-loader": "^6.2.0",
|
||||||
|
"globals": "^16.4.0",
|
||||||
"identity-obj-proxy": "^3.0.0",
|
"identity-obj-proxy": "^3.0.0",
|
||||||
"jest": "^29.5.0",
|
"jest": "^30.1.2",
|
||||||
"jest-environment-jsdom": "^29.5.0",
|
"jest-environment-jsdom": "^30.2.0",
|
||||||
"prettier": "^2.8.7",
|
"prettier": "^3.6.2",
|
||||||
"style-loader": "^3.3.2",
|
"style-loader": "^4.0.0",
|
||||||
"webpack": "^5.79.0",
|
"webpack": "^5.102.0",
|
||||||
"webpack-cli": "^5.0.1",
|
"webpack-cli": "^6.0.1",
|
||||||
"webpack-dev-server": "^4.13.3"
|
"webpack-dev-server": "^5.2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,11 +1,11 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import ReactDOM from "react-dom";
|
import { createRoot } from "react-dom/client";
|
||||||
import { Provider } from "react-redux";
|
import { Provider } from "react-redux";
|
||||||
import { createStore } from "redux";
|
import { createStore } from "redux";
|
||||||
import { compose } from "recompose";
|
import { compose } from "./util/_recompose";
|
||||||
import { initialState, reducers } from "./Store";
|
import { initialState, reducers } from "./Store";
|
||||||
import withAPI from "./util/withAPI";
|
import withAPI from "./util/withAPI";
|
||||||
import { HashRouter, Routes, Route } from "react-router-dom";
|
import { HashRouter, Routes, Route } from "react-router";
|
||||||
|
|
||||||
import ServerDashboard from "./components/ServerDashboard/ServerDashboard";
|
import ServerDashboard from "./components/ServerDashboard/ServerDashboard";
|
||||||
import Groups from "./components/Groups/Groups";
|
import Groups from "./components/Groups/Groups";
|
||||||
@@ -40,4 +40,5 @@ const App = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
ReactDOM.render(<App />, document.getElementById("react-admin-hook"));
|
const root = createRoot(document.getElementById("react-admin-hook"));
|
||||||
|
root.render(<App />);
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { Link, useNavigate } from "react-router-dom";
|
import { Link, useNavigate } from "react-router";
|
||||||
import { Button, Col } from "react-bootstrap";
|
import { Button, Col } from "react-bootstrap";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import ErrorAlert from "../../util/error";
|
import ErrorAlert from "../../util/error";
|
||||||
|
@@ -1,11 +1,9 @@
|
|||||||
import React from "react";
|
import React, { act } from "react";
|
||||||
import "@testing-library/jest-dom";
|
import "@testing-library/jest-dom";
|
||||||
import { act } from "react-dom/test-utils";
|
|
||||||
import { render, screen, fireEvent } from "@testing-library/react";
|
import { render, screen, fireEvent } from "@testing-library/react";
|
||||||
import userEvent from "@testing-library/user-event";
|
|
||||||
import { Provider, useDispatch, useSelector } from "react-redux";
|
import { Provider, useDispatch, useSelector } from "react-redux";
|
||||||
import { createStore } from "redux";
|
import { createStore } from "redux";
|
||||||
import { HashRouter } from "react-router-dom";
|
import { HashRouter } from "react-router";
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
import regeneratorRuntime from "regenerator-runtime";
|
import regeneratorRuntime from "regenerator-runtime";
|
||||||
|
|
||||||
@@ -46,6 +44,7 @@ beforeEach(() => {
|
|||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
useDispatch.mockClear();
|
useDispatch.mockClear();
|
||||||
|
jest.runAllTimers();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Renders", async () => {
|
test("Renders", async () => {
|
||||||
@@ -67,7 +66,7 @@ test("Removes users when they fail Regex", async () => {
|
|||||||
|
|
||||||
fireEvent.blur(textarea, { target: { value: "foo \n bar\na@b.co\n \n\n" } });
|
fireEvent.blur(textarea, { target: { value: "foo \n bar\na@b.co\n \n\n" } });
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
fireEvent.click(submit);
|
await fireEvent.click(submit);
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(callbackSpy).toHaveBeenCalledWith(["foo", "bar", "a@b.co"], false);
|
expect(callbackSpy).toHaveBeenCalledWith(["foo", "bar", "a@b.co"], false);
|
||||||
@@ -79,15 +78,15 @@ test("Correctly submits admin", async () => {
|
|||||||
await act(async () => {
|
await act(async () => {
|
||||||
render(addUserJsx(callbackSpy));
|
render(addUserJsx(callbackSpy));
|
||||||
});
|
});
|
||||||
|
|
||||||
let textarea = screen.getByTestId("user-textarea");
|
let textarea = screen.getByTestId("user-textarea");
|
||||||
let submit = screen.getByTestId("submit");
|
let submit = screen.getByTestId("submit");
|
||||||
let check = screen.getByTestId("check");
|
let check = screen.getByTestId("check");
|
||||||
|
|
||||||
userEvent.click(check);
|
await fireEvent.blur(textarea, { target: { value: "foo" } });
|
||||||
fireEvent.blur(textarea, { target: { value: "foo" } });
|
await fireEvent.click(check);
|
||||||
|
await fireEvent.click(submit);
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
fireEvent.click(submit);
|
await jest.runAllTimers();
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(callbackSpy).toHaveBeenCalledWith(["foo"], true);
|
expect(callbackSpy).toHaveBeenCalledWith(["foo"], true);
|
||||||
@@ -103,7 +102,7 @@ test("Shows a UI error dialogue when user creation fails", async () => {
|
|||||||
let submit = screen.getByTestId("submit");
|
let submit = screen.getByTestId("submit");
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
fireEvent.click(submit);
|
await fireEvent.click(submit);
|
||||||
});
|
});
|
||||||
|
|
||||||
let errorDialog = screen.getByText("Failed to create user.");
|
let errorDialog = screen.getByText("Failed to create user.");
|
||||||
@@ -122,7 +121,7 @@ test("Shows a more specific UI error dialogue when user creation returns an impr
|
|||||||
let submit = screen.getByTestId("submit");
|
let submit = screen.getByTestId("submit");
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
fireEvent.click(submit);
|
await fireEvent.click(submit);
|
||||||
});
|
});
|
||||||
|
|
||||||
let errorDialog = screen.getByText(
|
let errorDialog = screen.getByText(
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { Link, useNavigate } from "react-router-dom";
|
import { Link, useNavigate } from "react-router";
|
||||||
import { Button, Card } from "react-bootstrap";
|
import { Button, Card } from "react-bootstrap";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { MainContainer } from "../../util/layout";
|
import { MainContainer } from "../../util/layout";
|
||||||
|
@@ -1,11 +1,10 @@
|
|||||||
import React from "react";
|
import React, { act } from "react";
|
||||||
import "@testing-library/jest-dom";
|
import "@testing-library/jest-dom";
|
||||||
import { act } from "react-dom/test-utils";
|
|
||||||
import { render, screen, fireEvent } from "@testing-library/react";
|
import { render, screen, fireEvent } from "@testing-library/react";
|
||||||
import userEvent from "@testing-library/user-event";
|
import userEvent from "@testing-library/user-event";
|
||||||
import { Provider, useDispatch, useSelector } from "react-redux";
|
import { Provider, useDispatch, useSelector } from "react-redux";
|
||||||
import { createStore } from "redux";
|
import { createStore } from "redux";
|
||||||
import { HashRouter } from "react-router-dom";
|
import { HashRouter } from "react-router";
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
import regeneratorRuntime from "regenerator-runtime";
|
import regeneratorRuntime from "regenerator-runtime";
|
||||||
import CreateGroup from "./CreateGroup";
|
import CreateGroup from "./CreateGroup";
|
||||||
@@ -45,6 +44,7 @@ beforeEach(() => {
|
|||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
useDispatch.mockClear();
|
useDispatch.mockClear();
|
||||||
|
jest.runAllTimers();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Renders", async () => {
|
test("Renders", async () => {
|
||||||
@@ -63,9 +63,10 @@ test("Calls createGroup on submit", async () => {
|
|||||||
|
|
||||||
let input = screen.getByTestId("group-input");
|
let input = screen.getByTestId("group-input");
|
||||||
let submit = screen.getByTestId("submit");
|
let submit = screen.getByTestId("submit");
|
||||||
|
const user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime });
|
||||||
|
|
||||||
userEvent.type(input, "groupname");
|
await user.type(input, "groupname");
|
||||||
await act(async () => fireEvent.click(submit));
|
await act(async () => await fireEvent.click(submit));
|
||||||
|
|
||||||
expect(callbackSpy).toHaveBeenNthCalledWith(1, "groupname");
|
expect(callbackSpy).toHaveBeenNthCalledWith(1, "groupname");
|
||||||
});
|
});
|
||||||
@@ -80,7 +81,7 @@ test("Shows a UI error dialogue when group creation fails", async () => {
|
|||||||
let submit = screen.getByTestId("submit");
|
let submit = screen.getByTestId("submit");
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
fireEvent.click(submit);
|
await fireEvent.click(submit);
|
||||||
});
|
});
|
||||||
|
|
||||||
let errorDialog = screen.getByText("Failed to create group.");
|
let errorDialog = screen.getByText("Failed to create group.");
|
||||||
@@ -99,7 +100,7 @@ test("Shows a more specific UI error dialogue when user creation returns an impr
|
|||||||
let submit = screen.getByTestId("submit");
|
let submit = screen.getByTestId("submit");
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
fireEvent.click(submit);
|
await fireEvent.click(submit);
|
||||||
});
|
});
|
||||||
|
|
||||||
let errorDialog = screen.getByText(
|
let errorDialog = screen.getByText(
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { Link, useLocation, useNavigate } from "react-router-dom";
|
import { Link, useLocation, useNavigate } from "react-router";
|
||||||
import { Button, Card } from "react-bootstrap";
|
import { Button, Card } from "react-bootstrap";
|
||||||
import { MainContainer } from "../../util/layout";
|
import { MainContainer } from "../../util/layout";
|
||||||
|
|
||||||
|
@@ -1,10 +1,9 @@
|
|||||||
import React from "react";
|
import React, { act } from "react";
|
||||||
import "@testing-library/jest-dom";
|
import "@testing-library/jest-dom";
|
||||||
import { act } from "react-dom/test-utils";
|
|
||||||
import { render, screen, fireEvent } from "@testing-library/react";
|
import { render, screen, fireEvent } from "@testing-library/react";
|
||||||
import { Provider, useDispatch, useSelector } from "react-redux";
|
import { Provider, useDispatch, useSelector } from "react-redux";
|
||||||
import { createStore } from "redux";
|
import { createStore } from "redux";
|
||||||
import { HashRouter } from "react-router-dom";
|
import { HashRouter } from "react-router";
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
import regeneratorRuntime from "regenerator-runtime";
|
import regeneratorRuntime from "regenerator-runtime";
|
||||||
|
|
||||||
@@ -16,8 +15,8 @@ jest.mock("react-redux", () => ({
|
|||||||
useSelector: jest.fn(),
|
useSelector: jest.fn(),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
jest.mock("react-router-dom", () => ({
|
jest.mock("react-router", () => ({
|
||||||
...jest.requireActual("react-router-dom"),
|
...jest.requireActual("react-router"),
|
||||||
useLocation: jest.fn().mockImplementation(() => {
|
useLocation: jest.fn().mockImplementation(() => {
|
||||||
return { state: { username: "foo", has_admin: false } };
|
return { state: { username: "foo", has_admin: false } };
|
||||||
}),
|
}),
|
||||||
@@ -58,6 +57,7 @@ beforeEach(() => {
|
|||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
useDispatch.mockClear();
|
useDispatch.mockClear();
|
||||||
|
jest.runAllTimers();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Renders", async () => {
|
test("Renders", async () => {
|
||||||
@@ -80,7 +80,7 @@ test("Calls the delete user function when the button is pressed", async () => {
|
|||||||
let deleteUser = screen.getByTestId("delete-user");
|
let deleteUser = screen.getByTestId("delete-user");
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
fireEvent.click(deleteUser);
|
await fireEvent.click(deleteUser);
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(callbackSpy).toHaveBeenCalled();
|
expect(callbackSpy).toHaveBeenCalled();
|
||||||
@@ -95,7 +95,7 @@ test("Submits the edits when the button is pressed", async () => {
|
|||||||
|
|
||||||
let submit = screen.getByTestId("submit");
|
let submit = screen.getByTestId("submit");
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
fireEvent.click(submit);
|
await fireEvent.click(submit);
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(callbackSpy).toHaveBeenCalled();
|
expect(callbackSpy).toHaveBeenCalled();
|
||||||
@@ -113,7 +113,7 @@ test("Shows a UI error dialogue when user edit fails", async () => {
|
|||||||
|
|
||||||
fireEvent.blur(usernameInput, { target: { value: "whatever" } });
|
fireEvent.blur(usernameInput, { target: { value: "whatever" } });
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
fireEvent.click(submit);
|
await fireEvent.click(submit);
|
||||||
});
|
});
|
||||||
|
|
||||||
let errorDialog = screen.getByText("Failed to edit user.");
|
let errorDialog = screen.getByText("Failed to edit user.");
|
||||||
@@ -134,7 +134,7 @@ test("Shows a UI error dialogue when user edit returns an improper status code",
|
|||||||
|
|
||||||
fireEvent.blur(usernameInput, { target: { value: "whatever" } });
|
fireEvent.blur(usernameInput, { target: { value: "whatever" } });
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
fireEvent.click(submit);
|
await fireEvent.click(submit);
|
||||||
});
|
});
|
||||||
|
|
||||||
let errorDialog = screen.getByText("Failed to edit user.");
|
let errorDialog = screen.getByText("Failed to edit user.");
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useSelector, useDispatch } from "react-redux";
|
import { useSelector, useDispatch } from "react-redux";
|
||||||
import { Link, useNavigate, useLocation } from "react-router-dom";
|
import { Link, useNavigate, useLocation } from "react-router";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { Button, Card } from "react-bootstrap";
|
import { Button, Card } from "react-bootstrap";
|
||||||
import GroupSelect from "../GroupSelect/GroupSelect";
|
import GroupSelect from "../GroupSelect/GroupSelect";
|
||||||
@@ -42,6 +42,10 @@ const GroupEdit = (props) => {
|
|||||||
}
|
}
|
||||||
}, [location]);
|
}, [location]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setSelected(group_data.users);
|
||||||
|
}, []);
|
||||||
|
|
||||||
const { group_data } = location.state || {};
|
const { group_data } = location.state || {};
|
||||||
if (!group_data) return <div></div>;
|
if (!group_data) return <div></div>;
|
||||||
const [propobject, setProp] = useState(group_data.properties);
|
const [propobject, setProp] = useState(group_data.properties);
|
||||||
@@ -175,6 +179,7 @@ GroupEdit.propTypes = {
|
|||||||
removeFromGroup: PropTypes.func,
|
removeFromGroup: PropTypes.func,
|
||||||
deleteGroup: PropTypes.func,
|
deleteGroup: PropTypes.func,
|
||||||
updateGroups: PropTypes.func,
|
updateGroups: PropTypes.func,
|
||||||
|
updateProp: PropTypes.func,
|
||||||
validateUser: PropTypes.func,
|
validateUser: PropTypes.func,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -1,11 +1,10 @@
|
|||||||
import React from "react";
|
import React, { act } from "react";
|
||||||
import "@testing-library/jest-dom";
|
import "@testing-library/jest-dom";
|
||||||
import { act } from "react-dom/test-utils";
|
|
||||||
import { render, screen, fireEvent } from "@testing-library/react";
|
import { render, screen, fireEvent } from "@testing-library/react";
|
||||||
import userEvent from "@testing-library/user-event";
|
import userEvent from "@testing-library/user-event";
|
||||||
import { Provider, useSelector } from "react-redux";
|
import { Provider, useSelector } from "react-redux";
|
||||||
import { createStore } from "redux";
|
import { createStore } from "redux";
|
||||||
import { HashRouter } from "react-router-dom";
|
import { HashRouter } from "react-router";
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
import regeneratorRuntime from "regenerator-runtime";
|
import regeneratorRuntime from "regenerator-runtime";
|
||||||
|
|
||||||
@@ -16,8 +15,8 @@ jest.mock("react-redux", () => ({
|
|||||||
useSelector: jest.fn(),
|
useSelector: jest.fn(),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
jest.mock("react-router-dom", () => ({
|
jest.mock("react-router", () => ({
|
||||||
...jest.requireActual("react-router-dom"),
|
...jest.requireActual("react-router"),
|
||||||
useLocation: jest.fn().mockImplementation(() => {
|
useLocation: jest.fn().mockImplementation(() => {
|
||||||
return { state: { group_data: { users: ["foo"], name: "group" } } };
|
return { state: { group_data: { users: ["foo"], name: "group" } } };
|
||||||
}),
|
}),
|
||||||
@@ -58,6 +57,7 @@ beforeEach(() => {
|
|||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
useSelector.mockClear();
|
useSelector.mockClear();
|
||||||
|
jest.runAllTimers();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Renders", async () => {
|
test("Renders", async () => {
|
||||||
@@ -80,13 +80,15 @@ test("Adds user from input to user selectables on button click", async () => {
|
|||||||
let input = screen.getByTestId("username-input");
|
let input = screen.getByTestId("username-input");
|
||||||
let validateUser = screen.getByTestId("validate-user");
|
let validateUser = screen.getByTestId("validate-user");
|
||||||
let submit = screen.getByTestId("submit");
|
let submit = screen.getByTestId("submit");
|
||||||
|
const user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime });
|
||||||
userEvent.type(input, "bar");
|
await user.type(input, "bar");
|
||||||
fireEvent.click(validateUser);
|
await user.click(validateUser);
|
||||||
await act(async () => okPacket);
|
await act(async () => {
|
||||||
|
await jest.runAllTimers();
|
||||||
|
});
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
fireEvent.click(submit);
|
await fireEvent.click(submit);
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(callbackSpy).toHaveBeenNthCalledWith(1, ["bar"], "group");
|
expect(callbackSpy).toHaveBeenNthCalledWith(1, ["bar"], "group");
|
||||||
@@ -100,7 +102,7 @@ test("Removes a user recently added from input from the selectables list", async
|
|||||||
});
|
});
|
||||||
|
|
||||||
let selectedUser = screen.getByText("foo");
|
let selectedUser = screen.getByText("foo");
|
||||||
fireEvent.click(selectedUser);
|
await await fireEvent.click(selectedUser);
|
||||||
|
|
||||||
let unselectedUser = screen.getByText("foo");
|
let unselectedUser = screen.getByText("foo");
|
||||||
|
|
||||||
@@ -117,14 +119,14 @@ test("Grays out a user, already in the group, when unselected and calls deleteUs
|
|||||||
let submit = screen.getByTestId("submit");
|
let submit = screen.getByTestId("submit");
|
||||||
|
|
||||||
let groupUser = screen.getByText("foo");
|
let groupUser = screen.getByText("foo");
|
||||||
fireEvent.click(groupUser);
|
await fireEvent.click(groupUser);
|
||||||
|
|
||||||
let unselectedUser = screen.getByText("foo");
|
let unselectedUser = screen.getByText("foo");
|
||||||
expect(unselectedUser.className).toBe("item unselected");
|
expect(unselectedUser.className).toBe("item unselected");
|
||||||
|
|
||||||
// test deleteUser call
|
// test deleteUser call
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
fireEvent.click(submit);
|
await fireEvent.click(submit);
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(callbackSpy).toHaveBeenNthCalledWith(1, ["foo"], "group");
|
expect(callbackSpy).toHaveBeenNthCalledWith(1, ["foo"], "group");
|
||||||
@@ -140,7 +142,7 @@ test("Calls deleteGroup on button click", async () => {
|
|||||||
let deleteGroup = screen.getByTestId("delete-group");
|
let deleteGroup = screen.getByTestId("delete-group");
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
fireEvent.click(deleteGroup);
|
await fireEvent.click(deleteGroup);
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(callbackSpy).toHaveBeenNthCalledWith(1, "group");
|
expect(callbackSpy).toHaveBeenNthCalledWith(1, "group");
|
||||||
@@ -154,12 +156,12 @@ test("Shows a UI error dialogue when group edit fails", async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let groupUser = screen.getByText("foo");
|
let groupUser = screen.getByText("foo");
|
||||||
fireEvent.click(groupUser);
|
await fireEvent.click(groupUser);
|
||||||
|
|
||||||
let submit = screen.getByTestId("submit");
|
let submit = screen.getByTestId("submit");
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
fireEvent.click(submit);
|
await fireEvent.click(submit);
|
||||||
});
|
});
|
||||||
|
|
||||||
let errorDialog = screen.getByText("Failed to edit group.");
|
let errorDialog = screen.getByText("Failed to edit group.");
|
||||||
@@ -176,12 +178,12 @@ test("Shows a UI error dialogue when group edit returns an improper status code"
|
|||||||
});
|
});
|
||||||
|
|
||||||
let groupUser = screen.getByText("foo");
|
let groupUser = screen.getByText("foo");
|
||||||
fireEvent.click(groupUser);
|
await fireEvent.click(groupUser);
|
||||||
|
|
||||||
let submit = screen.getByTestId("submit");
|
let submit = screen.getByTestId("submit");
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
fireEvent.click(submit);
|
await fireEvent.click(submit);
|
||||||
});
|
});
|
||||||
|
|
||||||
let errorDialog = screen.getByText("Failed to edit group.");
|
let errorDialog = screen.getByText("Failed to edit group.");
|
||||||
@@ -200,7 +202,7 @@ test("Shows a UI error dialogue when group delete fails", async () => {
|
|||||||
let deleteGroup = screen.getByTestId("delete-group");
|
let deleteGroup = screen.getByTestId("delete-group");
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
fireEvent.click(deleteGroup);
|
await fireEvent.click(deleteGroup);
|
||||||
});
|
});
|
||||||
|
|
||||||
let errorDialog = screen.getByText("Failed to delete group.");
|
let errorDialog = screen.getByText("Failed to delete group.");
|
||||||
@@ -219,7 +221,7 @@ test("Shows a UI error dialogue when group delete returns an improper status cod
|
|||||||
let deleteGroup = screen.getByTestId("delete-group");
|
let deleteGroup = screen.getByTestId("delete-group");
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
fireEvent.click(deleteGroup);
|
await fireEvent.click(deleteGroup);
|
||||||
});
|
});
|
||||||
|
|
||||||
let errorDialog = screen.getByText("Failed to delete group.");
|
let errorDialog = screen.getByText("Failed to delete group.");
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user