diff --git a/.circleci/config.yml b/.circleci/config.yml index 2f4a568a..0e53be4f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,7 +24,6 @@ jobs: command: | docker run --rm -it -v $PWD/dockerfiles:/io jupyterhub/jupyterhub python3 /io/test.py - # Tell CircleCI to use this workflow when it builds the site workflows: version: 2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8b54bfd4..a172ee5c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,6 +51,13 @@ jobs: print("OK") EOF + # ref: https://github.com/actions/upload-artifact#readme + - uses: actions/upload-artifact@v2 + with: + name: jupyterhub-${{ github.sha }} + path: "dist/*" + if-no-files-found: error + - name: Publish to PyPI if: startsWith(github.ref, 'refs/tags/') env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b7785e68..6e83e381 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,7 @@ # This is a GitHub workflow defining a set of jobs with a set of steps. # ref: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions # -name: Run tests +name: Test # Trigger the workflow's on all PRs but only on pushed tags or commits to # main/master branch to avoid PRs developed in a GitHub fork's dedicated branch @@ -9,6 +9,7 @@ name: Run tests on: pull_request: push: + workflow_dispatch: defaults: run: @@ -50,7 +51,6 @@ jobs: echo "or after-the-fact on already committed files with" echo " pre-commit run --all-files" - # Run "pytest jupyterhub/tests" in various configurations pytest: runs-on: ubuntu-20.04 @@ -130,7 +130,6 @@ jobs: echo "JUPYTERHUB_SINGLEUSER_APP=jupyterhub.tests.mockserverapp.MockServerApp" >> $GITHUB_ENV fi - uses: actions/checkout@v2 - # NOTE: actions/setup-node@v1 make use of a cache within the GitHub base # environment and setup in a fraction of a second. - name: Install Node v14 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 67297a8e..baf7dd62 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,19 +1,24 @@ repos: -- repo: https://github.com/asottile/reorder_python_imports - rev: v1.9.0 - hooks: - - id: reorder-python-imports -- repo: https://github.com/psf/black - rev: 20.8b1 - hooks: - - id: black -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.4.0 - hooks: - - id: end-of-file-fixer - - id: check-json - - id: check-yaml - - id: check-case-conflict - - id: check-executables-have-shebangs - - id: requirements-txt-fixer - - id: flake8 + - repo: https://github.com/asottile/reorder_python_imports + rev: v1.9.0 + hooks: + - id: reorder-python-imports + - repo: https://github.com/psf/black + rev: 20.8b1 + hooks: + - id: black + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v2.2.1 + hooks: + - id: prettier + - repo: https://gitlab.com/pycqa/flake8 + rev: "3.8.4" + hooks: + - id: flake8 + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.4.0 + hooks: + - id: end-of-file-fixer + - id: check-case-conflict + - id: check-executables-have-shebangs + - id: requirements-txt-fixer diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..edfb99f1 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +share/jupyterhub/templates/ diff --git a/CHECKLIST-Release.md b/CHECKLIST-Release.md index 9c4fb2da..c4c1f508 100644 --- a/CHECKLIST-Release.md +++ b/CHECKLIST-Release.md @@ -2,24 +2,24 @@ - [ ] Upgrade Docs prior to Release - - [ ] Change log - - [ ] New features documented - - [ ] Update the contributor list - thank you page + - [ ] Change log + - [ ] New features documented + - [ ] Update the contributor list - thank you page - [ ] Upgrade and test Reference Deployments - [ ] Release software - - [ ] Make sure 0 issues in milestone - - [ ] Follow release process steps - - [ ] Send builds to PyPI (Warehouse) and Conda Forge + - [ ] Make sure 0 issues in milestone + - [ ] Follow release process steps + - [ ] Send builds to PyPI (Warehouse) and Conda Forge - [ ] Blog post and/or release note - [ ] Notify users of release - - [ ] Email Jupyter and Jupyter In Education mailing lists - - [ ] Tweet (optional) + - [ ] Email Jupyter and Jupyter In Education mailing lists + - [ ] Tweet (optional) - [ ] Increment the version number for the next release diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 326b4899..34d3a606 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,39 +18,41 @@ JupyterHub requires Python >= 3.5 and nodejs. As a Python project, a development install of JupyterHub follows standard practices for the basics (steps 1-2). - 1. clone the repo - ```bash - git clone https://github.com/jupyterhub/jupyterhub - ``` + ```bash + git clone https://github.com/jupyterhub/jupyterhub + ``` 2. do a development install with pip - ```bash - cd jupyterhub - python3 -m pip install --editable . - ``` + ```bash + cd jupyterhub + python3 -m pip install --editable . + ``` + 3. install the development requirements, which include things like testing tools - ```bash - python3 -m pip install -r dev-requirements.txt - ``` + ```bash + python3 -m pip install -r dev-requirements.txt + ``` + 4. install configurable-http-proxy with npm: - ```bash - npm install -g configurable-http-proxy - ``` + ```bash + npm install -g configurable-http-proxy + ``` + 5. set up pre-commit hooks for automatic code formatting, etc. - ```bash - pre-commit install - ``` + ```bash + pre-commit install + ``` - You can also invoke the pre-commit hook manually at any time with + You can also invoke the pre-commit hook manually at any time with - ```bash - pre-commit run - ``` + ```bash + pre-commit run + ``` ## Contributing @@ -71,7 +73,7 @@ into your text editor to format code automatically. If you have already committed files before setting up the pre-commit hook with `pre-commit install`, you can fix everything up using -`pre-commit run --all-files`. You need to make the fixing commit +`pre-commit run --all-files`. You need to make the fixing commit yourself after that. ## Testing diff --git a/COPYING.md b/COPYING.md index d62c3724..cd834f89 100644 --- a/COPYING.md +++ b/COPYING.md @@ -24,7 +24,7 @@ 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 +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 @@ -46,8 +46,8 @@ 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 +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. diff --git a/README.md b/README.md index 28afd74e..24dbd8a1 100644 --- a/README.md +++ b/README.md @@ -6,14 +6,12 @@ **[License](#license)** | **[Help and Resources](#help-and-resources)** - # [JupyterHub](https://github.com/jupyterhub/jupyterhub) - [![Latest PyPI version](https://img.shields.io/pypi/v/jupyterhub?logo=pypi)](https://pypi.python.org/pypi/jupyterhub) [![Latest conda-forge version](https://img.shields.io/conda/vn/conda-forge/jupyterhub?logo=conda-forge)](https://www.npmjs.com/package/jupyterhub) [![Documentation build status](https://img.shields.io/readthedocs/jupyterhub?logo=read-the-docs)](https://jupyterhub.readthedocs.org/en/latest/) -[![TravisCI build status](https://img.shields.io/travis/com/jupyterhub/jupyterhub?logo=travis)](https://travis-ci.com/jupyterhub/jupyterhub) +[![GitHub Workflow Status - Test](https://img.shields.io/github/workflow/status/jupyterhub/jupyterhub/Test?logo=github&label=tests)](https://github.com/jupyterhub/jupyterhub/actions) [![DockerHub build status](https://img.shields.io/docker/build/jupyterhub/jupyterhub?logo=docker&label=build)](https://hub.docker.com/r/jupyterhub/jupyterhub/tags) [![CircleCI build status](https://img.shields.io/circleci/build/github/jupyterhub/jupyterhub?logo=circleci)](https://circleci.com/gh/jupyterhub/jupyterhub) [![Test coverage of code](https://codecov.io/gh/jupyterhub/jupyterhub/branch/master/graph/badge.svg)](https://codecov.io/gh/jupyterhub/jupyterhub) @@ -53,17 +51,16 @@ for administration of the Hub and its users. ## Installation - ### Check prerequisites - A Linux/Unix based system - [Python](https://www.python.org/downloads/) 3.5 or greater - [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. - * If you are using **`pip`**, install a recent version of + - If you are using **`pip`**, install a recent version of [nodejs/npm](https://docs.npmjs.com/getting-started/installing-node). For example, install it on Linux (Debian/Ubuntu) using: @@ -102,7 +99,7 @@ JupyterHub can be installed with `pip`, and the proxy with `npm`: ```bash npm install -g configurable-http-proxy -python3 -m pip install jupyterhub +python3 -m pip install jupyterhub ``` If you plan to run notebook servers locally, you will need to install the @@ -120,10 +117,10 @@ To start the Hub server, run the command: Visit `https://localhost:8000` in your browser, and sign in with your unix PAM credentials. -*Note*: To allow multiple users to sign into the server, you will need to -run the `jupyterhub` command as a *privileged user*, such as root. +_Note_: To allow multiple users to sign into the server, you will need to +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) -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. ## Configuration @@ -142,7 +139,7 @@ To generate a default config file with settings and descriptions: ### Start the Hub -To start the Hub on a specific url and port ``10.0.1.2:443`` with **https**: +To start the Hub on a specific url and port `10.0.1.2:443` with **https**: jupyterhub --ip 10.0.1.2 --port 443 --ssl-key my_ssl.key --ssl-cert my_ssl.cert diff --git a/demo-image/README.md b/demo-image/README.md index 7c9681b8..b8ecefb7 100644 --- a/demo-image/README.md +++ b/demo-image/README.md @@ -15,9 +15,10 @@ 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`. +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`. diff --git a/dev-requirements.txt b/dev-requirements.txt index 7b14b306..e000750a 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -10,9 +10,9 @@ html5lib # needed for beautifulsoup mock notebook pre-commit +pytest>=3.3 pytest-asyncio pytest-cov -pytest>=3.3 requests-mock # blacklist urllib3 releases affected by https://github.com/urllib3/urllib3/issues/1683 # I *think* this should only affect testing, not production diff --git a/dockerfiles/Dockerfile.alpine b/dockerfiles/Dockerfile.alpine index be7f64b0..79ccd774 100644 --- a/dockerfiles/Dockerfile.alpine +++ b/dockerfiles/Dockerfile.alpine @@ -1,9 +1,14 @@ -FROM python:3.6.3-alpine3.6 - -ARG JUPYTERHUB_VERSION=0.8.1 - -RUN pip3 install --no-cache jupyterhub==${JUPYTERHUB_VERSION} +FROM alpine:3.13 ENV LANG=en_US.UTF-8 +RUN apk add --no-cache \ + python3 \ + py3-pip \ + py3-ruamel.yaml \ + py3-cryptography \ + py3-sqlalchemy + +ARG JUPYTERHUB_VERSION=1.3.0 +RUN pip3 install --no-cache jupyterhub==${JUPYTERHUB_VERSION} USER nobody CMD ["jupyterhub"] diff --git a/dockerfiles/README.md b/dockerfiles/README.md index b17546bd..2ea2db4b 100644 --- a/dockerfiles/README.md +++ b/dockerfiles/README.md @@ -1,20 +1,20 @@ ## What is Dockerfile.alpine -Dockerfile.alpine contains base image for jupyterhub. It does not work independently, but only as part of a full jupyterhub cluster + +Dockerfile.alpine contains base image for jupyterhub. It does not work independently, but only as part of a full jupyterhub cluster ## How to use it? -1. A running configurable-http-proxy, whose API is accessible. +1. A running configurable-http-proxy, whose API is accessible. 2. A jupyterhub_config file. 3. Authentication and other libraries required by the specific jupyterhub_config file. - ## Steps to test it outside a cluster -* start configurable-http-proxy in another container -* specify CONFIGPROXY_AUTH_TOKEN env in both containers -* put both containers on the same network (e.g. docker network create jupyterhub; docker run ... --net jupyterhub) -* tell jupyterhub where CHP is (e.g. c.ConfigurableHTTPProxy.api_url = 'http://chp:8001') -* tell jupyterhub not to start the proxy itself (c.ConfigurableHTTPProxy.should_start = False) -* Use dummy authenticator for ease of testing. Update following in jupyterhub_config file - - c.JupyterHub.authenticator_class = 'dummyauthenticator.DummyAuthenticator' - - c.DummyAuthenticator.password = "your strong password" +- start configurable-http-proxy in another container +- specify CONFIGPROXY_AUTH_TOKEN env in both containers +- put both containers on the same network (e.g. docker network create jupyterhub; docker run ... --net jupyterhub) +- tell jupyterhub where CHP is (e.g. c.ConfigurableHTTPProxy.api_url = 'http://chp:8001') +- tell jupyterhub not to start the proxy itself (c.ConfigurableHTTPProxy.should_start = False) +- Use dummy authenticator for ease of testing. Update following in jupyterhub_config file + - c.JupyterHub.authenticator_class = 'dummyauthenticator.DummyAuthenticator' + - c.DummyAuthenticator.password = "your strong password" diff --git a/docs/requirements.txt b/docs/requirements.txt index 2d9da795..1e5874f5 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -7,6 +7,6 @@ https://github.com/jupyterhub/autodoc-traits/archive/75885ee24636efbfebfceed1043 pydata-sphinx-theme pytablewriter>=0.56 recommonmark>=0.6 +sphinx>=1.7 sphinx-copybutton sphinx-jsonschema -sphinx>=1.7 diff --git a/docs/rest-api.yml b/docs/rest-api.yml index 8a230f8f..2f305d36 100644 --- a/docs/rest-api.yml +++ b/docs/rest-api.yml @@ -1,13 +1,12 @@ # see me at: http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyterhub/jupyterhub/master/docs/rest-api.yml#/default -swagger: '2.0' +swagger: "2.0" info: title: JupyterHub description: The REST API for JupyterHub version: 1.2.0dev license: name: BSD-3-Clause -schemes: - [http, https] +schemes: [http, https] securityDefinitions: token: type: apiKey @@ -28,7 +27,7 @@ paths: This endpoint is not authenticated for the purpose of clients and user to identify the JupyterHub version before setting up authentication. responses: - '200': + "200": description: The JupyterHub version schema: type: object @@ -44,7 +43,7 @@ paths: JupyterHub's version and executable path, and which Authenticator and Spawner are active. responses: - '200': + "200": description: Detailed JupyterHub info schema: type: object @@ -95,12 +94,12 @@ paths: Added in JupyterHub 1.3 responses: - '200': + "200": description: The Hub's user list schema: type: array items: - $ref: '#/definitions/User' + $ref: "#/definitions/User" post: summary: Create multiple users parameters: @@ -119,13 +118,13 @@ paths: description: whether the created users should be admins type: boolean responses: - '201': + "201": description: The users have been created schema: type: array description: The created users items: - $ref: '#/definitions/User' + $ref: "#/definitions/User" /users/{name}: get: summary: Get a user by name @@ -136,10 +135,10 @@ paths: required: true type: string responses: - '200': + "200": description: The User model schema: - $ref: '#/definitions/User' + $ref: "#/definitions/User" post: summary: Create a single user parameters: @@ -149,10 +148,10 @@ paths: required: true type: string responses: - '201': + "201": description: The user has been created schema: - $ref: '#/definitions/User' + $ref: "#/definitions/User" patch: summary: Modify a user description: Change a user's name or admin status @@ -176,10 +175,10 @@ paths: type: boolean description: update admin (optional, if another key is updated i.e. name) responses: - '200': + "200": description: The updated user info schema: - $ref: '#/definitions/User' + $ref: "#/definitions/User" delete: summary: Delete a user parameters: @@ -189,14 +188,12 @@ paths: required: true type: string responses: - '204': + "204": description: The user has been deleted /users/{name}/activity: post: - summary: - Notify Hub of activity for a given user. - description: - Notify the Hub of activity by the user, + summary: Notify Hub of activity for a given user. + description: Notify the Hub of activity by the user, e.g. accessing a service or (more likely) actively using a server. parameters: @@ -224,7 +221,7 @@ paths: The default server has an empty name (''). type: object properties: - '': + "": description: | Activity for a single server. type: object @@ -237,16 +234,16 @@ paths: description: | Timestamp of last-seen activity on this server. example: - last_activity: '2019-02-06T12:54:14Z' + last_activity: "2019-02-06T12:54:14Z" servers: - '': - last_activity: '2019-02-06T12:54:14Z' + "": + last_activity: "2019-02-06T12:54:14Z" gpu: - last_activity: '2019-02-06T12:54:14Z' + last_activity: "2019-02-06T12:54:14Z" responses: - '401': - $ref: '#/responses/Unauthorized' - '404': + "401": + $ref: "#/responses/Unauthorized" + "404": description: No such user /users/{name}/server: post: @@ -271,9 +268,9 @@ paths: type: object responses: - '201': + "201": description: The user's notebook server has started - '202': + "202": description: The user's notebook server has not yet started, but has been requested delete: summary: Stop a user's server @@ -284,9 +281,9 @@ paths: required: true type: string responses: - '204': + "204": description: The user's notebook server has stopped - '202': + "202": description: The user's notebook server has not yet stopped as it is taking a while to stop /users/{name}/servers/{server_name}: post: @@ -300,7 +297,7 @@ paths: - name: server_name description: | name given to a named-server. - + Note that depending on your JupyterHub infrastructure there are chracterter size limitation to `server_name`. Default spawner with K8s pod will not allow Jupyter Notebooks to be spawned with a name that contains more than 253 characters (keep in mind that the pod will be spawned with extra characters to identify the user and hub). in: path required: true @@ -316,9 +313,9 @@ paths: schema: type: object responses: - '201': + "201": description: The user's notebook named-server has started - '202': + "202": description: The user's notebook named-server has not yet started, but has been requested delete: summary: Stop a user's named-server @@ -346,9 +343,9 @@ paths: Removing a server deletes things like the state of the stopped server. Default: false. responses: - '204': + "204": description: The user's notebook named-server has stopped - '202': + "202": description: The user's notebook named-server has not yet stopped as it is taking a while to stop /users/{name}/tokens: parameters: @@ -360,15 +357,15 @@ paths: get: summary: List tokens for the user responses: - '200': + "200": description: The list of tokens schema: type: array items: - $ref: '#/definitions/Token' - '401': - $ref: '#/responses/Unauthorized' - '404': + $ref: "#/definitions/Token" + "401": + $ref: "#/responses/Unauthorized" + "404": description: No such user post: summary: Create a new token for the user @@ -386,11 +383,11 @@ paths: type: string description: A note attached to the token for future bookkeeping responses: - '201': + "201": description: The newly created token schema: - $ref: '#/definitions/Token' - '400': + $ref: "#/definitions/Token" + "400": description: Body must be a JSON dict or empty /users/{name}/tokens/{token_id}: parameters: @@ -406,33 +403,33 @@ paths: get: summary: Get the model for a token by id responses: - '200': + "200": description: The info for the new token schema: - $ref: '#/definitions/Token' + $ref: "#/definitions/Token" delete: summary: Delete (revoke) a token by id responses: - '204': + "204": description: The token has been deleted /user: get: summary: Return authenticated user's model responses: - '200': + "200": description: The authenticated user's model is returned. schema: - $ref: '#/definitions/User' + $ref: "#/definitions/User" /groups: get: summary: List groups responses: - '200': + "200": description: The list of groups schema: type: array items: - $ref: '#/definitions/Group' + $ref: "#/definitions/Group" /groups/{name}: get: summary: Get a group by name @@ -443,10 +440,10 @@ paths: required: true type: string responses: - '200': + "200": description: The group model schema: - $ref: '#/definitions/Group' + $ref: "#/definitions/Group" post: summary: Create a group parameters: @@ -456,10 +453,10 @@ paths: required: true type: string responses: - '201': + "201": description: The group has been created schema: - $ref: '#/definitions/Group' + $ref: "#/definitions/Group" delete: summary: Delete a group parameters: @@ -469,7 +466,7 @@ paths: required: true type: string responses: - '204': + "204": description: The group has been deleted /groups/{name}/users: post: @@ -493,10 +490,10 @@ paths: items: type: string responses: - '200': + "200": description: The users have been added to the group schema: - $ref: '#/definitions/Group' + $ref: "#/definitions/Group" delete: summary: Remove users from a group parameters: @@ -518,18 +515,18 @@ paths: items: type: string responses: - '200': + "200": description: The users have been removed from the group /services: get: summary: List services responses: - '200': + "200": description: The service list schema: type: array items: - $ref: '#/definitions/Service' + $ref: "#/definitions/Service" /services/{name}: get: summary: Get a service by name @@ -540,16 +537,16 @@ paths: required: true type: string responses: - '200': + "200": description: The Service model schema: - $ref: '#/definitions/Service' + $ref: "#/definitions/Service" /proxy: get: summary: Get the proxy's routing table description: A convenience alias for getting the routing table directly from the proxy responses: - '200': + "200": description: Routing table schema: type: object @@ -557,7 +554,7 @@ paths: post: summary: Force the Hub to sync with the proxy responses: - '200': + "200": description: Success patch: summary: Notify the Hub about a new proxy @@ -583,7 +580,7 @@ paths: type: string description: CONFIGPROXY_AUTH_TOKEN for the new proxy responses: - '200': + "200": description: Success /authorizations/token: post: @@ -605,7 +602,7 @@ paths: password: type: string responses: - '200': + "200": description: The new API token schema: type: object @@ -613,7 +610,7 @@ paths: token: type: string description: The new API token. - '403': + "403": description: The user can not be authenticated. /authorizations/token/{token}: get: @@ -624,9 +621,9 @@ paths: required: true type: string responses: - '200': + "200": description: The user or service identified by the API token - '404': + "404": description: A user or service is not found. /authorizations/cookie/{cookie_name}/{cookie_value}: get: @@ -642,15 +639,15 @@ paths: required: true type: string responses: - '200': + "200": description: The user identified by the cookie schema: - $ref: '#/definitions/User' - '404': + $ref: "#/definitions/User" + "404": description: A user is not found. /oauth2/authorize: get: - summary: 'OAuth 2.0 authorize endpoint' + summary: "OAuth 2.0 authorize endpoint" description: | Redirect users to this URL to begin the OAuth process. It is not an API endpoint. @@ -676,9 +673,9 @@ paths: required: true type: string responses: - '200': + "200": description: Success - '400': + "400": description: OAuth2Error /oauth2/token: post: @@ -715,7 +712,7 @@ paths: required: true type: string responses: - '200': + "200": description: JSON response including the token schema: type: object @@ -742,9 +739,9 @@ paths: type: boolean description: Whether users' notebook servers should be shutdown as well (default from Hub config) responses: - '202': + "202": description: Shutdown successful - '400': + "400": description: Unexpeced value for proxy or servers # Descriptions of common responses responses: @@ -782,7 +779,7 @@ definitions: type: array description: The active servers for this user. items: - $ref: '#/definitions/Server' + $ref: "#/definitions/Server" Server: type: object properties: diff --git a/docs/source/_static/custom.css b/docs/source/_static/custom.css index e55a6a55..5da11561 100644 --- a/docs/source/_static/custom.css +++ b/docs/source/_static/custom.css @@ -1,4 +1,4 @@ -/* Added to avoid logo being too squeezed */ -.navbar-brand { - height: 4rem !important; -} +/* Added to avoid logo being too squeezed */ +.navbar-brand { + height: 4rem !important; +} diff --git a/docs/source/changelog.md b/docs/source/changelog.md index ffa2c029..da9825f1 100644 --- a/docs/source/changelog.md +++ b/docs/source/changelog.md @@ -4,7 +4,6 @@ For detailed changes from the prior release, click on the version number, and its link will bring up a GitHub listing of changes. Use `git log` on the command line for details. - ## [Unreleased] ### 1.3 @@ -25,36 +24,35 @@ JupyterHub 1.3 is a small feature release. Highlights include: #### Enhancements made -* allow services to call /api/user to identify themselves [#3293](https://github.com/jupyterhub/jupyterhub/pull/3293) ([@minrk](https://github.com/minrk)) -* Add optional user agreement to login screen [#3264](https://github.com/jupyterhub/jupyterhub/pull/3264) ([@tlvu](https://github.com/tlvu)) -* [Metrics] Add prefix to prometheus metrics to group all jupyterhub metrics [#3243](https://github.com/jupyterhub/jupyterhub/pull/3243) ([@agp8x](https://github.com/agp8x)) -* Allow options_from_form to be configurable [#3225](https://github.com/jupyterhub/jupyterhub/pull/3225) ([@cbanek](https://github.com/cbanek)) -* add ?state= filter for GET /users [#3177](https://github.com/jupyterhub/jupyterhub/pull/3177) ([@minrk](https://github.com/minrk)) -* Enable async support in jinja2 templates [#3176](https://github.com/jupyterhub/jupyterhub/pull/3176) ([@yuvipanda](https://github.com/yuvipanda)) +- allow services to call /api/user to identify themselves [#3293](https://github.com/jupyterhub/jupyterhub/pull/3293) ([@minrk](https://github.com/minrk)) +- Add optional user agreement to login screen [#3264](https://github.com/jupyterhub/jupyterhub/pull/3264) ([@tlvu](https://github.com/tlvu)) +- [Metrics] Add prefix to prometheus metrics to group all jupyterhub metrics [#3243](https://github.com/jupyterhub/jupyterhub/pull/3243) ([@agp8x](https://github.com/agp8x)) +- Allow options_from_form to be configurable [#3225](https://github.com/jupyterhub/jupyterhub/pull/3225) ([@cbanek](https://github.com/cbanek)) +- add ?state= filter for GET /users [#3177](https://github.com/jupyterhub/jupyterhub/pull/3177) ([@minrk](https://github.com/minrk)) +- Enable async support in jinja2 templates [#3176](https://github.com/jupyterhub/jupyterhub/pull/3176) ([@yuvipanda](https://github.com/yuvipanda)) #### Bugs fixed -* fix increasing pagination limits [#3294](https://github.com/jupyterhub/jupyterhub/pull/3294) ([@minrk](https://github.com/minrk)) -* fix and test TOTAL_USERS count [#3289](https://github.com/jupyterhub/jupyterhub/pull/3289) ([@minrk](https://github.com/minrk)) -* Fix asyncio deprecation asyncio.Task.all_tasks [#3298](https://github.com/jupyterhub/jupyterhub/pull/3298) ([@coffeebenzene](https://github.com/coffeebenzene)) +- fix increasing pagination limits [#3294](https://github.com/jupyterhub/jupyterhub/pull/3294) ([@minrk](https://github.com/minrk)) +- fix and test TOTAL_USERS count [#3289](https://github.com/jupyterhub/jupyterhub/pull/3289) ([@minrk](https://github.com/minrk)) +- Fix asyncio deprecation asyncio.Task.all_tasks [#3298](https://github.com/jupyterhub/jupyterhub/pull/3298) ([@coffeebenzene](https://github.com/coffeebenzene)) #### Maintenance and upkeep improvements -* bump oldest-required prometheus-client [#3292](https://github.com/jupyterhub/jupyterhub/pull/3292) ([@minrk](https://github.com/minrk)) -* bump black pre-commit hook to 20.8 [#3287](https://github.com/jupyterhub/jupyterhub/pull/3287) ([@minrk](https://github.com/minrk)) -* Test internal_ssl separately [#3266](https://github.com/jupyterhub/jupyterhub/pull/3266) ([@0mar](https://github.com/0mar)) -* wait for pending spawns in spawn_form_admin_access [#3253](https://github.com/jupyterhub/jupyterhub/pull/3253) ([@minrk](https://github.com/minrk)) -* Assume py36 and remove @gen.coroutine etc. [#3242](https://github.com/jupyterhub/jupyterhub/pull/3242) ([@consideRatio](https://github.com/consideRatio)) +- bump oldest-required prometheus-client [#3292](https://github.com/jupyterhub/jupyterhub/pull/3292) ([@minrk](https://github.com/minrk)) +- bump black pre-commit hook to 20.8 [#3287](https://github.com/jupyterhub/jupyterhub/pull/3287) ([@minrk](https://github.com/minrk)) +- Test internal_ssl separately [#3266](https://github.com/jupyterhub/jupyterhub/pull/3266) ([@0mar](https://github.com/0mar)) +- wait for pending spawns in spawn_form_admin_access [#3253](https://github.com/jupyterhub/jupyterhub/pull/3253) ([@minrk](https://github.com/minrk)) +- Assume py36 and remove @gen.coroutine etc. [#3242](https://github.com/jupyterhub/jupyterhub/pull/3242) ([@consideRatio](https://github.com/consideRatio)) #### Documentation improvements -* Fix curl in jupyter announcements [#3286](https://github.com/jupyterhub/jupyterhub/pull/3286) ([@Sangarshanan](https://github.com/Sangarshanan)) -* CONTRIBUTING: Fix contributor guide URL [#3281](https://github.com/jupyterhub/jupyterhub/pull/3281) ([@olifre](https://github.com/olifre)) -* Update services.md [#3267](https://github.com/jupyterhub/jupyterhub/pull/3267) ([@slemonide](https://github.com/slemonide)) -* [Docs] Fix https reverse proxy redirect issues [#3244](https://github.com/jupyterhub/jupyterhub/pull/3244) ([@mhwasil](https://github.com/mhwasil)) -* Fixed idle-culler references. [#3300](https://github.com/jupyterhub/jupyterhub/pull/3300) ([@mxjeff](https://github.com/mxjeff)) -* Remove the extra parenthesis in service.md [#3303](https://github.com/jupyterhub/jupyterhub/pull/3303) ([@Sangarshanan](https://github.com/Sangarshanan)) - +- Fix curl in jupyter announcements [#3286](https://github.com/jupyterhub/jupyterhub/pull/3286) ([@Sangarshanan](https://github.com/Sangarshanan)) +- CONTRIBUTING: Fix contributor guide URL [#3281](https://github.com/jupyterhub/jupyterhub/pull/3281) ([@olifre](https://github.com/olifre)) +- Update services.md [#3267](https://github.com/jupyterhub/jupyterhub/pull/3267) ([@slemonide](https://github.com/slemonide)) +- [Docs] Fix https reverse proxy redirect issues [#3244](https://github.com/jupyterhub/jupyterhub/pull/3244) ([@mhwasil](https://github.com/mhwasil)) +- Fixed idle-culler references. [#3300](https://github.com/jupyterhub/jupyterhub/pull/3300) ([@mxjeff](https://github.com/mxjeff)) +- Remove the extra parenthesis in service.md [#3303](https://github.com/jupyterhub/jupyterhub/pull/3303) ([@Sangarshanan](https://github.com/Sangarshanan)) #### Contributors to this release @@ -62,7 +60,6 @@ JupyterHub 1.3 is a small feature release. Highlights include: [@0mar](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3A0mar+updated%3A2020-10-30..2020-12-11&type=Issues) | [@agp8x](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aagp8x+updated%3A2020-10-30..2020-12-11&type=Issues) | [@alexweav](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aalexweav+updated%3A2020-10-30..2020-12-11&type=Issues) | [@belfhi](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Abelfhi+updated%3A2020-10-30..2020-12-11&type=Issues) | [@betatim](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Abetatim+updated%3A2020-10-30..2020-12-11&type=Issues) | [@cbanek](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Acbanek+updated%3A2020-10-30..2020-12-11&type=Issues) | [@cmd-ntrf](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Acmd-ntrf+updated%3A2020-10-30..2020-12-11&type=Issues) | [@coffeebenzene](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Acoffeebenzene+updated%3A2020-10-30..2020-12-11&type=Issues) | [@consideRatio](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AconsideRatio+updated%3A2020-10-30..2020-12-11&type=Issues) | [@danlester](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Adanlester+updated%3A2020-10-30..2020-12-11&type=Issues) | [@fcollonval](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Afcollonval+updated%3A2020-10-30..2020-12-11&type=Issues) | [@GeorgianaElena](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AGeorgianaElena+updated%3A2020-10-30..2020-12-11&type=Issues) | [@ianabc](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aianabc+updated%3A2020-10-30..2020-12-11&type=Issues) | [@IvanaH8](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AIvanaH8+updated%3A2020-10-30..2020-12-11&type=Issues) | [@manics](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Amanics+updated%3A2020-10-30..2020-12-11&type=Issues) | [@meeseeksmachine](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ameeseeksmachine+updated%3A2020-10-30..2020-12-11&type=Issues) | [@mhwasil](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Amhwasil+updated%3A2020-10-30..2020-12-11&type=Issues) | [@minrk](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aminrk+updated%3A2020-10-30..2020-12-11&type=Issues) | [@mriedem](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Amriedem+updated%3A2020-10-30..2020-12-11&type=Issues) | [@mxjeff](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Amxjeff+updated%3A2020-10-30..2020-12-11&type=Issues) | [@olifre](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aolifre+updated%3A2020-10-30..2020-12-11&type=Issues) | [@rcthomas](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Arcthomas+updated%3A2020-10-30..2020-12-11&type=Issues) | [@rgbkrk](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Argbkrk+updated%3A2020-10-30..2020-12-11&type=Issues) | [@rkdarst](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Arkdarst+updated%3A2020-10-30..2020-12-11&type=Issues) | [@Sangarshanan](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3ASangarshanan+updated%3A2020-10-30..2020-12-11&type=Issues) | [@slemonide](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aslemonide+updated%3A2020-10-30..2020-12-11&type=Issues) | [@support](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Asupport+updated%3A2020-10-30..2020-12-11&type=Issues) | [@tlvu](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Atlvu+updated%3A2020-10-30..2020-12-11&type=Issues) | [@welcome](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Awelcome+updated%3A2020-10-30..2020-12-11&type=Issues) | [@yuvipanda](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ayuvipanda+updated%3A2020-10-30..2020-12-11&type=Issues) - ## 1.2 ### [1.2.2] 2020-11-27 @@ -71,23 +68,23 @@ JupyterHub 1.3 is a small feature release. Highlights include: #### Enhancements made -* Standardize "Sign in" capitalization on the login page [#3252](https://github.com/jupyterhub/jupyterhub/pull/3252) ([@cmd-ntrf](https://github.com/cmd-ntrf)) +- Standardize "Sign in" capitalization on the login page [#3252](https://github.com/jupyterhub/jupyterhub/pull/3252) ([@cmd-ntrf](https://github.com/cmd-ntrf)) #### Bugs fixed -* Fix RootHandler when default_url is a callable [#3265](https://github.com/jupyterhub/jupyterhub/pull/3265) ([@danlester](https://github.com/danlester)) -* Only preserve params when ?next= is unspecified [#3261](https://github.com/jupyterhub/jupyterhub/pull/3261) ([@minrk](https://github.com/minrk)) -* \[Windows\] Improve robustness when detecting and closing existing proxy processes [#3237](https://github.com/jupyterhub/jupyterhub/pull/3237) ([@alexweav](https://github.com/alexweav)) +- Fix RootHandler when default_url is a callable [#3265](https://github.com/jupyterhub/jupyterhub/pull/3265) ([@danlester](https://github.com/danlester)) +- Only preserve params when ?next= is unspecified [#3261](https://github.com/jupyterhub/jupyterhub/pull/3261) ([@minrk](https://github.com/minrk)) +- \[Windows\] Improve robustness when detecting and closing existing proxy processes [#3237](https://github.com/jupyterhub/jupyterhub/pull/3237) ([@alexweav](https://github.com/alexweav)) #### Maintenance and upkeep improvements -* Environment marker on pamela [#3255](https://github.com/jupyterhub/jupyterhub/pull/3255) ([@fcollonval](https://github.com/fcollonval)) -* remove push-branch conditions for CI [#3250](https://github.com/jupyterhub/jupyterhub/pull/3250) ([@minrk](https://github.com/minrk)) -* Migrate from travis to GitHub actions [#3246](https://github.com/jupyterhub/jupyterhub/pull/3246) ([@consideRatio](https://github.com/consideRatio)) +- Environment marker on pamela [#3255](https://github.com/jupyterhub/jupyterhub/pull/3255) ([@fcollonval](https://github.com/fcollonval)) +- remove push-branch conditions for CI [#3250](https://github.com/jupyterhub/jupyterhub/pull/3250) ([@minrk](https://github.com/minrk)) +- Migrate from travis to GitHub actions [#3246](https://github.com/jupyterhub/jupyterhub/pull/3246) ([@consideRatio](https://github.com/consideRatio)) #### Documentation improvements -* Update services-basics.md to use jupyterhub_idle_culler [#3257](https://github.com/jupyterhub/jupyterhub/pull/3257) ([@manics](https://github.com/manics)) +- Update services-basics.md to use jupyterhub_idle_culler [#3257](https://github.com/jupyterhub/jupyterhub/pull/3257) ([@manics](https://github.com/manics)) #### Contributors to this release @@ -95,7 +92,6 @@ JupyterHub 1.3 is a small feature release. Highlights include: [@alexweav](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aalexweav+updated%3A2020-10-30..2020-11-27&type=Issues) | [@belfhi](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Abelfhi+updated%3A2020-10-30..2020-11-27&type=Issues) | [@betatim](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Abetatim+updated%3A2020-10-30..2020-11-27&type=Issues) | [@cmd-ntrf](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Acmd-ntrf+updated%3A2020-10-30..2020-11-27&type=Issues) | [@consideRatio](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AconsideRatio+updated%3A2020-10-30..2020-11-27&type=Issues) | [@danlester](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Adanlester+updated%3A2020-10-30..2020-11-27&type=Issues) | [@fcollonval](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Afcollonval+updated%3A2020-10-30..2020-11-27&type=Issues) | [@GeorgianaElena](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AGeorgianaElena+updated%3A2020-10-30..2020-11-27&type=Issues) | [@ianabc](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aianabc+updated%3A2020-10-30..2020-11-27&type=Issues) | [@IvanaH8](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AIvanaH8+updated%3A2020-10-30..2020-11-27&type=Issues) | [@manics](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Amanics+updated%3A2020-10-30..2020-11-27&type=Issues) | [@meeseeksmachine](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ameeseeksmachine+updated%3A2020-10-30..2020-11-27&type=Issues) | [@minrk](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aminrk+updated%3A2020-10-30..2020-11-27&type=Issues) | [@mriedem](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Amriedem+updated%3A2020-10-30..2020-11-27&type=Issues) | [@olifre](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aolifre+updated%3A2020-10-30..2020-11-27&type=Issues) | [@rcthomas](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Arcthomas+updated%3A2020-10-30..2020-11-27&type=Issues) | [@rgbkrk](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Argbkrk+updated%3A2020-10-30..2020-11-27&type=Issues) | [@rkdarst](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Arkdarst+updated%3A2020-10-30..2020-11-27&type=Issues) | [@slemonide](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aslemonide+updated%3A2020-10-30..2020-11-27&type=Issues) | [@support](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Asupport+updated%3A2020-10-30..2020-11-27&type=Issues) | [@welcome](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Awelcome+updated%3A2020-10-30..2020-11-27&type=Issues) | [@yuvipanda](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ayuvipanda+updated%3A2020-10-30..2020-11-27&type=Issues) - ### [1.2.1] 2020-10-30 ([full changelog](https://github.com/jupyterhub/jupyterhub/compare/1.2.0...1.2.1)) @@ -129,130 +125,134 @@ Highlights: ([full changelog](https://github.com/jupyterhub/jupyterhub/compare/1.1.0...1.2.0)) - #### Enhancements made -* make pagination configurable [#3229](https://github.com/jupyterhub/jupyterhub/pull/3229) ([@minrk](https://github.com/minrk)) -* Make api_request to CHP's REST API more reliable [#3223](https://github.com/jupyterhub/jupyterhub/pull/3223) ([@consideRatio](https://github.com/consideRatio)) -* Control service display [#3160](https://github.com/jupyterhub/jupyterhub/pull/3160) ([@rcthomas](https://github.com/rcthomas)) -* Add a footer block + wrap the admin footer in this block [#3136](https://github.com/jupyterhub/jupyterhub/pull/3136) ([@pabepadu](https://github.com/pabepadu)) -* Allow JupyterHub.default_url to be a callable [#3133](https://github.com/jupyterhub/jupyterhub/pull/3133) ([@danlester](https://github.com/danlester)) -* Allow head requests for the health endpoint [#3131](https://github.com/jupyterhub/jupyterhub/pull/3131) ([@rkevin-arch](https://github.com/rkevin-arch)) -* Hide hamburger button menu in mobile/responsive mode and fix other minor issues [#3103](https://github.com/jupyterhub/jupyterhub/pull/3103) ([@kinow](https://github.com/kinow)) -* build jupyterhub/jupyterhub-demo image on docker hub [#3083](https://github.com/jupyterhub/jupyterhub/pull/3083) ([@minrk](https://github.com/minrk)) -* Add JupyterHub Demo docker image [#3059](https://github.com/jupyterhub/jupyterhub/pull/3059) ([@GeorgianaElena](https://github.com/GeorgianaElena)) -* Warn if both bind_url and ip/port/base_url are set [#3057](https://github.com/jupyterhub/jupyterhub/pull/3057) ([@GeorgianaElena](https://github.com/GeorgianaElena)) -* UI Feedback on Submit [#3028](https://github.com/jupyterhub/jupyterhub/pull/3028) ([@possiblyMikeB](https://github.com/possiblyMikeB)) -* Support kubespawner running on a IPv6 only cluster [#3020](https://github.com/jupyterhub/jupyterhub/pull/3020) ([@stv0g](https://github.com/stv0g)) -* Spawn with options passed in query arguments to /spawn [#3013](https://github.com/jupyterhub/jupyterhub/pull/3013) ([@twalcari](https://github.com/twalcari)) -* SpawnHandler POST with user form options displays the spawn-pending page [#2978](https://github.com/jupyterhub/jupyterhub/pull/2978) ([@danlester](https://github.com/danlester)) -* Start named servers by pressing the Enter key [#2960](https://github.com/jupyterhub/jupyterhub/pull/2960) ([@jtpio](https://github.com/jtpio)) -* Keep the URL fragments after spawning an application [#2952](https://github.com/jupyterhub/jupyterhub/pull/2952) ([@kinow](https://github.com/kinow)) -* Allow implicit spawn via javascript redirect [#2941](https://github.com/jupyterhub/jupyterhub/pull/2941) ([@minrk](https://github.com/minrk)) -* make init_spawners check O(running servers) not O(total users) [#2936](https://github.com/jupyterhub/jupyterhub/pull/2936) ([@minrk](https://github.com/minrk)) -* Add favicon to the base page template [#2930](https://github.com/jupyterhub/jupyterhub/pull/2930) ([@JohnPaton](https://github.com/JohnPaton)) -* Adding pagination in the admin panel [#2929](https://github.com/jupyterhub/jupyterhub/pull/2929) ([@cbjuan](https://github.com/cbjuan)) -* Generate prometheus metrics docs [#2891](https://github.com/jupyterhub/jupyterhub/pull/2891) ([@rajat404](https://github.com/rajat404)) -* Add support for Jupyter Server [#2601](https://github.com/jupyterhub/jupyterhub/pull/2601) ([@yuvipanda](https://github.com/yuvipanda)) + +- make pagination configurable [#3229](https://github.com/jupyterhub/jupyterhub/pull/3229) ([@minrk](https://github.com/minrk)) +- Make api_request to CHP's REST API more reliable [#3223](https://github.com/jupyterhub/jupyterhub/pull/3223) ([@consideRatio](https://github.com/consideRatio)) +- Control service display [#3160](https://github.com/jupyterhub/jupyterhub/pull/3160) ([@rcthomas](https://github.com/rcthomas)) +- Add a footer block + wrap the admin footer in this block [#3136](https://github.com/jupyterhub/jupyterhub/pull/3136) ([@pabepadu](https://github.com/pabepadu)) +- Allow JupyterHub.default_url to be a callable [#3133](https://github.com/jupyterhub/jupyterhub/pull/3133) ([@danlester](https://github.com/danlester)) +- Allow head requests for the health endpoint [#3131](https://github.com/jupyterhub/jupyterhub/pull/3131) ([@rkevin-arch](https://github.com/rkevin-arch)) +- Hide hamburger button menu in mobile/responsive mode and fix other minor issues [#3103](https://github.com/jupyterhub/jupyterhub/pull/3103) ([@kinow](https://github.com/kinow)) +- build jupyterhub/jupyterhub-demo image on docker hub [#3083](https://github.com/jupyterhub/jupyterhub/pull/3083) ([@minrk](https://github.com/minrk)) +- Add JupyterHub Demo docker image [#3059](https://github.com/jupyterhub/jupyterhub/pull/3059) ([@GeorgianaElena](https://github.com/GeorgianaElena)) +- Warn if both bind_url and ip/port/base_url are set [#3057](https://github.com/jupyterhub/jupyterhub/pull/3057) ([@GeorgianaElena](https://github.com/GeorgianaElena)) +- UI Feedback on Submit [#3028](https://github.com/jupyterhub/jupyterhub/pull/3028) ([@possiblyMikeB](https://github.com/possiblyMikeB)) +- Support kubespawner running on a IPv6 only cluster [#3020](https://github.com/jupyterhub/jupyterhub/pull/3020) ([@stv0g](https://github.com/stv0g)) +- Spawn with options passed in query arguments to /spawn [#3013](https://github.com/jupyterhub/jupyterhub/pull/3013) ([@twalcari](https://github.com/twalcari)) +- SpawnHandler POST with user form options displays the spawn-pending page [#2978](https://github.com/jupyterhub/jupyterhub/pull/2978) ([@danlester](https://github.com/danlester)) +- Start named servers by pressing the Enter key [#2960](https://github.com/jupyterhub/jupyterhub/pull/2960) ([@jtpio](https://github.com/jtpio)) +- Keep the URL fragments after spawning an application [#2952](https://github.com/jupyterhub/jupyterhub/pull/2952) ([@kinow](https://github.com/kinow)) +- Allow implicit spawn via javascript redirect [#2941](https://github.com/jupyterhub/jupyterhub/pull/2941) ([@minrk](https://github.com/minrk)) +- make init_spawners check O(running servers) not O(total users) [#2936](https://github.com/jupyterhub/jupyterhub/pull/2936) ([@minrk](https://github.com/minrk)) +- Add favicon to the base page template [#2930](https://github.com/jupyterhub/jupyterhub/pull/2930) ([@JohnPaton](https://github.com/JohnPaton)) +- Adding pagination in the admin panel [#2929](https://github.com/jupyterhub/jupyterhub/pull/2929) ([@cbjuan](https://github.com/cbjuan)) +- Generate prometheus metrics docs [#2891](https://github.com/jupyterhub/jupyterhub/pull/2891) ([@rajat404](https://github.com/rajat404)) +- Add support for Jupyter Server [#2601](https://github.com/jupyterhub/jupyterhub/pull/2601) ([@yuvipanda](https://github.com/yuvipanda)) #### Bugs fixed -* Fix #2284 must be sent from authorization page [#3219](https://github.com/jupyterhub/jupyterhub/pull/3219) ([@elgalu](https://github.com/elgalu)) -* avoid specifying default_value=None in Command traits [#3208](https://github.com/jupyterhub/jupyterhub/pull/3208) ([@minrk](https://github.com/minrk)) -* Prevent OverflowErrors in exponential_backoff() [#3204](https://github.com/jupyterhub/jupyterhub/pull/3204) ([@kreuzert](https://github.com/kreuzert)) -* update prometheus metrics for server spawn when it fails with exception [#3150](https://github.com/jupyterhub/jupyterhub/pull/3150) ([@yhal-nesi](https://github.com/yhal-nesi)) -* jupyterhub/utils: Load system default CA certificates in make_ssl_context [#3140](https://github.com/jupyterhub/jupyterhub/pull/3140) ([@chancez](https://github.com/chancez)) -* admin page sorts on spawner last_activity instead of user last_activity [#3137](https://github.com/jupyterhub/jupyterhub/pull/3137) ([@lydian](https://github.com/lydian)) -* Fix the services dropdown on the admin page [#3132](https://github.com/jupyterhub/jupyterhub/pull/3132) ([@pabepadu](https://github.com/pabepadu)) -* Don't log a warning when slow_spawn_timeout is disabled [#3127](https://github.com/jupyterhub/jupyterhub/pull/3127) ([@mriedem](https://github.com/mriedem)) -* app.py: Work around incompatibility between Tornado 6 and asyncio proactor event loop in python 3.8 on Windows [#3123](https://github.com/jupyterhub/jupyterhub/pull/3123) ([@alexweav](https://github.com/alexweav)) -* jupyterhub/user: clear spawner state after post_stop_hook [#3121](https://github.com/jupyterhub/jupyterhub/pull/3121) ([@rkdarst](https://github.com/rkdarst)) -* fix for stopping named server deleting default server and tests [#3109](https://github.com/jupyterhub/jupyterhub/pull/3109) ([@kxiao-fn](https://github.com/kxiao-fn)) -* Hide hamburger button menu in mobile/responsive mode and fix other minor issues [#3103](https://github.com/jupyterhub/jupyterhub/pull/3103) ([@kinow](https://github.com/kinow)) -* Rename Authenticator.white/blacklist to allowed/blocked [#3090](https://github.com/jupyterhub/jupyterhub/pull/3090) ([@minrk](https://github.com/minrk)) -* Include the query string parameters when redirecting to a new URL [#3089](https://github.com/jupyterhub/jupyterhub/pull/3089) ([@kinow](https://github.com/kinow)) -* Make `delete_invalid_users` configurable [#3087](https://github.com/jupyterhub/jupyterhub/pull/3087) ([@fcollonval](https://github.com/fcollonval)) -* Ensure client dependencies build before wheel [#3082](https://github.com/jupyterhub/jupyterhub/pull/3082) ([@diurnalist](https://github.com/diurnalist)) -* make Spawner.environment config highest priority [#3081](https://github.com/jupyterhub/jupyterhub/pull/3081) ([@minrk](https://github.com/minrk)) -* Changing start my server button link to spawn url once server is stopped [#3042](https://github.com/jupyterhub/jupyterhub/pull/3042) ([@rabsr](https://github.com/rabsr)) -* Fix CSS on admin page version listing [#3035](https://github.com/jupyterhub/jupyterhub/pull/3035) ([@vilhelmen](https://github.com/vilhelmen)) -* Fix user_row endblock in admin template [#3015](https://github.com/jupyterhub/jupyterhub/pull/3015) ([@jtpio](https://github.com/jtpio)) -* Fix --generate-config bug when specifying a filename [#2907](https://github.com/jupyterhub/jupyterhub/pull/2907) ([@consideRatio](https://github.com/consideRatio)) -* Handle the protocol when ssl is enabled and log the right URL [#2773](https://github.com/jupyterhub/jupyterhub/pull/2773) ([@kinow](https://github.com/kinow)) + +- Fix #2284 must be sent from authorization page [#3219](https://github.com/jupyterhub/jupyterhub/pull/3219) ([@elgalu](https://github.com/elgalu)) +- avoid specifying default_value=None in Command traits [#3208](https://github.com/jupyterhub/jupyterhub/pull/3208) ([@minrk](https://github.com/minrk)) +- Prevent OverflowErrors in exponential_backoff() [#3204](https://github.com/jupyterhub/jupyterhub/pull/3204) ([@kreuzert](https://github.com/kreuzert)) +- update prometheus metrics for server spawn when it fails with exception [#3150](https://github.com/jupyterhub/jupyterhub/pull/3150) ([@yhal-nesi](https://github.com/yhal-nesi)) +- jupyterhub/utils: Load system default CA certificates in make_ssl_context [#3140](https://github.com/jupyterhub/jupyterhub/pull/3140) ([@chancez](https://github.com/chancez)) +- admin page sorts on spawner last_activity instead of user last_activity [#3137](https://github.com/jupyterhub/jupyterhub/pull/3137) ([@lydian](https://github.com/lydian)) +- Fix the services dropdown on the admin page [#3132](https://github.com/jupyterhub/jupyterhub/pull/3132) ([@pabepadu](https://github.com/pabepadu)) +- Don't log a warning when slow_spawn_timeout is disabled [#3127](https://github.com/jupyterhub/jupyterhub/pull/3127) ([@mriedem](https://github.com/mriedem)) +- app.py: Work around incompatibility between Tornado 6 and asyncio proactor event loop in python 3.8 on Windows [#3123](https://github.com/jupyterhub/jupyterhub/pull/3123) ([@alexweav](https://github.com/alexweav)) +- jupyterhub/user: clear spawner state after post_stop_hook [#3121](https://github.com/jupyterhub/jupyterhub/pull/3121) ([@rkdarst](https://github.com/rkdarst)) +- fix for stopping named server deleting default server and tests [#3109](https://github.com/jupyterhub/jupyterhub/pull/3109) ([@kxiao-fn](https://github.com/kxiao-fn)) +- Hide hamburger button menu in mobile/responsive mode and fix other minor issues [#3103](https://github.com/jupyterhub/jupyterhub/pull/3103) ([@kinow](https://github.com/kinow)) +- Rename Authenticator.white/blacklist to allowed/blocked [#3090](https://github.com/jupyterhub/jupyterhub/pull/3090) ([@minrk](https://github.com/minrk)) +- Include the query string parameters when redirecting to a new URL [#3089](https://github.com/jupyterhub/jupyterhub/pull/3089) ([@kinow](https://github.com/kinow)) +- Make `delete_invalid_users` configurable [#3087](https://github.com/jupyterhub/jupyterhub/pull/3087) ([@fcollonval](https://github.com/fcollonval)) +- Ensure client dependencies build before wheel [#3082](https://github.com/jupyterhub/jupyterhub/pull/3082) ([@diurnalist](https://github.com/diurnalist)) +- make Spawner.environment config highest priority [#3081](https://github.com/jupyterhub/jupyterhub/pull/3081) ([@minrk](https://github.com/minrk)) +- Changing start my server button link to spawn url once server is stopped [#3042](https://github.com/jupyterhub/jupyterhub/pull/3042) ([@rabsr](https://github.com/rabsr)) +- Fix CSS on admin page version listing [#3035](https://github.com/jupyterhub/jupyterhub/pull/3035) ([@vilhelmen](https://github.com/vilhelmen)) +- Fix user_row endblock in admin template [#3015](https://github.com/jupyterhub/jupyterhub/pull/3015) ([@jtpio](https://github.com/jtpio)) +- Fix --generate-config bug when specifying a filename [#2907](https://github.com/jupyterhub/jupyterhub/pull/2907) ([@consideRatio](https://github.com/consideRatio)) +- Handle the protocol when ssl is enabled and log the right URL [#2773](https://github.com/jupyterhub/jupyterhub/pull/2773) ([@kinow](https://github.com/kinow)) #### Maintenance and upkeep improvements -* Update travis-ci badge in README.md [#3232](https://github.com/jupyterhub/jupyterhub/pull/3232) ([@consideRatio](https://github.com/consideRatio)) -* stop building docs on circleci [#3209](https://github.com/jupyterhub/jupyterhub/pull/3209) ([@minrk](https://github.com/minrk)) -* Upgraded Jquery dep [#3174](https://github.com/jupyterhub/jupyterhub/pull/3174) ([@AngelOnFira](https://github.com/AngelOnFira)) -* Don't allow 'python:3.8 + master dependencies' to fail [#3157](https://github.com/jupyterhub/jupyterhub/pull/3157) ([@manics](https://github.com/manics)) -* Update Dockerfile to ubuntu:focal (Python 3.8) [#3156](https://github.com/jupyterhub/jupyterhub/pull/3156) ([@manics](https://github.com/manics)) -* Simplify code of the health check handler [#3149](https://github.com/jupyterhub/jupyterhub/pull/3149) ([@betatim](https://github.com/betatim)) -* Get error description from error key vs error_description key [#3147](https://github.com/jupyterhub/jupyterhub/pull/3147) ([@jgwerner](https://github.com/jgwerner)) -* Implement singleuser with mixins [#3128](https://github.com/jupyterhub/jupyterhub/pull/3128) ([@minrk](https://github.com/minrk)) -* only build tagged versions on docker tags [#3118](https://github.com/jupyterhub/jupyterhub/pull/3118) ([@minrk](https://github.com/minrk)) -* Log slow_stop_timeout when hit like slow_spawn_timeout [#3111](https://github.com/jupyterhub/jupyterhub/pull/3111) ([@mriedem](https://github.com/mriedem)) -* loosen jupyter-telemetry pin [#3102](https://github.com/jupyterhub/jupyterhub/pull/3102) ([@minrk](https://github.com/minrk)) -* Remove old context-less print statement [#3100](https://github.com/jupyterhub/jupyterhub/pull/3100) ([@mriedem](https://github.com/mriedem)) -* Allow `python:3.8 + master dependencies` to fail [#3079](https://github.com/jupyterhub/jupyterhub/pull/3079) ([@manics](https://github.com/manics)) -* Test with some master dependencies. [#3076](https://github.com/jupyterhub/jupyterhub/pull/3076) ([@Carreau](https://github.com/Carreau)) -* synchronize implementation of expiring values [#3072](https://github.com/jupyterhub/jupyterhub/pull/3072) ([@minrk](https://github.com/minrk)) -* More consistent behavior for UserDict.get and `key in UserDict` [#3071](https://github.com/jupyterhub/jupyterhub/pull/3071) ([@minrk](https://github.com/minrk)) -* pin jupyter_telemetry dependency [#3067](https://github.com/jupyterhub/jupyterhub/pull/3067) ([@Zsailer](https://github.com/Zsailer)) -* Use the issue templates from the central repo [#3056](https://github.com/jupyterhub/jupyterhub/pull/3056) ([@GeorgianaElena](https://github.com/GeorgianaElena)) -* Update links to the black GitHub repository [#3054](https://github.com/jupyterhub/jupyterhub/pull/3054) ([@jtpio](https://github.com/jtpio)) -* Log successful /health requests as debug level [#3047](https://github.com/jupyterhub/jupyterhub/pull/3047) ([@consideRatio](https://github.com/consideRatio)) -* Fix broken test due to BeautifulSoup 4.9.0 behavior change [#3025](https://github.com/jupyterhub/jupyterhub/pull/3025) ([@twalcari](https://github.com/twalcari)) -* Remove unused imports [#3019](https://github.com/jupyterhub/jupyterhub/pull/3019) ([@stv0g](https://github.com/stv0g)) -* Use pip instead of conda for building the docs on RTD [#3010](https://github.com/jupyterhub/jupyterhub/pull/3010) ([@GeorgianaElena](https://github.com/GeorgianaElena)) -* Avoid redundant logging of jupyterhub version mismatches [#2971](https://github.com/jupyterhub/jupyterhub/pull/2971) ([@mriedem](https://github.com/mriedem)) -* Add .vscode to gitignore [#2959](https://github.com/jupyterhub/jupyterhub/pull/2959) ([@jtpio](https://github.com/jtpio)) -* preserve auth type when logging obfuscated auth header [#2953](https://github.com/jupyterhub/jupyterhub/pull/2953) ([@minrk](https://github.com/minrk)) -* make spawner:server relationship explicitly one to one [#2944](https://github.com/jupyterhub/jupyterhub/pull/2944) ([@minrk](https://github.com/minrk)) -* Add what we need with some margin to Dockerfile's build stage [#2905](https://github.com/jupyterhub/jupyterhub/pull/2905) ([@consideRatio](https://github.com/consideRatio)) -* bump reorder-imports hook [#2899](https://github.com/jupyterhub/jupyterhub/pull/2899) ([@minrk](https://github.com/minrk)) + +- Update travis-ci badge in README.md [#3232](https://github.com/jupyterhub/jupyterhub/pull/3232) ([@consideRatio](https://github.com/consideRatio)) +- stop building docs on circleci [#3209](https://github.com/jupyterhub/jupyterhub/pull/3209) ([@minrk](https://github.com/minrk)) +- Upgraded Jquery dep [#3174](https://github.com/jupyterhub/jupyterhub/pull/3174) ([@AngelOnFira](https://github.com/AngelOnFira)) +- Don't allow 'python:3.8 + master dependencies' to fail [#3157](https://github.com/jupyterhub/jupyterhub/pull/3157) ([@manics](https://github.com/manics)) +- Update Dockerfile to ubuntu:focal (Python 3.8) [#3156](https://github.com/jupyterhub/jupyterhub/pull/3156) ([@manics](https://github.com/manics)) +- Simplify code of the health check handler [#3149](https://github.com/jupyterhub/jupyterhub/pull/3149) ([@betatim](https://github.com/betatim)) +- Get error description from error key vs error_description key [#3147](https://github.com/jupyterhub/jupyterhub/pull/3147) ([@jgwerner](https://github.com/jgwerner)) +- Implement singleuser with mixins [#3128](https://github.com/jupyterhub/jupyterhub/pull/3128) ([@minrk](https://github.com/minrk)) +- only build tagged versions on docker tags [#3118](https://github.com/jupyterhub/jupyterhub/pull/3118) ([@minrk](https://github.com/minrk)) +- Log slow_stop_timeout when hit like slow_spawn_timeout [#3111](https://github.com/jupyterhub/jupyterhub/pull/3111) ([@mriedem](https://github.com/mriedem)) +- loosen jupyter-telemetry pin [#3102](https://github.com/jupyterhub/jupyterhub/pull/3102) ([@minrk](https://github.com/minrk)) +- Remove old context-less print statement [#3100](https://github.com/jupyterhub/jupyterhub/pull/3100) ([@mriedem](https://github.com/mriedem)) +- Allow `python:3.8 + master dependencies` to fail [#3079](https://github.com/jupyterhub/jupyterhub/pull/3079) ([@manics](https://github.com/manics)) +- Test with some master dependencies. [#3076](https://github.com/jupyterhub/jupyterhub/pull/3076) ([@Carreau](https://github.com/Carreau)) +- synchronize implementation of expiring values [#3072](https://github.com/jupyterhub/jupyterhub/pull/3072) ([@minrk](https://github.com/minrk)) +- More consistent behavior for UserDict.get and `key in UserDict` [#3071](https://github.com/jupyterhub/jupyterhub/pull/3071) ([@minrk](https://github.com/minrk)) +- pin jupyter_telemetry dependency [#3067](https://github.com/jupyterhub/jupyterhub/pull/3067) ([@Zsailer](https://github.com/Zsailer)) +- Use the issue templates from the central repo [#3056](https://github.com/jupyterhub/jupyterhub/pull/3056) ([@GeorgianaElena](https://github.com/GeorgianaElena)) +- Update links to the black GitHub repository [#3054](https://github.com/jupyterhub/jupyterhub/pull/3054) ([@jtpio](https://github.com/jtpio)) +- Log successful /health requests as debug level [#3047](https://github.com/jupyterhub/jupyterhub/pull/3047) ([@consideRatio](https://github.com/consideRatio)) +- Fix broken test due to BeautifulSoup 4.9.0 behavior change [#3025](https://github.com/jupyterhub/jupyterhub/pull/3025) ([@twalcari](https://github.com/twalcari)) +- Remove unused imports [#3019](https://github.com/jupyterhub/jupyterhub/pull/3019) ([@stv0g](https://github.com/stv0g)) +- Use pip instead of conda for building the docs on RTD [#3010](https://github.com/jupyterhub/jupyterhub/pull/3010) ([@GeorgianaElena](https://github.com/GeorgianaElena)) +- Avoid redundant logging of jupyterhub version mismatches [#2971](https://github.com/jupyterhub/jupyterhub/pull/2971) ([@mriedem](https://github.com/mriedem)) +- Add .vscode to gitignore [#2959](https://github.com/jupyterhub/jupyterhub/pull/2959) ([@jtpio](https://github.com/jtpio)) +- preserve auth type when logging obfuscated auth header [#2953](https://github.com/jupyterhub/jupyterhub/pull/2953) ([@minrk](https://github.com/minrk)) +- make spawner:server relationship explicitly one to one [#2944](https://github.com/jupyterhub/jupyterhub/pull/2944) ([@minrk](https://github.com/minrk)) +- Add what we need with some margin to Dockerfile's build stage [#2905](https://github.com/jupyterhub/jupyterhub/pull/2905) ([@consideRatio](https://github.com/consideRatio)) +- bump reorder-imports hook [#2899](https://github.com/jupyterhub/jupyterhub/pull/2899) ([@minrk](https://github.com/minrk)) #### Documentation improvements -* Fix typo in documentation [#3226](https://github.com/jupyterhub/jupyterhub/pull/3226) ([@xlotlu](https://github.com/xlotlu)) -* [docs] Remove duplicate line in changelog for 1.1.0 [#3207](https://github.com/jupyterhub/jupyterhub/pull/3207) ([@kinow](https://github.com/kinow)) -* changelog for 1.2.0b1 [#3192](https://github.com/jupyterhub/jupyterhub/pull/3192) ([@consideRatio](https://github.com/consideRatio)) -* Add SELinux configuration for nginx [#3185](https://github.com/jupyterhub/jupyterhub/pull/3185) ([@rainwoodman](https://github.com/rainwoodman)) -* Mention the PAM pitfall on fedora. [#3184](https://github.com/jupyterhub/jupyterhub/pull/3184) ([@rainwoodman](https://github.com/rainwoodman)) -* Added extra documentation for endpoint /users/{name}/servers/{server_name}. [#3159](https://github.com/jupyterhub/jupyterhub/pull/3159) ([@synchronizing](https://github.com/synchronizing)) -* docs: please docs linter (move_cert docstring) [#3151](https://github.com/jupyterhub/jupyterhub/pull/3151) ([@consideRatio](https://github.com/consideRatio)) -* Needed NoEsacpe (NE) option for apache [#3143](https://github.com/jupyterhub/jupyterhub/pull/3143) ([@basvandervlies](https://github.com/basvandervlies)) -* Document external service api_tokens better [#3142](https://github.com/jupyterhub/jupyterhub/pull/3142) ([@snickell](https://github.com/snickell)) -* Remove idle culler example [#3114](https://github.com/jupyterhub/jupyterhub/pull/3114) ([@yuvipanda](https://github.com/yuvipanda)) -* docs: unsqueeze logo, remove unused CSS and templates [#3107](https://github.com/jupyterhub/jupyterhub/pull/3107) ([@consideRatio](https://github.com/consideRatio)) -* Update version in docs/rest-api.yaml [#3104](https://github.com/jupyterhub/jupyterhub/pull/3104) ([@cmd-ntrf](https://github.com/cmd-ntrf)) -* Replace zonca/remotespawner with NERSC/sshspawner [#3086](https://github.com/jupyterhub/jupyterhub/pull/3086) ([@manics](https://github.com/manics)) -* Remove already done named servers from roadmap [#3084](https://github.com/jupyterhub/jupyterhub/pull/3084) ([@elgalu](https://github.com/elgalu)) -* proxy settings might cause authentication errors [#3078](https://github.com/jupyterhub/jupyterhub/pull/3078) ([@gatoniel](https://github.com/gatoniel)) -* Add Configuration Reference section to docs [#3077](https://github.com/jupyterhub/jupyterhub/pull/3077) ([@kinow](https://github.com/kinow)) -* document upgrading from api_tokens to services config [#3055](https://github.com/jupyterhub/jupyterhub/pull/3055) ([@minrk](https://github.com/minrk)) -* [Docs] Disable proxy_buffering when using nginx reverse proxy [#3048](https://github.com/jupyterhub/jupyterhub/pull/3048) ([@mhwasil](https://github.com/mhwasil)) -* docs: add proxy_http_version 1.1 [#3046](https://github.com/jupyterhub/jupyterhub/pull/3046) ([@ceocoder](https://github.com/ceocoder)) -* #1018 PAM added in prerequisites [#3040](https://github.com/jupyterhub/jupyterhub/pull/3040) ([@romainx](https://github.com/romainx)) -* Fix use of auxiliary verb on index.rst [#3022](https://github.com/jupyterhub/jupyterhub/pull/3022) ([@joshmeek](https://github.com/joshmeek)) -* Fix docs CI test failure: duplicate object description [#3021](https://github.com/jupyterhub/jupyterhub/pull/3021) ([@rkdarst](https://github.com/rkdarst)) -* Update issue templates [#3001](https://github.com/jupyterhub/jupyterhub/pull/3001) ([@GeorgianaElena](https://github.com/GeorgianaElena)) -* fix wrong name on firewall [#2997](https://github.com/jupyterhub/jupyterhub/pull/2997) ([@thuvh](https://github.com/thuvh)) -* updating docs theme [#2995](https://github.com/jupyterhub/jupyterhub/pull/2995) ([@choldgraf](https://github.com/choldgraf)) -* Update contributor docs [#2972](https://github.com/jupyterhub/jupyterhub/pull/2972) ([@mriedem](https://github.com/mriedem)) -* Server.user_options rest-api documented [#2966](https://github.com/jupyterhub/jupyterhub/pull/2966) ([@mriedem](https://github.com/mriedem)) -* Pin sphinx theme [#2956](https://github.com/jupyterhub/jupyterhub/pull/2956) ([@manics](https://github.com/manics)) -* [doc] Fix couple typos in the documentation [#2951](https://github.com/jupyterhub/jupyterhub/pull/2951) ([@kinow](https://github.com/kinow)) -* Docs: Fixed grammar on landing page [#2950](https://github.com/jupyterhub/jupyterhub/pull/2950) ([@alexdriedger](https://github.com/alexdriedger)) -* add general faq [#2946](https://github.com/jupyterhub/jupyterhub/pull/2946) ([@minrk](https://github.com/minrk)) -* docs: use metachannel for faster environment solve [#2943](https://github.com/jupyterhub/jupyterhub/pull/2943) ([@minrk](https://github.com/minrk)) -* update docs environments [#2942](https://github.com/jupyterhub/jupyterhub/pull/2942) ([@minrk](https://github.com/minrk)) -* [doc] Add more docs about Cookies used for authentication in JupyterHub [#2940](https://github.com/jupyterhub/jupyterhub/pull/2940) ([@kinow](https://github.com/kinow)) -* [doc] Use fixed commit plus line number in github link [#2939](https://github.com/jupyterhub/jupyterhub/pull/2939) ([@kinow](https://github.com/kinow)) -* [doc] Fix link to SSL encryption from troubleshooting page [#2938](https://github.com/jupyterhub/jupyterhub/pull/2938) ([@kinow](https://github.com/kinow)) -* rest api: fix schema for remove parameter in rest api [#2917](https://github.com/jupyterhub/jupyterhub/pull/2917) ([@minrk](https://github.com/minrk)) -* Add troubleshooting topics [#2914](https://github.com/jupyterhub/jupyterhub/pull/2914) ([@jgwerner](https://github.com/jgwerner)) -* Several fixes to the doc [#2904](https://github.com/jupyterhub/jupyterhub/pull/2904) ([@reneluria](https://github.com/reneluria)) -* fix: 'Non-ASCII character '\xc3' [#2901](https://github.com/jupyterhub/jupyterhub/pull/2901) ([@jgwerner](https://github.com/jgwerner)) -* Generate prometheus metrics docs [#2891](https://github.com/jupyterhub/jupyterhub/pull/2891) ([@rajat404](https://github.com/rajat404)) + +- Fix typo in documentation [#3226](https://github.com/jupyterhub/jupyterhub/pull/3226) ([@xlotlu](https://github.com/xlotlu)) +- [docs] Remove duplicate line in changelog for 1.1.0 [#3207](https://github.com/jupyterhub/jupyterhub/pull/3207) ([@kinow](https://github.com/kinow)) +- changelog for 1.2.0b1 [#3192](https://github.com/jupyterhub/jupyterhub/pull/3192) ([@consideRatio](https://github.com/consideRatio)) +- Add SELinux configuration for nginx [#3185](https://github.com/jupyterhub/jupyterhub/pull/3185) ([@rainwoodman](https://github.com/rainwoodman)) +- Mention the PAM pitfall on fedora. [#3184](https://github.com/jupyterhub/jupyterhub/pull/3184) ([@rainwoodman](https://github.com/rainwoodman)) +- Added extra documentation for endpoint /users/{name}/servers/{server_name}. [#3159](https://github.com/jupyterhub/jupyterhub/pull/3159) ([@synchronizing](https://github.com/synchronizing)) +- docs: please docs linter (move_cert docstring) [#3151](https://github.com/jupyterhub/jupyterhub/pull/3151) ([@consideRatio](https://github.com/consideRatio)) +- Needed NoEsacpe (NE) option for apache [#3143](https://github.com/jupyterhub/jupyterhub/pull/3143) ([@basvandervlies](https://github.com/basvandervlies)) +- Document external service api_tokens better [#3142](https://github.com/jupyterhub/jupyterhub/pull/3142) ([@snickell](https://github.com/snickell)) +- Remove idle culler example [#3114](https://github.com/jupyterhub/jupyterhub/pull/3114) ([@yuvipanda](https://github.com/yuvipanda)) +- docs: unsqueeze logo, remove unused CSS and templates [#3107](https://github.com/jupyterhub/jupyterhub/pull/3107) ([@consideRatio](https://github.com/consideRatio)) +- Update version in docs/rest-api.yaml [#3104](https://github.com/jupyterhub/jupyterhub/pull/3104) ([@cmd-ntrf](https://github.com/cmd-ntrf)) +- Replace zonca/remotespawner with NERSC/sshspawner [#3086](https://github.com/jupyterhub/jupyterhub/pull/3086) ([@manics](https://github.com/manics)) +- Remove already done named servers from roadmap [#3084](https://github.com/jupyterhub/jupyterhub/pull/3084) ([@elgalu](https://github.com/elgalu)) +- proxy settings might cause authentication errors [#3078](https://github.com/jupyterhub/jupyterhub/pull/3078) ([@gatoniel](https://github.com/gatoniel)) +- Add Configuration Reference section to docs [#3077](https://github.com/jupyterhub/jupyterhub/pull/3077) ([@kinow](https://github.com/kinow)) +- document upgrading from api_tokens to services config [#3055](https://github.com/jupyterhub/jupyterhub/pull/3055) ([@minrk](https://github.com/minrk)) +- [Docs] Disable proxy_buffering when using nginx reverse proxy [#3048](https://github.com/jupyterhub/jupyterhub/pull/3048) ([@mhwasil](https://github.com/mhwasil)) +- docs: add proxy_http_version 1.1 [#3046](https://github.com/jupyterhub/jupyterhub/pull/3046) ([@ceocoder](https://github.com/ceocoder)) +- #1018 PAM added in prerequisites [#3040](https://github.com/jupyterhub/jupyterhub/pull/3040) ([@romainx](https://github.com/romainx)) +- Fix use of auxiliary verb on index.rst [#3022](https://github.com/jupyterhub/jupyterhub/pull/3022) ([@joshmeek](https://github.com/joshmeek)) +- Fix docs CI test failure: duplicate object description [#3021](https://github.com/jupyterhub/jupyterhub/pull/3021) ([@rkdarst](https://github.com/rkdarst)) +- Update issue templates [#3001](https://github.com/jupyterhub/jupyterhub/pull/3001) ([@GeorgianaElena](https://github.com/GeorgianaElena)) +- fix wrong name on firewall [#2997](https://github.com/jupyterhub/jupyterhub/pull/2997) ([@thuvh](https://github.com/thuvh)) +- updating docs theme [#2995](https://github.com/jupyterhub/jupyterhub/pull/2995) ([@choldgraf](https://github.com/choldgraf)) +- Update contributor docs [#2972](https://github.com/jupyterhub/jupyterhub/pull/2972) ([@mriedem](https://github.com/mriedem)) +- Server.user_options rest-api documented [#2966](https://github.com/jupyterhub/jupyterhub/pull/2966) ([@mriedem](https://github.com/mriedem)) +- Pin sphinx theme [#2956](https://github.com/jupyterhub/jupyterhub/pull/2956) ([@manics](https://github.com/manics)) +- [doc] Fix couple typos in the documentation [#2951](https://github.com/jupyterhub/jupyterhub/pull/2951) ([@kinow](https://github.com/kinow)) +- Docs: Fixed grammar on landing page [#2950](https://github.com/jupyterhub/jupyterhub/pull/2950) ([@alexdriedger](https://github.com/alexdriedger)) +- add general faq [#2946](https://github.com/jupyterhub/jupyterhub/pull/2946) ([@minrk](https://github.com/minrk)) +- docs: use metachannel for faster environment solve [#2943](https://github.com/jupyterhub/jupyterhub/pull/2943) ([@minrk](https://github.com/minrk)) +- update docs environments [#2942](https://github.com/jupyterhub/jupyterhub/pull/2942) ([@minrk](https://github.com/minrk)) +- [doc] Add more docs about Cookies used for authentication in JupyterHub [#2940](https://github.com/jupyterhub/jupyterhub/pull/2940) ([@kinow](https://github.com/kinow)) +- [doc] Use fixed commit plus line number in github link [#2939](https://github.com/jupyterhub/jupyterhub/pull/2939) ([@kinow](https://github.com/kinow)) +- [doc] Fix link to SSL encryption from troubleshooting page [#2938](https://github.com/jupyterhub/jupyterhub/pull/2938) ([@kinow](https://github.com/kinow)) +- rest api: fix schema for remove parameter in rest api [#2917](https://github.com/jupyterhub/jupyterhub/pull/2917) ([@minrk](https://github.com/minrk)) +- Add troubleshooting topics [#2914](https://github.com/jupyterhub/jupyterhub/pull/2914) ([@jgwerner](https://github.com/jgwerner)) +- Several fixes to the doc [#2904](https://github.com/jupyterhub/jupyterhub/pull/2904) ([@reneluria](https://github.com/reneluria)) +- fix: 'Non-ASCII character '\xc3' [#2901](https://github.com/jupyterhub/jupyterhub/pull/2901) ([@jgwerner](https://github.com/jgwerner)) +- Generate prometheus metrics docs [#2891](https://github.com/jupyterhub/jupyterhub/pull/2891) ([@rajat404](https://github.com/rajat404)) #### Contributors to this release + ([GitHub contributors page for this release](https://github.com/jupyterhub/jupyterhub/graphs/contributors?from=2020-01-17&to=2020-10-29&type=c)) [@0nebody](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3A0nebody+updated%3A2020-01-17..2020-10-29&type=Issues) | [@1kastner](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3A1kastner+updated%3A2020-01-17..2020-10-29&type=Issues) | [@ahkui](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aahkui+updated%3A2020-01-17..2020-10-29&type=Issues) | [@alexdriedger](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aalexdriedger+updated%3A2020-01-17..2020-10-29&type=Issues) | [@alexweav](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aalexweav+updated%3A2020-01-17..2020-10-29&type=Issues) | [@AlJohri](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AAlJohri+updated%3A2020-01-17..2020-10-29&type=Issues) | [@Analect](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AAnalect+updated%3A2020-01-17..2020-10-29&type=Issues) | [@analytically](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aanalytically+updated%3A2020-01-17..2020-10-29&type=Issues) | [@aneagoe](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aaneagoe+updated%3A2020-01-17..2020-10-29&type=Issues) | [@AngelOnFira](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AAngelOnFira+updated%3A2020-01-17..2020-10-29&type=Issues) | [@barrachri](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Abarrachri+updated%3A2020-01-17..2020-10-29&type=Issues) | [@basvandervlies](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Abasvandervlies+updated%3A2020-01-17..2020-10-29&type=Issues) | [@betatim](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Abetatim+updated%3A2020-01-17..2020-10-29&type=Issues) | [@bigbosst](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Abigbosst+updated%3A2020-01-17..2020-10-29&type=Issues) | [@blink1073](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ablink1073+updated%3A2020-01-17..2020-10-29&type=Issues) | [@Cadair](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3ACadair+updated%3A2020-01-17..2020-10-29&type=Issues) | [@Carreau](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3ACarreau+updated%3A2020-01-17..2020-10-29&type=Issues) | [@cbjuan](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Acbjuan+updated%3A2020-01-17..2020-10-29&type=Issues) | [@ceocoder](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aceocoder+updated%3A2020-01-17..2020-10-29&type=Issues) | [@chancez](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Achancez+updated%3A2020-01-17..2020-10-29&type=Issues) | [@choldgraf](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Acholdgraf+updated%3A2020-01-17..2020-10-29&type=Issues) | [@Chrisjw42](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AChrisjw42+updated%3A2020-01-17..2020-10-29&type=Issues) | [@cmd-ntrf](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Acmd-ntrf+updated%3A2020-01-17..2020-10-29&type=Issues) | [@consideRatio](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AconsideRatio+updated%3A2020-01-17..2020-10-29&type=Issues) | [@danlester](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Adanlester+updated%3A2020-01-17..2020-10-29&type=Issues) | [@diurnalist](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Adiurnalist+updated%3A2020-01-17..2020-10-29&type=Issues) | [@Dmitry1987](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3ADmitry1987+updated%3A2020-01-17..2020-10-29&type=Issues) | [@dsblank](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Adsblank+updated%3A2020-01-17..2020-10-29&type=Issues) | [@dylex](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Adylex+updated%3A2020-01-17..2020-10-29&type=Issues) | [@echarles](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aecharles+updated%3A2020-01-17..2020-10-29&type=Issues) | [@elgalu](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aelgalu+updated%3A2020-01-17..2020-10-29&type=Issues) | [@fcollonval](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Afcollonval+updated%3A2020-01-17..2020-10-29&type=Issues) | [@gatoniel](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Agatoniel+updated%3A2020-01-17..2020-10-29&type=Issues) | [@GeorgianaElena](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AGeorgianaElena+updated%3A2020-01-17..2020-10-29&type=Issues) | [@hnykda](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ahnykda+updated%3A2020-01-17..2020-10-29&type=Issues) | [@itssimon](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aitssimon+updated%3A2020-01-17..2020-10-29&type=Issues) | [@jgwerner](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ajgwerner+updated%3A2020-01-17..2020-10-29&type=Issues) | [@JohnPaton](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AJohnPaton+updated%3A2020-01-17..2020-10-29&type=Issues) | [@joshmeek](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ajoshmeek+updated%3A2020-01-17..2020-10-29&type=Issues) | [@jtpio](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ajtpio+updated%3A2020-01-17..2020-10-29&type=Issues) | [@kinow](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Akinow+updated%3A2020-01-17..2020-10-29&type=Issues) | [@kreuzert](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Akreuzert+updated%3A2020-01-17..2020-10-29&type=Issues) | [@kxiao-fn](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Akxiao-fn+updated%3A2020-01-17..2020-10-29&type=Issues) | [@lesiano](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Alesiano+updated%3A2020-01-17..2020-10-29&type=Issues) | [@limimiking](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Alimimiking+updated%3A2020-01-17..2020-10-29&type=Issues) | [@lydian](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Alydian+updated%3A2020-01-17..2020-10-29&type=Issues) | [@mabbasi90](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Amabbasi90+updated%3A2020-01-17..2020-10-29&type=Issues) | [@maluhoss](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Amaluhoss+updated%3A2020-01-17..2020-10-29&type=Issues) | [@manics](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Amanics+updated%3A2020-01-17..2020-10-29&type=Issues) | [@matteoipri](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Amatteoipri+updated%3A2020-01-17..2020-10-29&type=Issues) | [@mbmilligan](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ambmilligan+updated%3A2020-01-17..2020-10-29&type=Issues) | [@meeseeksmachine](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ameeseeksmachine+updated%3A2020-01-17..2020-10-29&type=Issues) | [@mhwasil](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Amhwasil+updated%3A2020-01-17..2020-10-29&type=Issues) | [@minrk](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aminrk+updated%3A2020-01-17..2020-10-29&type=Issues) | [@mriedem](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Amriedem+updated%3A2020-01-17..2020-10-29&type=Issues) | [@nscozzaro](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Anscozzaro+updated%3A2020-01-17..2020-10-29&type=Issues) | [@pabepadu](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Apabepadu+updated%3A2020-01-17..2020-10-29&type=Issues) | [@possiblyMikeB](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3ApossiblyMikeB+updated%3A2020-01-17..2020-10-29&type=Issues) | [@psyvision](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Apsyvision+updated%3A2020-01-17..2020-10-29&type=Issues) | [@rabsr](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Arabsr+updated%3A2020-01-17..2020-10-29&type=Issues) | [@rainwoodman](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Arainwoodman+updated%3A2020-01-17..2020-10-29&type=Issues) | [@rajat404](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Arajat404+updated%3A2020-01-17..2020-10-29&type=Issues) | [@rcthomas](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Arcthomas+updated%3A2020-01-17..2020-10-29&type=Issues) | [@reneluria](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Areneluria+updated%3A2020-01-17..2020-10-29&type=Issues) | [@rgbkrk](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Argbkrk+updated%3A2020-01-17..2020-10-29&type=Issues) | [@rkdarst](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Arkdarst+updated%3A2020-01-17..2020-10-29&type=Issues) | [@rkevin-arch](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Arkevin-arch+updated%3A2020-01-17..2020-10-29&type=Issues) | [@romainx](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aromainx+updated%3A2020-01-17..2020-10-29&type=Issues) | [@ryanlovett](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aryanlovett+updated%3A2020-01-17..2020-10-29&type=Issues) | [@ryogesh](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aryogesh+updated%3A2020-01-17..2020-10-29&type=Issues) | [@sdague](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Asdague+updated%3A2020-01-17..2020-10-29&type=Issues) | [@snickell](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Asnickell+updated%3A2020-01-17..2020-10-29&type=Issues) | [@SonakshiGrover](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3ASonakshiGrover+updated%3A2020-01-17..2020-10-29&type=Issues) | [@ssanderson](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Assanderson+updated%3A2020-01-17..2020-10-29&type=Issues) | [@stefanvangastel](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Astefanvangastel+updated%3A2020-01-17..2020-10-29&type=Issues) | [@steinad](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Asteinad+updated%3A2020-01-17..2020-10-29&type=Issues) | [@stephen-a2z](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Astephen-a2z+updated%3A2020-01-17..2020-10-29&type=Issues) | [@stevegore](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Astevegore+updated%3A2020-01-17..2020-10-29&type=Issues) | [@stv0g](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Astv0g+updated%3A2020-01-17..2020-10-29&type=Issues) | [@subgero](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Asubgero+updated%3A2020-01-17..2020-10-29&type=Issues) | [@sudi007](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Asudi007+updated%3A2020-01-17..2020-10-29&type=Issues) | [@summerswallow](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Asummerswallow+updated%3A2020-01-17..2020-10-29&type=Issues) | [@support](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Asupport+updated%3A2020-01-17..2020-10-29&type=Issues) | [@synchronizing](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Asynchronizing+updated%3A2020-01-17..2020-10-29&type=Issues) | [@thuvh](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Athuvh+updated%3A2020-01-17..2020-10-29&type=Issues) | [@tritemio](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Atritemio+updated%3A2020-01-17..2020-10-29&type=Issues) | [@twalcari](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Atwalcari+updated%3A2020-01-17..2020-10-29&type=Issues) | [@vchandvankar](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Avchandvankar+updated%3A2020-01-17..2020-10-29&type=Issues) | [@vilhelmen](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Avilhelmen+updated%3A2020-01-17..2020-10-29&type=Issues) | [@vlizanae](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Avlizanae+updated%3A2020-01-17..2020-10-29&type=Issues) | [@weimin](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aweimin+updated%3A2020-01-17..2020-10-29&type=Issues) | [@welcome](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Awelcome+updated%3A2020-01-17..2020-10-29&type=Issues) | [@willingc](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Awillingc+updated%3A2020-01-17..2020-10-29&type=Issues) | [@xlotlu](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Axlotlu+updated%3A2020-01-17..2020-10-29&type=Issues) | [@yhal-nesi](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ayhal-nesi+updated%3A2020-01-17..2020-10-29&type=Issues) | [@ynnelson](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Aynnelson+updated%3A2020-01-17..2020-10-29&type=Issues) | [@yuvipanda](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Ayuvipanda+updated%3A2020-01-17..2020-10-29&type=Issues) | [@zonca](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3Azonca+updated%3A2020-01-17..2020-10-29&type=Issues) | [@Zsailer](https://github.com/search?q=repo%3Ajupyterhub%2Fjupyterhub+involves%3AZsailer+updated%3A2020-01-17..2020-10-29&type=Issues) @@ -282,7 +282,6 @@ but more will be added in future releases. There are many more fixes and improvements listed below. Thanks to everyone who has contributed to this release! - #### New - LocalProcessSpawner should work on windows by using psutil.pid_exists [#2882](https://github.com/jupyterhub/jupyterhub/pull/2882) ([@ociule](https://github.com/ociule)) @@ -330,7 +329,6 @@ Thanks to everyone who has contributed to this release! #### Maintenance - - Optimize CI jobs and default to bionic [#2897](https://github.com/jupyterhub/jupyterhub/pull/2897) ([@consideRatio](https://github.com/consideRatio)) - catch connection error for ssl failures [#2889](https://github.com/jupyterhub/jupyterhub/pull/2889) ([@minrk](https://github.com/minrk)) - Fix implementation of default server name [#2887](https://github.com/jupyterhub/jupyterhub/pull/2887) ([@krinsman](https://github.com/krinsman)) @@ -415,12 +413,13 @@ whether it was through discussion, testing, documentation, or development. With named servers, each jupyterhub user may have access to more than one named server. For example, a professor may access a server named `research` and another named `teaching`. ![named servers on the home page](./images/named-servers-home.png) + - Authenticators can now expire and refresh authentication data by implementing `Authenticator.refresh_user(user)`. This allows things like OAuth data and access tokens to be refreshed. When used together with `Authenticator.refresh_pre_spawn = True`, auth refresh can be forced prior to Spawn, - allowing the Authenticator to *require* that authentication data is fresh + allowing the Authenticator to _require_ that authentication data is fresh immediately before the user's server is launched. ```eval_rst @@ -440,6 +439,7 @@ whether it was through discussion, testing, documentation, or development. c.JupyterHub.spawner_class = 'docker' c.JupyterHub.proxy_class = 'traefik_etcd' ``` + - Spawners are passed the tornado Handler object that requested their spawn (as `self.handler`), so they can do things like make decisions based on query arguments in the request. - SimpleSpawner and DummyAuthenticator, which are useful for testing, have been merged into JupyterHub itself: @@ -451,6 +451,7 @@ whether it was through discussion, testing, documentation, or development. ``` These classes are **not** appropriate for production use. Only testing. + - Add health check endpoint at `/hub/health` - Several prometheus metrics have been added (thanks to [Outreachy](https://www.outreachy.org/) applicants!) - A new API for registering user activity. @@ -481,14 +482,13 @@ whether it was through discussion, testing, documentation, or development. and return a new authentication dictionary, e.g. specifying admin privileges, group membership, or custom allowed/blocked logic. - This hook is called *after* existing normalization and allowed-username checking. + This hook is called _after_ existing normalization and allowed-username checking. - `Spawner.options_from_form` may now be async - Added `JupyterHub.shutdown_on_logout` option to trigger shutdown of a user's servers when they log out. - When `Spawner.start` raises an Exception, a message can be passed on to the user if the exception has a `.jupyterhub_message` attribute. - #### Changes - Authentication methods such as `check_whitelist` should now take an additional @@ -503,6 +503,7 @@ whether it was through discussion, testing, documentation, or development. `authentication` should have a default value of None for backward-compatibility with jupyterhub < 1.0. + - Prometheus metrics page is now authenticated. Any authenticated user may see the prometheus metrics. To disable prometheus authentication, @@ -515,7 +516,6 @@ whether it was through discussion, testing, documentation, or development. so that users can choose to cancel authentication with the single-user server. Confirmation is still skipped when accessing your own server. - #### Fixed - Various fixes to improve Windows compatibility @@ -534,12 +534,11 @@ In general, see `CONTRIBUTING.md` for contribution info or ask if you have quest - JupyterHub has adopted `black` as a code autoformatter and `pre-commit` as a tool for automatically running code formatting on commit. - This is meant to make it *easier* to contribute to JupyterHub, + This is meant to make it _easier_ to contribute to JupyterHub, so let us know if it's having the opposite effect. - JupyterHub has switched its test suite to using `pytest-asyncio` from `pytest-tornado`. - OAuth is now implemented internally using `oauthlib` instead of `python-oauth2`. This should have no effect on behavior. - ## 0.9 ### [0.9.6] 2019-04-01 @@ -554,7 +553,7 @@ JupyterHub 0.9.5 included a partial fix for this issue. JupyterHub 0.9.4 is a small bugfix release. -- Fixes an issue that required all running user servers to be restarted +- Fixes an issue that required all running user servers to be restarted when performing an upgrade from 0.8 to 0.9. - Fixes content-type for API endpoints back to `application/json`. It was `text/html` in 0.9.0-0.9.3. @@ -583,7 +582,6 @@ JupyterHub 0.9.2 contains small bugfixes and improvements. - Fix for handling SIGTERM when run with asyncio (tornado 5) - Windows compatibility fixes - ### [0.9.1] 2018-07-04 JupyterHub 0.9.1 contains a number of small bugfixes on top of 0.9. @@ -613,7 +611,6 @@ free to use tornado coroutines for async methods, as they will continue to work. As part of this upgrade, JupyterHub 0.9 drops support for Python < 3.5 and tornado < 5.0. - #### Changed - Require Python >= 3.5 @@ -688,7 +685,6 @@ and tornado < 5.0. Expiry is available in the REST model as `expires_at`, and settable when creating API tokens by specifying `expires_in`. - #### Fixed - Remove green from theme to improve accessibility @@ -701,7 +697,7 @@ and tornado < 5.0. instead relying on subsequent request for `/user/:name` to trigger spawn. - Fixed several inconsistencies for initial redirects, depending on whether server is running or not and whether the user is logged in or not. -- Admin requests for `/user/:name` (when admin-access is enabled) launch the right server if it's not running instead of redirecting to their own. +- Admin requests for `/user/:name` (when admin-access is enabled) launch the right server if it's not running instead of redirecting to their own. - Major performance improvement starting up JupyterHub with many users, especially when most are inactive. - Various fixes in race conditions and performance improvements with the default proxy. @@ -713,7 +709,6 @@ and tornado < 5.0. - Fix jupyterhub startup when `getpass.getuser()` would fail, e.g. due to missing entry in passwd file in containers. - ## 0.8 ### [0.8.1] 2017-11-07 @@ -738,7 +733,6 @@ JupyterHub 0.8.1 is a collection of bugfixes and small improvements on 0.8. - Fix ever-growing traceback when re-raising Exceptions from spawn failures. - Remove use of deprecated `bower` for javascript client dependencies. - ### [0.8.0] 2017-10-03 JupyterHub 0.8 is a big release! @@ -778,6 +772,7 @@ in your Dockerfile is sufficient. This data will be encrypted and requires `JUPYTERHUB_CRYPT_KEY` environment variable to be set and the `Authenticator.enable_auth_state` flag to be True. If these are not set, auth_state returned by the Authenticator will not be stored. + - There is preliminary support for multiple (named) servers per user in the REST API. Named servers can be created via API requests, but there is currently no UI for managing them. - Add `LocalProcessSpawner.popen_kwargs` and `LocalProcessSpawner.shell_cmd` @@ -792,7 +787,6 @@ in your Dockerfile is sufficient. - Add `JupyterHub.active_server_limit` and `JupyterHub.concurrent_spawn_limit` for limiting the total number of running user servers and the number of pending spawns, respectively. - #### Changed - more arguments to spawners are now passed via environment variables (`.get_env()`) @@ -827,7 +821,7 @@ So many things fixed! #### Removed -- End support for Python 3.3 +- End support for Python 3.3 ## 0.7 @@ -852,7 +846,7 @@ So many things fixed! This is needed for cases like `DockerSpawner.remove_containers = False`, where the first API token is re-used for subsequent spawns. - Warning on startup about single-character usernames, - caused by common `set('string')` typo in config. + caused by common `set('string')` typo in config. #### Fixed @@ -866,13 +860,12 @@ So many things fixed! - Add `/api/` and `/api/info` endpoints [\#675](https://github.com/jupyterhub/jupyterhub/pull/675) - Add documentation for JupyterLab, pySpark configuration, troubleshooting, and more. -- Add logging of error if adding users already in database. [\#689](https://github.com/jupyterhub/jupyterhub/pull/689) +- Add logging of error if adding users already in database. [\#689](https://github.com/jupyterhub/jupyterhub/pull/689) - Add HubAuth class for authenticating with JupyterHub. This class can be used by any application, even outside tornado. - Add user groups. - Add `/hub/user-redirect/...` URL for redirecting users to a file on their own server. - #### Changed - Always install with setuptools but not eggs (effectively require @@ -886,13 +879,12 @@ So many things fixed! - Fix swagger spec conformance and timestamp type in API spec - Various redirect-loop-causing bugs have been fixed. - #### Removed - Deprecate `--no-ssl` command line option. It has no meaning and warns if used. [\#789](https://github.com/jupyterhub/jupyterhub/pull/789) - Deprecate `%U` username substitution in favor of `{username}`. [\#748](https://github.com/jupyterhub/jupyterhub/pull/748) -- Removed deprecated SwarmSpawner link. [\#699](https://github.com/jupyterhub/jupyterhub/pull/699) +- Removed deprecated SwarmSpawner link. [\#699](https://github.com/jupyterhub/jupyterhub/pull/699) ## 0.6 @@ -918,10 +910,8 @@ Bugfixes on 0.6: This can only be used if the Authenticator has a username and password. - Various fixes for user URLs and redirects - ## [0.5] - 2016-03-07 - - Single-user server must be run with Jupyter Notebook ≥ 4.0 - Require `--no-ssl` confirmation to allow the Hub to be run without SSL (e.g. behind SSL termination in nginx) - Add lengths to text fields for MySQL support @@ -947,7 +937,6 @@ Fix removal of `/login` page in 0.4.0, breaking some OAuth providers. These methods are typically used with custom Authenticator+Spawner pairs. - 0.4 will be the last JupyterHub release where single-user servers running IPython 3 is supported instead of Notebook ≥ 4.0. - ## [0.3] - 2015-11-04 - No longer make the user starting the Hub an admin @@ -966,8 +955,7 @@ Fix removal of `/login` page in 0.4.0, breaking some OAuth providers. First preview release - -[Unreleased]: https://github.com/jupyterhub/jupyterhub/compare/1.3.0...HEAD +[unreleased]: https://github.com/jupyterhub/jupyterhub/compare/1.3.0...HEAD [1.3.0]: https://github.com/jupyterhub/jupyterhub/compare/1.2.1...1.3.0 [1.2.2]: https://github.com/jupyterhub/jupyterhub/compare/1.2.1...1.2.2 [1.2.1]: https://github.com/jupyterhub/jupyterhub/compare/1.2.0...1.2.1 diff --git a/docs/source/contributing/roadmap.md b/docs/source/contributing/roadmap.md index c1a6194e..0bbde407 100644 --- a/docs/source/contributing/roadmap.md +++ b/docs/source/contributing/roadmap.md @@ -6,8 +6,8 @@ the community of users, contributors, and maintainers. The goal is to communicate priorities and upcoming release plans. It is not a aimed at limiting contributions to what is listed here. - ## Using the roadmap + ### Sharing Feedback on the Roadmap All of the community is encouraged to provide feedback as well as share new @@ -22,17 +22,17 @@ maintainers will help identify what a good next step is for the issue. When submitting an issue, think about what "next step" category best describes your issue: -* **now**, concrete/actionable step that is ready for someone to start work on. -These might be items that have a link to an issue or more abstract like -"decrease typos and dead links in the documentation" -* **soon**, less concrete/actionable step that is going to happen soon, -discussions around the topic are coming close to an end at which point it can -move into the "now" category -* **later**, abstract ideas or tasks, need a lot of discussion or -experimentation to shape the idea so that it can be executed. Can also -contain concrete/actionable steps that have been postponed on purpose -(these are steps that could be in "now" but the decision was taken to work on -them later) +- **now**, concrete/actionable step that is ready for someone to start work on. + These might be items that have a link to an issue or more abstract like + "decrease typos and dead links in the documentation" +- **soon**, less concrete/actionable step that is going to happen soon, + discussions around the topic are coming close to an end at which point it can + move into the "now" category +- **later**, abstract ideas or tasks, need a lot of discussion or + experimentation to shape the idea so that it can be executed. Can also + contain concrete/actionable steps that have been postponed on purpose + (these are steps that could be in "now" but the decision was taken to work on + them later) ### Reviewing and Updating the Roadmap @@ -47,8 +47,8 @@ For those please create a The roadmap should give the reader an idea of what is happening next, what needs input and discussion before it can happen and what has been postponed. - ## The roadmap proper + ### Project vision JupyterHub is a dependable tool used by humans that reduces the complexity of @@ -58,20 +58,19 @@ creating the environment in which a piece of software can be executed. These "Now" items are considered active areas of focus for the project: -* HubShare - a sharing service for use with JupyterHub. - * Users should be able to: - - Push a project to other users. - - Get a checkout of a project from other users. - - Push updates to a published project. - - Pull updates from a published project. - - Manage conflicts/merges by simply picking a version (our/theirs) - - Get a checkout of a project from the internet. These steps are completely different from saving notebooks/files. - - Have directories that are managed by git completely separately from our stuff. - - Look at pushed content that they have access to without an explicit pull. - - Define and manage teams of users. - - Adding/removing a user to/from a team gives/removes them access to all projects that team has access to. - - Build other services, such as static HTML publishing and dashboarding on top of these things. - +- HubShare - a sharing service for use with JupyterHub. + - Users should be able to: + - Push a project to other users. + - Get a checkout of a project from other users. + - Push updates to a published project. + - Pull updates from a published project. + - Manage conflicts/merges by simply picking a version (our/theirs) + - Get a checkout of a project from the internet. These steps are completely different from saving notebooks/files. + - Have directories that are managed by git completely separately from our stuff. + - Look at pushed content that they have access to without an explicit pull. + - Define and manage teams of users. + - Adding/removing a user to/from a team gives/removes them access to all projects that team has access to. + - Build other services, such as static HTML publishing and dashboarding on top of these things. ### Soon @@ -79,11 +78,10 @@ These "Soon" items are under discussion. Once an item reaches the point of an actionable plan, the item will be moved to the "Now" section. Typically, these will be moved at a future review of the roadmap. -* resource monitoring and management: - - (prometheus?) API for resource monitoring - - tracking activity on single-user servers instead of the proxy - - notes and activity tracking per API token - +- resource monitoring and management: + - (prometheus?) API for resource monitoring + - tracking activity on single-user servers instead of the proxy + - notes and activity tracking per API token ### Later @@ -92,6 +90,6 @@ time there is no active plan for an item. The project would like to find the resources and time to discuss these ideas. - real-time collaboration - - Enter into real-time collaboration mode for a project that starts a shared execution context. - - Once the single-user notebook package supports realtime collaboration, - implement sharing mechanism integrated into the Hub. + - Enter into real-time collaboration mode for a project that starts a shared execution context. + - Once the single-user notebook package supports realtime collaboration, + implement sharing mechanism integrated into the Hub. diff --git a/docs/source/events/index.rst b/docs/source/events/index.rst index 90e30acb..bc086ba1 100644 --- a/docs/source/events/index.rst +++ b/docs/source/events/index.rst @@ -1,10 +1,7 @@ Eventlogging and Telemetry ========================== -JupyterHub can be configured to record structured events from a running server using Jupyter's `Telemetry System`_. The types of events that JupyterHub emits are defined by `JSON schemas`_ listed below_ - - emitted as JSON data, defined and validated by the JSON schemas listed below. - +JupyterHub can be configured to record structured events from a running server using Jupyter's `Telemetry System`_. The types of events that JupyterHub emits are defined by `JSON schemas`_ listed at the bottom of this page_. .. _logging: https://docs.python.org/3/library/logging.html .. _`Telemetry System`: https://github.com/jupyter/telemetry @@ -38,13 +35,12 @@ Here's a basic example: The output is a file, ``"event.log"``, with events recorded as JSON data. - -.. _below: +.. _page: Event schemas ------------- .. toctree:: - :maxdepth: 2 + :maxdepth: 2 - server-actions.rst + server-actions.rst diff --git a/docs/source/gallery-jhub-deployments.md b/docs/source/gallery-jhub-deployments.md index 55a3dff6..1290c0f1 100644 --- a/docs/source/gallery-jhub-deployments.md +++ b/docs/source/gallery-jhub-deployments.md @@ -8,23 +8,25 @@ high performance computing. Please submit pull requests to update information or to add new institutions or uses. - ## Academic Institutions, Research Labs, and Supercomputer Centers ### University of California Berkeley - [BIDS - Berkeley Institute for Data Science](https://bids.berkeley.edu/) - - [Teaching with Jupyter notebooks and JupyterHub](https://bids.berkeley.edu/resources/videos/teaching-ipythonjupyter-notebooks-and-jupyterhub) + + - [Teaching with Jupyter notebooks and JupyterHub](https://bids.berkeley.edu/resources/videos/teaching-ipythonjupyter-notebooks-and-jupyterhub) - [Data 8](http://data8.org/) - - [GitHub organization](https://github.com/data-8) + + - [GitHub organization](https://github.com/data-8) - [NERSC](http://www.nersc.gov/) - - [Press release on Jupyter and Cori](http://www.nersc.gov/news-publications/nersc-news/nersc-center-news/2016/jupyter-notebooks-will-open-up-new-possibilities-on-nerscs-cori-supercomputer/) - - [Moving and sharing data](https://www.nersc.gov/assets/Uploads/03-MovingAndSharingData-Cholia.pdf) + + - [Press release on Jupyter and Cori](http://www.nersc.gov/news-publications/nersc-news/nersc-center-news/2016/jupyter-notebooks-will-open-up-new-possibilities-on-nerscs-cori-supercomputer/) + - [Moving and sharing data](https://www.nersc.gov/assets/Uploads/03-MovingAndSharingData-Cholia.pdf) - [Research IT](http://research-it.berkeley.edu) - - [JupyterHub server supports campus research computation](http://research-it.berkeley.edu/blog/17/01/24/free-fully-loaded-jupyterhub-server-supports-campus-research-computation) + - [JupyterHub server supports campus research computation](http://research-it.berkeley.edu/blog/17/01/24/free-fully-loaded-jupyterhub-server-supports-campus-research-computation) ### University of California Davis @@ -62,20 +64,21 @@ easy to do with RStudio too. ### Clemson University - Advanced Computing - - [Palmetto cluster and JupyterHub](http://citi.sites.clemson.edu/2016/08/18/JupyterHub-for-Palmetto-Cluster.html) + - [Palmetto cluster and JupyterHub](http://citi.sites.clemson.edu/2016/08/18/JupyterHub-for-Palmetto-Cluster.html) ### University of Colorado Boulder - (CU Research Computing) CURC - - [JupyterHub User Guide](https://www.rc.colorado.edu/support/user-guide/jupyterhub.html) - - Slurm job dispatched on Crestone compute cluster - - log troubleshooting - - Profiles in IPython Clusters tab - - [Parallel Processing with JupyterHub tutorial](https://www.rc.colorado.edu/support/examples-and-tutorials/parallel-processing-with-jupyterhub.html) - - [Parallel Programming with JupyterHub document](https://www.rc.colorado.edu/book/export/html/833) + + - [JupyterHub User Guide](https://www.rc.colorado.edu/support/user-guide/jupyterhub.html) + - Slurm job dispatched on Crestone compute cluster + - log troubleshooting + - Profiles in IPython Clusters tab + - [Parallel Processing with JupyterHub tutorial](https://www.rc.colorado.edu/support/examples-and-tutorials/parallel-processing-with-jupyterhub.html) + - [Parallel Programming with JupyterHub document](https://www.rc.colorado.edu/book/export/html/833) - Earth Lab at CU - - [Tutorial on Parallel R on JupyterHub](https://earthdatascience.org/tutorials/parallel-r-on-jupyterhub/) + - [Tutorial on Parallel R on JupyterHub](https://earthdatascience.org/tutorials/parallel-r-on-jupyterhub/) ### George Washington University @@ -112,7 +115,7 @@ easy to do with RStudio too. ### Paderborn University - [Data Science (DICE) group](https://dice.cs.uni-paderborn.de/) - - [nbgraderutils](https://github.com/dice-group/nbgraderutils): Use JupyterHub + nbgrader + iJava kernel for online Java exercises. Used in lecture Statistical Natural Language Processing. + - [nbgraderutils](https://github.com/dice-group/nbgraderutils): Use JupyterHub + nbgrader + iJava kernel for online Java exercises. Used in lecture Statistical Natural Language Processing. ### Penn State University @@ -125,27 +128,28 @@ easy to do with RStudio too. ### University of California San Diego - San Diego Supercomputer Center - Andrea Zonca - - [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) - - [Deploy JupyterHub on a VM for a Workshop](https://zonca.github.io/2016/04/jupyterhub-sdsc-cloud.html) - - [Customize your Python environment in Jupyterhub](https://zonca.github.io/2017/02/customize-python-environment-jupyterhub.html) - - [Jupyterhub deployment on multiple nodes with Docker Swarm](https://zonca.github.io/2016/05/jupyterhub-docker-swarm.html) - - [Sample deployment of Jupyterhub in HPC on SDSC Comet](https://zonca.github.io/2017/02/sample-deployment-jupyterhub-hpc.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) + - [Deploy JupyterHub on a VM for a Workshop](https://zonca.github.io/2016/04/jupyterhub-sdsc-cloud.html) + - [Customize your Python environment in Jupyterhub](https://zonca.github.io/2017/02/customize-python-environment-jupyterhub.html) + - [Jupyterhub deployment on multiple nodes with Docker Swarm](https://zonca.github.io/2016/05/jupyterhub-docker-swarm.html) + - [Sample deployment of Jupyterhub in HPC on SDSC Comet](https://zonca.github.io/2017/02/sample-deployment-jupyterhub-hpc.html) - Educational Technology Services - Paul Jamason - - [jupyterhub.ucsd.edu](https://jupyterhub.ucsd.edu) + - [jupyterhub.ucsd.edu](https://jupyterhub.ucsd.edu) ### TACC University of Texas ### Texas A&M - Kristen Thyng - Oceanography - - [Teaching with JupyterHub and nbgrader](http://kristenthyng.com/blog/2016/09/07/jupyterhub+nbgrader/) + - [Teaching with JupyterHub and nbgrader](http://kristenthyng.com/blog/2016/09/07/jupyterhub+nbgrader/) ### Elucidata - - What's new in Jupyter Notebooks @[Elucidata](https://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 + +- What's new in Jupyter Notebooks @[Elucidata](https://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 ## Service Providers @@ -175,7 +179,6 @@ easy to do with RStudio too. - [Deploying JupyterHub on Hadoop](https://jupyterhub-on-hadoop.readthedocs.io) - ## Miscellaneous - https://medium.com/@ybarraud/setting-up-jupyterhub-with-sudospawner-and-anaconda-844628c0dbee#.rm3yt87e1 diff --git a/docs/source/getting-started/authenticators-users-basics.md b/docs/source/getting-started/authenticators-users-basics.md index ec078fed..6b59231d 100644 --- a/docs/source/getting-started/authenticators-users-basics.md +++ b/docs/source/getting-started/authenticators-users-basics.md @@ -9,7 +9,6 @@ with an account and password on the system will be allowed to login. You can restrict which users are allowed to login with a set, `Authenticator.allowed_users`: - ```python c.Authenticator.allowed_users = {'mal', 'zoe', 'inara', 'kaylee'} ``` @@ -28,6 +27,7 @@ A set of initial admin users, `admin_users` can configured be as follows: ```python c.Authenticator.admin_users = {'mal', 'zoe'} ``` + Users in the admin set are automatically added to the user `allowed_users` set, if they are not already present. @@ -44,8 +44,8 @@ c.PAMAuthenticator.admin_groups = {'wheel'} Since the default `JupyterHub.admin_access` setting is False, the admins do not have permission to log in to the single user notebook servers -owned by *other users*. If `JupyterHub.admin_access` is set to True, -then admins have permission to log in *as other users* on their +owned by _other users_. If `JupyterHub.admin_access` is set to True, +then admins have permission to log in _as other users_ on their respective machines, for debugging. **As a courtesy, you should make sure your users know if admin_access is enabled.** @@ -115,5 +115,5 @@ To set a global password, add this to the config file: c.DummyAuthenticator.password = "some_password" ``` -[PAM]: https://en.wikipedia.org/wiki/Pluggable_authentication_module -[OAuthenticator]: https://github.com/jupyterhub/oauthenticator +[pam]: https://en.wikipedia.org/wiki/Pluggable_authentication_module +[oauthenticator]: https://github.com/jupyterhub/oauthenticator diff --git a/docs/source/getting-started/config-basics.md b/docs/source/getting-started/config-basics.md index 47850ac9..f1438fd7 100644 --- a/docs/source/getting-started/config-basics.md +++ b/docs/source/getting-started/config-basics.md @@ -56,7 +56,7 @@ To display all command line options that are available for configuration: ``` Configuration using the command line options is done when launching JupyterHub. -For example, to start JupyterHub on ``10.0.1.2:443`` with https, you +For example, to start JupyterHub on `10.0.1.2:443` with https, you would enter: ```bash @@ -88,13 +88,13 @@ meant as illustration, are: ## Run the proxy separately -This is *not* strictly necessary, but useful in many cases. If you +This is _not_ strictly necessary, but useful in many cases. If you use a custom proxy (e.g. Traefik), this also not needed. -Connections to user servers go through the proxy, and *not* the hub -itself. If the proxy stays running when the hub restarts (for +Connections to user servers go through the proxy, and _not_ the hub +itself. If the proxy stays running when the hub restarts (for maintenance, re-configuration, etc.), then use 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 -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](../reference/separate-proxy). diff --git a/docs/source/getting-started/faq.md b/docs/source/getting-started/faq.md index ae912847..e5cd30af 100644 --- a/docs/source/getting-started/faq.md +++ b/docs/source/getting-started/faq.md @@ -1,6 +1,5 @@ # Frequently asked questions - ### How do I share links to notebooks? In short, where you see `/user/name/notebooks/foo.ipynb` use `/hub/user-redirect/notebooks/foo.ipynb` (replace `/user/name` with `/hub/user-redirect`). @@ -11,9 +10,9 @@ Your first instinct might be to copy the URL you see in the browser, e.g. `hub.jupyter.org/user/yourname/notebooks/coolthing.ipynb`. However, let's break down what this URL means: -`hub.jupyter.org/user/yourname/` is the URL prefix handled by *your server*, +`hub.jupyter.org/user/yourname/` is the URL prefix handled by _your server_, which means that sharing this URL is asking the person you share the link with -to come to *your server* and look at the exact same file. +to come to _your server_ and look at the exact same file. In most circumstances, this is forbidden by permissions because the person you share with does not have access to your server. What actually happens when someone visits this URL will depend on whether your server is running and other factors. @@ -22,7 +21,7 @@ A typical situation is that you have some shared or common filesystem, such that the same path corresponds to the same document (either the exact same document or another copy of it). Typically, what folks want when they do sharing like this -is for each visitor to open the same file *on their own server*, +is for each visitor to open the same file _on their own server_, so Breq would open `/user/breq/notebooks/foo.ipynb` and Seivarden would open `/user/seivarden/notebooks/foo.ipynb`, etc. diff --git a/docs/source/getting-started/institutional-faq.md b/docs/source/getting-started/institutional-faq.md index 0d38f7eb..c5e88798 100644 --- a/docs/source/getting-started/institutional-faq.md +++ b/docs/source/getting-started/institutional-faq.md @@ -18,14 +18,14 @@ to the use-cases of large organizations. Here is a quick breakdown of these three tools: -* **The Jupyter Notebook** is a document specification (the `.ipynb`) file that interweaves +- **The Jupyter Notebook** is a document specification (the `.ipynb`) file that interweaves narrative text with code cells and their outputs. It is also a graphical interface that allows users to edit these documents. There are also several other graphical interfaces that allow users to edit the `.ipynb` format (nteract, Jupyter Lab, Google Colab, Kaggle, etc). -* **JupyterLab** is a flexible and extendible user interface for interactive computing. It +- **JupyterLab** is a flexible and extendible user interface for interactive computing. It has several extensions that are tailored for using Jupyter Notebooks, as well as extensions for other parts of the data science stack. -* **JupyterHub** is an application that manages interactive computing sessions for **multiple users**. +- **JupyterHub** is an application that manages interactive computing sessions for **multiple users**. It also connects them with infrastructure those users wish to access. It can provide remote access to Jupyter Notebooks and Jupyter Lab for many people. @@ -50,20 +50,20 @@ scalable infrastructure, large datasets, and high-performance computing. JupyterHub is used at a variety of institutions in academia, industry, and government research labs. It is most-commonly used by two kinds of groups: -* Small teams (e.g., data science teams, research labs, or collaborative projects) to provide a +- Small teams (e.g., data science teams, research labs, or collaborative projects) to provide a shared resource for interactive computing, collaboration, and analytics. -* Large teams (e.g., a department, a large class, or a large group of remote users) to provide +- Large teams (e.g., a department, a large class, or a large group of remote users) to provide access to organizational hardware, data, and analytics environments at scale. Here are 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 -* **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 -* **Online communities**: Pangeo, Quantopian, mybinder.org, MathHub, Open Humans -* **Computing infrastructure providers**: NERSC, San Diego Supercomputing Center, Compute Canada -* **Companies**: Capital One, SANDVIK code, Globus +- **Online communities**: Pangeo, Quantopian, mybinder.org, MathHub, Open Humans +- **Computing infrastructure providers**: NERSC, San Diego Supercomputing Center, Compute Canada +- **Companies**: Capital One, SANDVIK code, Globus See the [Gallery of JupyterHub deployments](../gallery-jhub-deployments.md) for a more complete list of JupyterHub deployments at institutions. @@ -95,14 +95,13 @@ The most common way to set up a JupyterHub is to use a JupyterHub distribution, and opinionated ways to set up a JupyterHub on particular kinds of infrastructure. The two distributions that we currently suggest are: -* [Zero to JupyterHub for Kubernetes](https://z2jh.jupyter.org) is a scalable JupyterHub deployment and +- [Zero to JupyterHub for Kubernetes](https://z2jh.jupyter.org) is a scalable JupyterHub deployment and guide that runs on Kubernetes. Better for larger or dynamic user groups (50-10,000) or more complex compute/data needs. -* [The Littlest JupyterHub](https://tljh.jupyter.org) is a lightweight JupyterHub that runs on a single +- [The Littlest JupyterHub](https://tljh.jupyter.org) is a lightweight JupyterHub that runs on a single single machine (in the cloud or under your desk). Better for smaller usergroups (4-80) or more lightweight computational resources. - ### Does JupyterHub run well in the cloud? Yes - most deployments of JupyterHub are run via cloud infrastructure and on a variety of cloud providers. @@ -123,9 +122,9 @@ The short answer: yes. JupyterHub as a standalone application has been battle-te level for several years, and makes a number of "default" security decisions that are reasonable for most users. -* For security considerations in the base JupyterHub application, +- For security considerations in the base JupyterHub application, [see the JupyterHub security page](https://jupyterhub.readthedocs.io/en/stable/reference/websecurity.html) -* For security considerations when deploying JupyterHub on Kubernetes, see the +- For security considerations when deploying JupyterHub on Kubernetes, see the [JupyterHub on Kubernetes security page](https://zero-to-jupyterhub.readthedocs.io/en/latest/security.html). The longer answer: it depends on your deployment. Because JupyterHub is very flexible, it can be used @@ -137,15 +136,13 @@ If you are worried about security, don't hesitate to reach out to the JupyterHub [Jupyter Community Forum](https://discourse.jupyter.org/c/jupyterhub). This community of practice has many individuals with experience running secure JupyterHub deployments. - ### Does JupyterHub provide computing or data infrastructure? -No - JupyterHub manages user sessions and can *control* computing infrastructure, but it does not provide these +No - JupyterHub manages user sessions and can _control_ computing infrastructure, but it does not provide these things itself. You are expected to run JupyterHub on your own infrastructure (local or in the cloud). Moreover, JupyterHub has no internal concept of "data", but is designed to be able to communicate with data repositories (again, either locally or remotely) for use within interactive computing sessions. - ### How do I manage users? JupyterHub offers a few options for managing your users. Upon setting up a JupyterHub, you can choose what @@ -154,7 +151,7 @@ email address, or choose a username / password when they first log-in, or offloa another service such as an organization's OAuth. The users of a JupyterHub are stored locally, and can be modified manually by an administrator of the JupyterHub. -Moreover, the *active* users on a JupyterHub can be found on the administrator's page. This page +Moreover, the _active_ users on a JupyterHub can be found on the administrator's page. This page gives you the abiltiy to stop or restart kernels, inspect user filesystems, and even take over user sessions to assist them with debugging. @@ -182,7 +179,6 @@ connect with other infrastructure tools (like Dask or Spark). This allows users scalable or high-performance resources from within their JupyterHub sessions. The logic of how those resources are controlled is taken care of by the non-JupyterHub application. - ### Can JupyterHub be used with my high-performance computing resources? Yes - JupyterHub can provide access to many kinds of computing infrastructure. @@ -218,7 +214,6 @@ the technologies your JupyterHub will use (e.g., dev-ops knowledge with cloud co In general, the base JupyterHub deployment is not the bottleneck for setup, it is connecting your JupyterHub with the various services and tools that you wish to provide to your users. - ### How well does JupyterHub scale? What are JupyterHub's limitations? JupyterHub works well at both a small scale (e.g., a single VM or machine) as well as a @@ -227,7 +222,6 @@ for user bases as large as 10,000. The scalability of JupyterHub largely depends infrastructure on which it is deployed. JupyterHub has been designed to be lightweight and flexible, so you can tailor your JupyterHub deployment to your needs. - ### Is JupyterHub resilient? What happens when a machine goes down? For JupyterHubs that are deployed in a containerized environment (e.g., Kubernetes), it is diff --git a/docs/source/getting-started/networking-basics.md b/docs/source/getting-started/networking-basics.md index 5fc44238..b844afe3 100644 --- a/docs/source/getting-started/networking-basics.md +++ b/docs/source/getting-started/networking-basics.md @@ -11,7 +11,7 @@ This section will help you with basic proxy and network configuration to: The Proxy's main IP address setting determines where JupyterHub is available to users. By default, JupyterHub is configured to be available on all network interfaces -(`''`) on port 8000. *Note*: Use of `'*'` is discouraged for IP configuration; +(`''`) on port 8000. _Note_: Use of `'*'` is discouraged for IP configuration; instead, use of `'0.0.0.0'` is preferred. Changing the Proxy's main IP address and port can be done with the following @@ -74,7 +74,7 @@ The Hub service listens only on `localhost` (port 8081) by default. The Hub needs to be accessible from both the proxy and all Spawners. When spawning local servers, an IP address setting of `localhost` is fine. -If *either* the Proxy *or* (more likely) the Spawners will be remote or +If _either_ the Proxy _or_ (more likely) the Spawners will be remote or isolated in containers, the Hub must listen on an IP that is accessible. ```python @@ -93,9 +93,9 @@ c.JupyterHub.hub_connect_ip = '10.0.1.4' # ip as seen on the docker network. Ca ## Adjusting the hub's URL -The hub will most commonly be running on a hostname of its own. If it +The hub will most commonly be running on a hostname of its own. If it is not – for example, if the hub is being reverse-proxied and being exposed at a URL such as `https://proxy.example.org/jupyter/` – then -you will need to tell JupyterHub the base URL of the service. In such +you will need to tell JupyterHub the base URL of the service. In such a case, it is both necessary and sufficient to set `c.JupyterHub.base_url = '/jupyter/'` in the configuration. diff --git a/docs/source/getting-started/services-basics.md b/docs/source/getting-started/services-basics.md index a5246350..5db9a6cb 100644 --- a/docs/source/getting-started/services-basics.md +++ b/docs/source/getting-started/services-basics.md @@ -16,8 +16,8 @@ document will: - clarify that API tokens can be used to authenticate to single-user servers as of [version 0.8.0](../changelog) - show how the [jupyterhub_idle_culler][] script can be: - - used in a Hub-managed service - - run as a standalone script + - used in a Hub-managed service + - run as a standalone script Both examples for `jupyterhub_idle_culler` will communicate tasks to the Hub via the REST API. diff --git a/docs/source/installation-guide-hard.md b/docs/source/installation-guide-hard.md deleted file mode 100644 index f53e528a..00000000 --- a/docs/source/installation-guide-hard.md +++ /dev/null @@ -1,347 +0,0 @@ -# Install JupyterHub and JupyterLab from the ground up - -The combination of [JupyterHub](https://jupyterhub.readthedocs.io) and [JupyterLab](https://jupyterlab.readthedocs.io) -is a great way to make shared computing resources available to a group. - -These instructions are a guide for a manual, 'bare metal' install of [JupyterHub](https://jupyterhub.readthedocs.io) -and [JupyterLab](https://jupyterlab.readthedocs.io). This is ideal for running on a single server: build a beast -of a machine and share it within your lab, or use a virtual machine from any VPS or cloud provider. - -This guide has similar goals to [The Littlest JupyterHub](https://the-littlest-jupyterhub.readthedocs.io) setup -script. However, instead of bundling all these step for you into one installer, we will perform every step manually. -This makes it easy to customize any part (e.g. if you want to run other services on the same system and need to make them -work together), as well as giving you full control and understanding of your setup. - - -## Prerequisites - -Your own server with administrator (root) access. This could be a local machine, a remotely hosted one, or a cloud instance -or VPS. Each user who will access JupyterHub should have a standard user account on the machine. The install will be done -through the command line - useful if you log into your machine remotely using SSH. - -This tutorial was tested on **Ubuntu 18.04**. No other Linux distributions have been tested, but the instructions -should be reasonably straightforward to adapt. - - -## Goals - -JupyterLab enables access to a multiple 'kernels', each one being a given environment for a given language. The most -common is a Python environment, for scientific computing usually one managed by the `conda` package manager. - -This guide will set up JupyterHub and JupyterLab seperately from the Python environment. In other words, we treat -JupyterHub+JupyterLab as a 'app' or webservice, which will connect to the kernels available on the system. Specifically: - -- We will create an installation of JupyterHub and JupyterLab using a virtualenv under `/opt` using the system Python. - -- We will install conda globally. - -- We will create a shared conda environment which can be used (but not modified) by all users. - -- We will show how users can create their own private conda environments, where they can install whatever they like. - - -The default JupyterHub Authenticator uses PAM to authenticate system users with their username and password. One can -[choose the authenticator](https://jupyterhub.readthedocs.io/en/stable/reference/authenticators.html#authenticators) -that best suits their needs. In this guide we will use the default Authenticator because it makes it easy for everyone to manage data -in their home folder and to mix and match different services and access methods (e.g. SSH) which all work using the -Linux system user accounts. Therefore, each user of JupyterHub will need a standard system user account. - -Another goal of this guide is to use system provided packages wherever possible. This has the advantage that these packages -get automatic patches and security updates (be sure to turn on automatic updates in Ubuntu). This means less maintenance -work and a more reliable system. - -## Part 1: JupyterHub and JupyterLab - -### Setup the JupyterHub and JupyterLab in a virtual environment - -First we create a virtual environment under '/opt/jupyterhub'. The '/opt' folder is where apps not belonging to the operating -system are [commonly installed](https://unix.stackexchange.com/questions/11544/what-is-the-difference-between-opt-and-usr-local). -Both jupyterlab and jupyterhub will be installed into this virtualenv. Create it with the command: - -```sh -sudo python3 -m venv /opt/jupyterhub/ -``` - -Now we use pip to install the required Python packages into the new virtual environment. Be sure to install -`wheel` first. Since we are separating the user interface from the computing kernels, we don't install -any Python scientific packages here. The only exception is `ipywidgets` because this is needed to allow connection -between interactive tools running in the kernel and the user interface. - -Note that we use `/opt/jupyterhub/bin/python3 -m pip install` each time - this [makes sure](https://snarky.ca/why-you-should-use-python-m-pip/) -that the packages are installed to the correct virtual environment. - -Perform the install using the following commands: - -```sh -sudo /opt/jupyterhub/bin/python3 -m pip install wheel -sudo /opt/jupyterhub/bin/python3 -m pip install jupyterhub jupyterlab -sudo /opt/jupyterhub/bin/python3 -m pip install ipywidgets -``` - -JupyterHub also currently defaults to requiring `configurable-http-proxy`, which needs `nodejs` and `npm`. The versions -of these available in Ubuntu therefore need to be installed first (they are a bit old but this is ok for our needs): - -```sh -sudo apt install nodejs npm -``` - -Then install `configurable-http-proxy`: - -```sh -sudo npm install -g configurable-http-proxy -``` - -### Create the configuration for JupyterHub - -Now we start creating configuration files. To keep everything together, we put all the configuration into the folder -created for the virtualenv, under `/opt/jupyterhub/etc/`. For each thing needing configuration, we will create a further -subfolder and necessary files. - -First create the folder for the JupyterHub configuration and navigate to it: - -```sh -sudo mkdir -p /opt/jupyterhub/etc/jupyterhub/ -cd /opt/jupyterhub/etc/jupyterhub/ -``` -Then generate the default configuration file - -```sh -sudo /opt/jupyterhub/bin/jupyterhub --generate-config -``` -This will produce the default configuration file `/opt/jupyterhub/etc/jupyterhub/jupyterhub_config.py` - -You will need to edit the configuration file to make the JupyterLab interface by the default. -Set the following configuration option in your `jupyterhub_config.py` file: - -```python -c.Spawner.default_url = '/lab' -``` - -Further configuration options may be found in the documentation. - -### Setup Systemd service - -We will setup JupyterHub to run as a system service using Systemd (which is responsible for managing all services and -servers that run on startup in Ubuntu). We will create a service file in a suitable location in the virtualenv folder -and then link it to the system services. First create the folder for the service file: - -```sh -sudo mkdir -p /opt/jupyterhub/etc/systemd -``` - -Then create the following text file using your [favourite editor](https://micro-editor.github.io/) at -```sh -/opt/jupyterhub/etc/systemd/jupyterhub.service -``` - -Paste the following service unit definition into the file: - -``` -[Unit] -Description=JupyterHub -After=syslog.target network.target - -[Service] -User=root -Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/jupyterhub/bin" -ExecStart=/opt/jupyterhub/bin/jupyterhub -f /opt/jupyterhub/etc/jupyterhub/jupyterhub_config.py - -[Install] -WantedBy=multi-user.target -``` - -This sets up the environment to use the virtual environment we created, tells Systemd how to start jupyterhub using -the configuration file we created, specifies that jupyterhub will be started as the `root` user (needed so that it can -start jupyter on behalf of other logged in users), and specifies that jupyterhub should start on boot after the network -is enabled. - -Finally, we need to make systemd aware of our service file. First we symlink our file into systemd's directory: - -```sh -sudo ln -s /opt/jupyterhub/etc/systemd/jupyterhub.service /etc/systemd/system/jupyterhub.service -``` - -Then tell systemd to reload its configuration files - -```sh -sudo systemctl daemon-reload -``` - -And finally enable the service - -```sh -sudo systemctl enable jupyterhub.service -``` - -The service will start on reboot, but we can start it straight away using: - -```sh -sudo systemctl start jupyterhub.service -``` - -...and check that it's running using: - -```sh -sudo systemctl status jupyterhub.service -``` - -You should now be already be able to access jupyterhub using `:8000` (assuming you haven't already set -up a firewall or something). However, when you log in the jupyter notebooks will be trying to use the Python virtualenv -that was created to install JupyterHub, this is not what we want. So on to part 2 - -## Part 2: Conda environments - -### Install conda for the whole system - -We will use `conda` to manage Python environments. We will install the officially maintained `conda` packages for Ubuntu, -this means they will get automatic updates with the rest of the system. Setup repo for the official Conda debian packages, -instructions are copied from [here](https://docs.conda.io/projects/conda/en/latest/user-guide/install/rpm-debian.html): - -Install Anacononda public gpg key to trusted store -```sh -curl https://repo.anaconda.com/pkgs/misc/gpgkeys/anaconda.asc | gpg --dearmor > conda.gpg -sudo install -o root -g root -m 644 conda.gpg /etc/apt/trusted.gpg.d/ -``` - -Add Debian repo - -```sh -echo "deb [arch=amd64] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" | sudo tee /etc/apt/sources.list.d/conda.list -``` - -Install conda - -```sh -sudo apt update -sudo apt install conda -``` - -This will install conda into the folder `/opt/conda/`, with the conda command available at `/opt/conda/bin/conda`. - -Finally, we can make conda more easily available to users by symlinking the conda shell setup script to the profile -'drop in' folder so that it gets run on login - -```sh -sudo ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh -``` - -### Install a default conda environment for all users - -First create a folder for conda envs (might exist already): -```sh -sudo mkdir /opt/conda/envs/ -``` - -Then create a conda environment to your liking within that folder. Here we have called it 'python' because it will -be the obvious default - call it whatever you like. You can install whatever you like into this environment, but you MUST at least install `ipykernel`. - -```sh -sudo /opt/conda/bin/conda create --prefix /opt/conda/envs/python python=3.7 ipykernel -``` - -Once your env is set up as desired, make it visible to Jupyter by installing the kernel spec. There are two options here: - -1 ) Install into the JupyterHub virtualenv - this ensures it overrides the default python version. It will only be visible -to the JupyterHub installation we have just created. This is useful to avoid conda environments appearing where they are not expected. - -```sh -sudo /opt/conda/envs/python/bin/python -m ipykernel install --prefix=/opt/jupyterhub/ --name 'python' --display-name "Python (default)" -``` - -2 ) Install it system-wide by putting it into `/usr/local`. It will be visible to any parallel install of JupyterHub or -JupyterLab, and will persist even if you later delete or modify the JupyterHub installation. This is useful if the kernels -might be used by other services, or if you want to modify the JupyterHub installation independently from the conda environments. - -```sh -sudo /opt/conda/envs/python/bin/python -m ipykernel install --prefix /usr/local/ --name 'python' --display-name "Python (default)" -```` - -### Setting up users' own conda environments - -There is relatively little for the administrator to do here, as users will have to set up their own environments using the shell. -On login they should run `conda init` or `/opt/conda/bin/conda`. The can then use conda to set up their environment, -although they must also install `ipykernel`. Once done, they can enable their kernel using: - -```sh -/path/to/kernel/env/bin/python -m ipykernel install --name 'python-my-env' --display-name "Python My Env" -``` - -This will place the kernel spec into their home folder, where Jupyter will look for it on startup. - - -## Setting up a reverse proxy - -The guide so far results in JupyterHub running on port 8000. It is not generally advisable to run open web services in -this way - instead, use a reverse proxy running on standard HTTP/HTTPS ports. - -> **Important**: Be aware of the security implications especially if you are running a server that is accessible from the open internet -> i.e. not protected within an institutional intranet or private home/office network. You should set up a firewall and -> HTTPS encryption, which is outside of the scope of this guide. For HTTPS consider using [LetsEncrypt](https://letsencrypt.org/) -> or setting up a [self-signed certificate](https://www.digitalocean.com/community/tutorials/how-to-create-a-self-signed-ssl-certificate-for-nginx-in-ubuntu-18-04). -> Firewalls may be set up using `ufw` or `firewalld` and combined with `fail2ban`. - -### Using Nginx -Nginx is a mature and established web server and reverse proxy and is easy to install using `sudo apt install nginx`. -Details on using Nginx as a reverse proxy can be found elsewhere. Here, we will only outline the additional steps needed -to setup JupyterHub with Nginx and host it at a given URL e.g. `/jupyter`. -This could be useful for example if you are running several services or web pages on the same server. - -To achieve this needs a few tweaks to both the JupyterHub configuration and the Nginx config. First, edit the -configuration file `/opt/jupyterhub/etc/jupyterhub/jupyterhub_config.py` and add the line: - -```python -c.JupyterHub.bind_url = 'http://:8000/jupyter' -``` - -where `/jupyter` will be the relative URL of the JupyterHub. - -Now Nginx must be configured with a to pass all traffic from `/jupyter` to the the local address `127.0.0.1:8000`. -Add the following snippet to your nginx configuration file (e.g. `/etc/nginx/sites-available/default`). - -``` - location /jupyter/ { - # NOTE important to also set base url of jupyterhub to /jupyter in its config - proxy_pass http://127.0.0.1:8000; - - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - - # websocket headers - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $connection_upgrade; - - } -``` - -Also add this snippet before the *server* block: - -``` -map $http_upgrade $connection_upgrade { - default upgrade; - '' close; - } -``` - -Nginx will not run if there are errors in the configuration, check your configuration using: - -```sh -nginx -t -``` - -If there are no errors, you can restart the Nginx service for the new configuration to take effect. - -```sh -sudo systemctl restart nginx.service -``` - - -## Getting started using your new JupyterHub - -Once you have setup JupyterHub and Nginx proxy as described, you can browse to your JupyterHub IP or URL -(e.g. if your server IP address is `123.456.789.1` and you decided to host JupyterHub at the `/jupyter` URL, browse -to `123.456.789.1/jupyter`). You will find a login page where you enter your Linux username and password. On login -you will be presented with the JupyterLab interface, with the file browser pane showing the contents of your users' -home directory on the server. diff --git a/docs/source/installation-guide-hard.rst b/docs/source/installation-guide-hard.rst new file mode 100644 index 00000000..ff9b9c05 --- /dev/null +++ b/docs/source/installation-guide-hard.rst @@ -0,0 +1,6 @@ +:orphan: + +JupyterHub the hard way +======================= + +This guide has moved to https://github.com/manics/jupyterhub-the-hard-way/blob/jupyterhub-alternative-doc/docs/installation-guide-hard.md diff --git a/docs/source/installation-guide.rst b/docs/source/installation-guide.rst index ad58488e..b2415fcc 100644 --- a/docs/source/installation-guide.rst +++ b/docs/source/installation-guide.rst @@ -11,4 +11,3 @@ running on your own infrastructure. quickstart quickstart-docker installation-basics - installation-guide-hard diff --git a/docs/source/quickstart.md b/docs/source/quickstart.md index b621aab2..e0b43ed4 100644 --- a/docs/source/quickstart.md +++ b/docs/source/quickstart.md @@ -12,23 +12,23 @@ Before installing JupyterHub, you will need: - [nodejs/npm](https://www.npmjs.com/). [Install nodejs/npm](https://docs.npmjs.com/getting-started/installing-node), 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. - * If you are using **`pip`**, install a recent version of + - If you are using **`pip`**, install a recent version of [nodejs/npm](https://docs.npmjs.com/getting-started/installing-node). For example, install it on Linux (Debian/Ubuntu) using: ``` sudo apt-get install npm nodejs-legacy ``` - + The `nodejs-legacy` package installs the `node` executable and is currently required for npm to work on Debian/Ubuntu. -- A [pluggable authentication module (PAM)](https://en.wikipedia.org/wiki/Pluggable_authentication_module) +- A [pluggable authentication module (PAM)](https://en.wikipedia.org/wiki/Pluggable_authentication_module) to use the [default Authenticator](./getting-started/authenticators-users-basics.md). - PAM is often available by default on most distributions, if this is not the case it can be installed by + PAM is often available by default on most distributions, if this is not the case it can be installed by using the operating system's package manager. - TLS certificate and key for HTTPS communication - Domain name @@ -78,12 +78,12 @@ Visit `https://localhost:8000` in your browser, and sign in with your unix credentials. To **allow multiple users to sign in** to the Hub server, you must start -`jupyterhub` as a *privileged user*, such as root: +`jupyterhub` as a _privileged user_, such as root: ```bash sudo jupyterhub ``` The [wiki](https://github.com/jupyterhub/jupyterhub/wiki/Using-sudo-to-run-JupyterHub-without-root-privileges) -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. diff --git a/docs/source/reference/authenticators.md b/docs/source/reference/authenticators.md index f0db22f0..e66e0b98 100644 --- a/docs/source/reference/authenticators.md +++ b/docs/source/reference/authenticators.md @@ -89,7 +89,6 @@ class DictionaryAuthenticator(Authenticator): return data['username'] ``` - #### Normalize usernames Since the Authenticator and Spawner both use the same username, @@ -111,11 +110,10 @@ When using `PAMAuthenticator`, you can set normalize usernames using PAM (basically round-tripping them: username to uid to username), which is useful in case you use some external service that allows multiple usernames mapping to the same user (such -as ActiveDirectory, yes, this really happens). When -`pam_normalize_username` is on, usernames are *not* normalized to +as ActiveDirectory, yes, this really happens). When +`pam_normalize_username` is on, usernames are _not_ normalized to lowercase. - #### Validate usernames In most cases, there is a very limited set of acceptable usernames. @@ -132,7 +130,6 @@ To only allow usernames that start with 'w': c.Authenticator.username_pattern = r'w.*' ``` - ### How to write a custom authenticator You can use custom Authenticator subclasses to enable authentication @@ -145,7 +142,6 @@ and [post_spawn_stop(user, spawner)][], are hooks that can be used to do auth-related startup (e.g. opening PAM sessions) and cleanup (e.g. closing PAM sessions). - See a list of custom Authenticators [on the wiki](https://github.com/jupyterhub/jupyterhub/wiki/Authenticators). If you are interested in writing a custom authenticator, you can read @@ -186,7 +182,6 @@ Additionally, configurable attributes for your authenticator will appear in jupyterhub help output and auto-generated configuration files via `jupyterhub --generate-config`. - ### Authentication state JupyterHub 0.8 adds the ability to persist state related to authentication, @@ -220,12 +215,10 @@ To store auth_state, two conditions must be met: export JUPYTERHUB_CRYPT_KEY=$(openssl rand -hex 32) ``` - JupyterHub uses [Fernet](https://cryptography.io/en/latest/fernet/) to encrypt auth_state. To facilitate key-rotation, `JUPYTERHUB_CRYPT_KEY` may be a semicolon-separated list of encryption keys. If there are multiple keys present, the **first** key is always used to persist any new auth_state. - #### Using auth_state Typically, if `auth_state` is persisted it is desirable to affect the Spawner environment in some way. @@ -266,11 +259,10 @@ PAM session. Beginning with version 0.8, JupyterHub is an OAuth provider. - -[Authenticator]: https://github.com/jupyterhub/jupyterhub/blob/master/jupyterhub/auth.py -[PAM]: https://en.wikipedia.org/wiki/Pluggable_authentication_module -[OAuth]: https://en.wikipedia.org/wiki/OAuth -[GitHub OAuth]: https://developer.github.com/v3/oauth/ -[OAuthenticator]: https://github.com/jupyterhub/oauthenticator +[authenticator]: https://github.com/jupyterhub/jupyterhub/blob/master/jupyterhub/auth.py +[pam]: https://en.wikipedia.org/wiki/Pluggable_authentication_module +[oauth]: https://en.wikipedia.org/wiki/OAuth +[github oauth]: https://developer.github.com/v3/oauth/ +[oauthenticator]: https://github.com/jupyterhub/oauthenticator [pre_spawn_start(user, spawner)]: https://jupyterhub.readthedocs.io/en/latest/api/auth.html#jupyterhub.auth.Authenticator.pre_spawn_start [post_spawn_stop(user, spawner)]: https://jupyterhub.readthedocs.io/en/latest/api/auth.html#jupyterhub.auth.Authenticator.post_spawn_stop diff --git a/docs/source/reference/config-ghoauth.md b/docs/source/reference/config-ghoauth.md index 6ec46e1c..f6aa5ca4 100644 --- a/docs/source/reference/config-ghoauth.md +++ b/docs/source/reference/config-ghoauth.md @@ -3,18 +3,17 @@ In this example, we show a configuration file for a fairly standard JupyterHub deployment with the following assumptions: -* Running JupyterHub on a single cloud server -* Using SSL on the standard HTTPS port 443 -* Using GitHub OAuth (using oauthenticator) for login -* Using the default spawner (to configure other spawners, uncomment and edit +- Running JupyterHub on a single cloud server +- Using SSL on the standard HTTPS port 443 +- Using GitHub OAuth (using oauthenticator) for login +- Using the default spawner (to configure other spawners, uncomment and edit `spawner_class` as well as follow the instructions for your desired spawner) -* Users exist locally on the server -* Users' notebooks to be served from `~/assignments` to allow users to browse +- Users exist locally on the server +- Users' notebooks to be served from `~/assignments` to allow users to browse for notebooks within other users' home directories -* You want the landing page for each user to be a `Welcome.ipynb` notebook in +- You want the landing page for each user to be a `Welcome.ipynb` notebook in their assignments directory. -* All runtime files are put into `/srv/jupyterhub` and log files in `/var/log`. - +- All runtime files are put into `/srv/jupyterhub` and log files in `/var/log`. The `jupyterhub_config.py` file would have these settings: diff --git a/docs/source/reference/config-proxy.md b/docs/source/reference/config-proxy.md index 181ebf41..60a101b7 100644 --- a/docs/source/reference/config-proxy.md +++ b/docs/source/reference/config-proxy.md @@ -6,12 +6,12 @@ SSL port `443`. This could be useful if the JupyterHub server machine is also hosting other domains or content on `443`. The goal in this example is to satisfy the following: -* JupyterHub is running on a server, accessed *only* via `HUB.DOMAIN.TLD:443` -* On the same machine, `NO_HUB.DOMAIN.TLD` strictly serves different content, +- JupyterHub is running on a server, accessed _only_ via `HUB.DOMAIN.TLD:443` +- On the same machine, `NO_HUB.DOMAIN.TLD` strictly serves different content, also on port `443` -* `nginx` or `apache` is used as the public access point (which means that - only nginx/apache will bind to `443`) -* After testing, the server in question should be able to score at least an A on the +- `nginx` or `apache` is used as the public access point (which means that + only nginx/apache will bind to `443`) +- After testing, the server in question should be able to score at least an A on the Qualys SSL Labs [SSL Server Test](https://www.ssllabs.com/ssltest/) Let's start out with needed JupyterHub configuration in `jupyterhub_config.py`: @@ -144,6 +144,7 @@ Now restart `nginx`, restart the JupyterHub, and enjoy accessing `https://NO_HUB.DOMAIN.TLD`. ### SELinux permissions for nginx + On distributions with SELinux enabled (e.g. Fedora), one may encounter permission errors when the nginx service is started. @@ -155,8 +156,8 @@ semanage port -a -t http_port_t -p tcp 8000 setsebool -P httpd_can_network_relay 1 setsebool -P httpd_can_network_connect 1 ``` -Replace 8000 with the port the jupyterhub server is running from. +Replace 8000 with the port the jupyterhub server is running from. ## Apache @@ -211,22 +212,24 @@ Listen 443 ``` - In case of the need to run the jupyterhub under /jhub/ or other location please use the below configurations: + - JupyterHub running locally at http://127.0.0.1:8000/jhub/ or other location httpd.conf amendments: + ```bash RewriteRule /jhub/(.*) ws://127.0.0.1:8000/jhub/$1 [NE.P,L] RewriteRule /jhub/(.*) http://127.0.0.1:8000/jhub/$1 [NE,P,L] - + ProxyPass /jhub/ http://127.0.0.1:8000/jhub/ ProxyPassReverse /jhub/ http://127.0.0.1:8000/jhub/ - ``` - +``` + jupyterhub_config.py amendments: - ```bash - --The public facing URL of the whole JupyterHub application. - --This is the address on which the proxy will bind. Sets protocol, ip, base_url - c.JupyterHub.bind_url = 'http://127.0.0.1:8000/jhub/' - ``` + +```bash + --The public facing URL of the whole JupyterHub application. + --This is the address on which the proxy will bind. Sets protocol, ip, base_url + c.JupyterHub.bind_url = 'http://127.0.0.1:8000/jhub/' +``` diff --git a/docs/source/reference/config-sudo.md b/docs/source/reference/config-sudo.md index cc0fdf9c..33e1ad00 100644 --- a/docs/source/reference/config-sudo.md +++ b/docs/source/reference/config-sudo.md @@ -9,7 +9,7 @@ Only do this if you are very sure you must. There are many Authenticators and Spawners available for JupyterHub. Some, such as DockerSpawner or OAuthenticator, do not need any elevated permissions. This document describes how to get the full default behavior of JupyterHub while -running notebook servers as real system users on a shared system without +running notebook servers as real system users on a shared system without running the Hub itself as root. Since JupyterHub needs to spawn processes as other users, the simplest way @@ -50,10 +50,9 @@ To do this we add to `/etc/sudoers` (use `visudo` for safe editing of sudoers): - specify the list of users `JUPYTER_USERS` for whom `rhea` can spawn servers - set the command `JUPYTER_CMD` that `rhea` can execute on behalf of users -- give `rhea` permission to run `JUPYTER_CMD` on behalf of `JUPYTER_USERS` +- give `rhea` permission to run `JUPYTER_CMD` on behalf of `JUPYTER_USERS` without entering a password - For example: ```bash @@ -91,16 +90,16 @@ $ adduser -G jupyterhub newuser Test that the new user doesn't need to enter a password to run the sudospawner command. -This should prompt for your password to switch to rhea, but *not* prompt for +This should prompt for your password to switch to rhea, but _not_ prompt for any password for the second switch. It should show some help output about logging options: ```bash $ sudo -u rhea sudo -n -u $USER /usr/local/bin/sudospawner --help Usage: /usr/local/bin/sudospawner [OPTIONS] - + Options: - + --help show this help information ... ``` @@ -151,12 +150,13 @@ We want our new user to be able to read the shadow passwords, so add it to the s $ sudo usermod -a -G shadow rhea ``` -If you want jupyterhub to serve pages on a restricted port (such as port 80 for http), +If you want jupyterhub to serve pages on a restricted port (such as port 80 for http), then you will need to give `node` permission to do so: ```bash sudo setcap 'cap_net_bind_service=+ep' /usr/bin/node ``` + However, you may want to further understand the consequences of this. You may also be interested in limiting the amount of CPU any process can use @@ -165,7 +165,6 @@ distributions' packaging system. This can be used to keep any user's process from using too much CPU cycles. You can configure it accoring to [these instructions](http://ubuntuforums.org/showthread.php?t=992706). - ### Shadow group (FreeBSD) **NOTE:** This has not been tested and may not work as expected. @@ -186,7 +185,7 @@ $ sudo chgrp shadow /etc/master.passwd $ sudo chmod g+r /etc/master.passwd ``` -We want our new user to be able to read the shadow passwords, so add it to the +We want our new user to be able to read the shadow passwords, so add it to the shadow group: ```bash @@ -220,7 +219,7 @@ Finally, start the server as our newly configured user, `rhea`: ```bash $ cd /etc/jupyterhub $ sudo -u rhea jupyterhub --JupyterHub.spawner_class=sudospawner.SudoSpawner -``` +``` And try logging in. @@ -228,7 +227,7 @@ And try logging in. If you still get a generic `Permission denied` `PermissionError`, it's possible SELinux is blocking you. Here's how you can make a module to allow this. -First, put this in a file named `sudo_exec_selinux.te`: +First, put this in a file named `sudo_exec_selinux.te`: ```bash module sudo_exec_selinux 1.1; diff --git a/docs/source/reference/config-user-env.md b/docs/source/reference/config-user-env.md index c085b106..524cdc41 100644 --- a/docs/source/reference/config-user-env.md +++ b/docs/source/reference/config-user-env.md @@ -22,20 +22,18 @@ This section will focus on user environments, including: - Installing kernelspecs - Using containers vs. multi-user hosts - ## Installing packages To make packages available to users, you generally will install packages system-wide or in a shared environment. This installation location should always be in the same environment that -`jupyterhub-singleuser` itself is installed in, and must be *readable and -executable* by your users. If you want users to be able to install additional -packages, it must also be *writable* by your users. +`jupyterhub-singleuser` itself is installed in, and must be _readable and +executable_ by your users. If you want users to be able to install additional +packages, it must also be _writable_ by your users. If you are using a standard system Python install, you would use: - ```bash sudo python3 -m pip install numpy ``` @@ -47,7 +45,6 @@ You may also use conda to install packages. If you do, you should make sure that the conda environment has appropriate permissions for users to be able to run Python code in the env. - ## Configuring Jupyter and IPython [Jupyter](https://jupyter-notebook.readthedocs.io/en/stable/config_overview.html) @@ -64,6 +61,7 @@ users. It's generally more efficient to configure user environments "system-wide and it's a good idea to avoid creating files in users' home directories. The typical locations for these config files are: + - **system-wide** in `/etc/{jupyter|ipython}` - **env-wide** (environment wide) in `{sys.prefix}/etc/{jupyter|ipython}`. @@ -91,7 +89,6 @@ c.MappingKernelManager.cull_idle_timeout = 20 * 60 c.MappingKernelManager.cull_interval = 2 * 60 ``` - ## Installing kernelspecs You may have multiple Jupyter kernels installed and want to make sure that @@ -119,7 +116,6 @@ sure are available, I can install their specs system-wide (in /usr/local) with: /path/to/python2 -m IPython kernel install --prefix=/usr/local ``` - ## Multi-user hosts vs. Containers There are two broad categories of user environments that depend on what @@ -141,8 +137,8 @@ When JupyterHub uses **container-based** Spawners (e.g. KubeSpawner or DockerSpawner), the 'system-wide' environment is really the container image which you are using for users. -In both cases, you want to *avoid putting configuration in user home -directories* because users can change those configuration settings. Also, +In both cases, you want to _avoid putting configuration in user home +directories_ because users can change those configuration settings. Also, home directories typically persist once they are created, so they are difficult for admins to update later. @@ -179,3 +175,13 @@ The number of named servers per user can be limited by setting ```python c.JupyterHub.named_server_limit_per_user = 5 ``` + +## Switching to Jupyter Server + +[Jupyter Server](https://jupyter-server.readthedocs.io/en/latest/) is a new Tornado Server backend for Jupyter web applications (e.g. JupyterLab 3.0 uses this package as its default backend). + +By default, the single-user notebook server uses the (old) `NotebookApp` from the [notebook](https://github.com/jupyter/notebook) package. You can switch to using Jupyter Server's `ServerApp` backend (this will likely become the default in future releases) by setting the `JUPYTERHUB_SINGLEUSER_APP` environment variable to: + +```bash +export JUPYTERHUB_SINGLEUSER_APP='jupyter_server.serverapp.ServerApp' +``` diff --git a/docs/source/reference/database.md b/docs/source/reference/database.md index 5db0b0d9..b5a89629 100644 --- a/docs/source/reference/database.md +++ b/docs/source/reference/database.md @@ -46,8 +46,8 @@ additional configuration required for MySQL that is not needed for PostgreSQL. - You should use the `pymysql` sqlalchemy provider (the other one, MySQLdb, isn't available for py3). -- You also need to set `pool_recycle` to some value (typically 60 - 300) - which depends on your MySQL setup. This is necessary since MySQL kills +- You also need to set `pool_recycle` to some value (typically 60 - 300) + which depends on your MySQL setup. This is necessary since MySQL kills connections serverside if they've been idle for a while, and the connection from the hub will be idle for longer than most connections. This behavior will lead to frustrating 'the connection has gone away' errors from diff --git a/docs/source/reference/proxy.md b/docs/source/reference/proxy.md index fd58816a..72963dba 100644 --- a/docs/source/reference/proxy.md +++ b/docs/source/reference/proxy.md @@ -54,7 +54,7 @@ class MyProxy(Proxy): """Stop the proxy""" ``` -These methods **may** be coroutines. +These methods **may** be coroutines. `c.Proxy.should_start` is a configurable flag that determines whether the Hub should call these methods when the Hub itself starts and stops. @@ -103,7 +103,7 @@ route to be proxied, such as `/user/name/`. A routespec will: When adding a route, JupyterHub may pass a JSON-serializable dict as a `data` argument that should be attached to the proxy route. When that route is -retrieved, the `data` argument should be returned as well. If your proxy +retrieved, the `data` argument should be returned as well. If your proxy implementation doesn't support storing data attached to routes, then your Python wrapper may have to handle storing the `data` piece itself, e.g in a simple file or database. @@ -136,7 +136,7 @@ async def delete_route(self, routespec): ### Retrieving routes -For retrieval, you only *need* to implement a single method that retrieves all +For retrieval, you only _need_ to implement a single method that retrieves all routes. The return value for this function should be a dictionary, keyed by `routespect`, of dicts whose keys are the same three arguments passed to `add_route` (`routespec`, `target`, `data`) diff --git a/docs/source/reference/rest.md b/docs/source/reference/rest.md index 0432f677..4b040ec1 100644 --- a/docs/source/reference/rest.md +++ b/docs/source/reference/rest.md @@ -169,7 +169,7 @@ curl -X POST -H "Authorization: token " "http://127.0.0.1:8081/hub/api/us ``` With the named-server functionality, it's now possible to launch more than one -specifically named servers against a given user. This could be used, for instance, +specifically named servers against a given user. This could be used, for instance, to launch each server based on a different image. First you must enable named-servers by including the following setting in the `jupyterhub_config.py` file. @@ -187,6 +187,7 @@ hub: ``` With that setting in place, a new named-server is activated like this: + ```bash curl -X POST -H "Authorization: token " "http://127.0.0.1:8081/hub/api/users//servers/" curl -X POST -H "Authorization: token " "http://127.0.0.1:8081/hub/api/users//servers/" @@ -201,7 +202,6 @@ will need to be able to handle the case of multiple servers per user and ensure uniqueness of names, particularly if servers are spawned via docker containers or kubernetes pods. - ## Learn more about the API You can see the full [JupyterHub REST API][] for details. This REST API Spec can @@ -210,6 +210,6 @@ Both resources contain the same information and differ only in its display. Note: The Swagger specification is being renamed the [OpenAPI Initiative][]. [interactive style on swagger's petstore]: http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyterhub/jupyterhub/master/docs/rest-api.yml#!/default -[OpenAPI Initiative]: https://www.openapis.org/ -[JupyterHub REST API]: ./rest-api -[Jupyter Notebook REST API]: http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml +[openapi initiative]: https://www.openapis.org/ +[jupyterhub rest api]: ./rest-api +[jupyter notebook rest api]: http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml diff --git a/docs/source/reference/separate-proxy.md b/docs/source/reference/separate-proxy.md index 92c19ef4..db370c9c 100644 --- a/docs/source/reference/separate-proxy.md +++ b/docs/source/reference/separate-proxy.md @@ -1,28 +1,26 @@ # Running proxy separately from the hub - ## Background The thing which users directly connect to is the proxy, by default -`configurable-http-proxy`. The proxy either redirects users to the +`configurable-http-proxy`. The proxy either redirects users to the hub (for login and managing servers), or to their own single-user -servers. Thus, as long as the proxy stays running, access to existing +servers. Thus, as long as the proxy stays running, access to existing servers continues, even if the hub itself restarts or goes down. When you first configure the hub, you may not even realize this -because the proxy is automatically managed by the hub. This is great +because the proxy is automatically managed by the hub. This is great for getting started and even most use, but everytime you restart the -hub, all user connections also get restarted. But it's also simple to +hub, all user connections also get restarted. But it's also simple to run the proxy as a service separate from the hub, so that you are free to reconfigure the hub while only interrupting users who are currently actively starting the hub. The default JupyterHub proxy is [configurable-http-proxy](https://github.com/jupyterhub/configurable-http-proxy), -and that page has some docs. If you are using a different proxy, such +and that page has some docs. If you are using a different proxy, such as Traefik, these instructions are probably not relevant to you. - ## Configuration options `c.JupyterHub.cleanup_servers = False` should be set, which tells the @@ -37,24 +35,20 @@ it yourself). token for authenticating communication with the proxy. `c.ConfigurableHTTPProxy.api_url = 'http://localhost:8001'` should be -set to the URL which the hub uses to connect *to the proxy's API*. - +set to the URL which the hub uses to connect _to the proxy's API_. ## Proxy configuration -You need to configure a service to start the proxy. An example -command line for this is `configurable-http-proxy --ip=127.0.0.1 ---port=8000 --api-ip=127.0.0.1 --api-port=8001 ---default-target=http://localhost:8081 ---error-target=http://localhost:8081/hub/error`. (Details for how to +You need to configure a service to start the proxy. An example +command line for this is `configurable-http-proxy --ip=127.0.0.1 --port=8000 --api-ip=127.0.0.1 --api-port=8001 --default-target=http://localhost:8081 --error-target=http://localhost:8081/hub/error`. (Details for how to do this is out of scope for this tutorial - for example it might be a -systemd service on within another docker cotainer). The proxy has no +systemd service on within another docker cotainer). The proxy has no configuration files, all configuration is via the command line and environment variables. `--api-ip` and `--api-port` (which tells the proxy where to listen) should match the hub's `ConfigurableHTTPProxy.api_url`. -`--ip`, `-port`, and other options configure the *user* connections to the proxy. +`--ip`, `-port`, and other options configure the _user_ connections to the proxy. `--default-target` and `--error-target` should point to the hub, and used when users navigate to the proxy originally. @@ -63,18 +57,16 @@ match the token given to `c.ConfigurableHTTPProxy.auth_token`. You should check the [configurable-http-proxy options](https://github.com/jupyterhub/configurable-http-proxy) to see -what other options are needed, for example SSL options. Note that +what other options are needed, for example SSL options. Note that these are configured in the hub if the hub is starting the proxy - you need to move the options to here. - ## Docker image You can use [jupyterhub configurable-http-proxy docker image](https://hub.docker.com/r/jupyterhub/configurable-http-proxy/) to run the proxy. - ## See also -* [jupyterhub configurable-http-proxy](https://github.com/jupyterhub/configurable-http-proxy) +- [jupyterhub configurable-http-proxy](https://github.com/jupyterhub/configurable-http-proxy) diff --git a/docs/source/reference/services.md b/docs/source/reference/services.md index 603234b0..f3f0e83f 100644 --- a/docs/source/reference/services.md +++ b/docs/source/reference/services.md @@ -45,17 +45,14 @@ A Service may have the following properties: - `url: str (default - None)` - The URL where the service is/should be. If a url is specified for where the Service runs its own web server, the service will be added to the proxy at `/services/:name` -- `api_token: str (default - None)` - For Externally-Managed Services you need to specify +- `api_token: str (default - None)` - For Externally-Managed Services you need to specify an API token to perform API requests to the Hub If a service is also to be managed by the Hub, it has a few extra options: -- `command: (str/Popen list)` - Command for JupyterHub to spawn the service. - - Only use this if the service should be a subprocess. - - If command is not specified, the Service is assumed to be managed - externally. - - If a command is specified for launching the Service, the Service will - be started and managed by the Hub. +- `command: (str/Popen list)` - Command for JupyterHub to spawn the service. - Only use this if the service should be a subprocess. - If command is not specified, the Service is assumed to be managed + externally. - If a command is specified for launching the Service, the Service will + be started and managed by the Hub. - `environment: dict` - additional environment variables for the Service. - `user: str` - the name of a system user to manage the Service. If unspecified, run as the same user as the Hub. @@ -103,9 +100,9 @@ parameters, which describe the environment needed to start the Service process: - `environment: dict` - additional environment variables for the Service. - `user: str` - name of the user to run the server if different from the Hub. - Requires Hub to be root. + Requires Hub to be root. - `cwd: path` directory in which to run the Service, if different from the - Hub directory. + Hub directory. The Hub will pass the following environment variables to launch the Service: @@ -199,16 +196,16 @@ can be used by services. You may go beyond this reference implementation and create custom hub-authenticating clients and services. We describe the process below. -The reference, or base, implementation is the [`HubAuth`][HubAuth] class, +The reference, or base, implementation is the [`HubAuth`][hubauth] class, which implements the requests to the Hub. To use HubAuth, you must set the `.api_token`, either programmatically when constructing the class, or via the `JUPYTERHUB_API_TOKEN` environment variable. -Most of the logic for authentication implementation is found in the -[`HubAuth.user_for_cookie`][HubAuth.user_for_cookie] -and in the -[`HubAuth.user_for_token`][HubAuth.user_for_token] +Most of the logic for authentication implementation is found in the +[`HubAuth.user_for_cookie`][hubauth.user_for_cookie] +and in the +[`HubAuth.user_for_token`][hubauth.user_for_token] methods, which makes a request of the Hub, and returns: - None, if no user could be identified, or @@ -285,11 +282,10 @@ def whoami(user): ) ``` - ### Authenticating tornado services with JupyterHub Since most Jupyter services are written with tornado, -we include a mixin class, [`HubAuthenticated`][HubAuthenticated], +we include a mixin class, [`HubAuthenticated`][hubauthenticated], for quickly authenticating your own tornado services with JupyterHub. Tornado's `@web.authenticated` method calls a Handler's `.get_current_user` @@ -310,7 +306,6 @@ class MyHandler(HubAuthenticated, web.RequestHandler): ... ``` - The HubAuth will automatically load the desired configuration from the Service environment variables. @@ -320,44 +315,42 @@ username and user group list, respectively. If a user matches neither the user list nor the group list, they will not be allowed access. If both are left undefined, then any user will be allowed. - ### Implementing your own Authentication with JupyterHub If you don't want to use the reference implementation (e.g. you find the implementation a poor fit for your Flask app), you can implement authentication via the Hub yourself. -We recommend looking at the [`HubAuth`][HubAuth] class implementation for reference, +We recommend looking at the [`HubAuth`][hubauth] class implementation for reference, and taking note of the following process: 1. retrieve the cookie `jupyterhub-services` from the request. 2. Make an API request `GET /hub/api/authorizations/cookie/jupyterhub-services/cookie-value`, - where cookie-value is the url-encoded value of the `jupyterhub-services` cookie. - This request must be authenticated with a Hub API token in the `Authorization` header, - for example using the `api_token` from your [external service's configuration](#externally-managed-services). + where cookie-value is the url-encoded value of the `jupyterhub-services` cookie. + This request must be authenticated with a Hub API token in the `Authorization` header, + for example using the `api_token` from your [external service's configuration](#externally-managed-services). - For example, with [requests][]: + For example, with [requests][]: - ```python - r = requests.get( - '/'.join(["http://127.0.0.1:8081/hub/api", - "authorizations/cookie/jupyterhub-services", - quote(encrypted_cookie, safe=''), - ]), - headers = { - 'Authorization' : 'token %s' % api_token, - }, - ) - r.raise_for_status() - user = r.json() - ``` + ```python + r = requests.get( + '/'.join(["http://127.0.0.1:8081/hub/api", + "authorizations/cookie/jupyterhub-services", + quote(encrypted_cookie, safe=''), + ]), + headers = { + 'Authorization' : 'token %s' % api_token, + }, + ) + r.raise_for_status() + user = r.json() + ``` 3. On success, the reply will be a JSON model describing the user: ```json { "name": "inara", - "groups": ["serenity", "guild"], - + "groups": ["serenity", "guild"] } ``` @@ -367,12 +360,11 @@ and an example of its configuration is found [here](https://github.com/jupyter/n nbviewer can also be run as a Hub-Managed Service as described [nbviewer README][nbviewer example] section on securing the notebook viewer. - [requests]: http://docs.python-requests.org/en/master/ [services_auth]: ../api/services.auth.html -[HubAuth]: ../api/services.auth.html#jupyterhub.services.auth.HubAuth -[HubAuth.user_for_cookie]: ../api/services.auth.html#jupyterhub.services.auth.HubAuth.user_for_cookie -[HubAuth.user_for_token]: ../api/services.auth.html#jupyterhub.services.auth.HubAuth.user_for_token -[HubAuthenticated]: ../api/services.auth.html#jupyterhub.services.auth.HubAuthenticated +[hubauth]: ../api/services.auth.html#jupyterhub.services.auth.HubAuth +[hubauth.user_for_cookie]: ../api/services.auth.html#jupyterhub.services.auth.HubAuth.user_for_cookie +[hubauth.user_for_token]: ../api/services.auth.html#jupyterhub.services.auth.HubAuth.user_for_token +[hubauthenticated]: ../api/services.auth.html#jupyterhub.services.auth.HubAuthenticated [nbviewer example]: https://github.com/jupyter/nbviewer#securing-the-notebook-viewer [jupyterhub_idle_culler]: https://github.com/jupyterhub/jupyterhub-idle-culler diff --git a/docs/source/reference/spawners.md b/docs/source/reference/spawners.md index 78a78d3f..562687bf 100644 --- a/docs/source/reference/spawners.md +++ b/docs/source/reference/spawners.md @@ -8,18 +8,17 @@ and a custom Spawner needs to be able to take three actions: - poll whether the process is still running - stop the process - ## Examples Custom Spawners for JupyterHub can be found on the [JupyterHub wiki](https://github.com/jupyterhub/jupyterhub/wiki/Spawners). Some examples include: - [DockerSpawner](https://github.com/jupyterhub/dockerspawner) for spawning user servers in Docker containers - * `dockerspawner.DockerSpawner` for spawning identical Docker containers for + - `dockerspawner.DockerSpawner` for spawning identical Docker containers for each users - * `dockerspawner.SystemUserSpawner` for spawning Docker containers with an + - `dockerspawner.SystemUserSpawner` for spawning Docker containers with an environment and home directory for each users - * both `DockerSpawner` and `SystemUserSpawner` also work with Docker Swarm for + - both `DockerSpawner` and `SystemUserSpawner` also work with Docker Swarm for launching containers on remote machines - [SudoSpawner](https://github.com/jupyterhub/sudospawner) enables JupyterHub to run without being root, by spawning an intermediate process via `sudo` @@ -30,7 +29,6 @@ Some examples include: - [SSHSpawner](https://github.com/NERSC/sshspawner) to spawn notebooks on a remote server using SSH - ## Spawner control methods ### Spawner.start @@ -41,7 +39,7 @@ an object encapsulating the user's name, authentication, and server info. The return value of `Spawner.start` should be the (ip, port) of the running server. -**NOTE:** When writing coroutines, *never* `yield` in between a database change and a commit. +**NOTE:** When writing coroutines, _never_ `yield` in between a database change and a commit. Most `Spawner.start` functions will look similar to this example: @@ -80,7 +78,6 @@ to check if the local process is still running. On Windows, it uses `psutil.pid_ `Spawner.stop` should stop the process. It must be a tornado coroutine, which should return when the process has finished exiting. - ## Spawner state JupyterHub should be able to stop and restart without tearing down @@ -112,7 +109,6 @@ def clear_state(self): self.pid = 0 ``` - ## Spawner options form (new in 0.4) @@ -170,8 +166,7 @@ which would return: When `Spawner.start` is called, this dictionary is accessible as `self.user_options`. - -[Spawner]: https://github.com/jupyterhub/jupyterhub/blob/master/jupyterhub/spawner.py +[spawner]: https://github.com/jupyterhub/jupyterhub/blob/master/jupyterhub/spawner.py ## Writing a custom spawner @@ -212,7 +207,6 @@ Additionally, configurable attributes for your spawner will appear in jupyterhub help output and auto-generated configuration files via `jupyterhub --generate-config`. - ## Spawners, resource limits, and guarantees (Optional) Some spawners of the single-user notebook servers allow setting limits or @@ -224,10 +218,9 @@ support for them**. For example, LocalProcessSpawner, the default spawner, does not support limits and guarantees. One of the spawners that supports limits and guarantees is the `systemdspawner`. - ### Memory Limits & 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 be available. In supported spawners, you can set `c.Spawner.mem_limit` to limit the total amount of memory that a single-user notebook server can @@ -235,8 +228,8 @@ allocate. Attempting to use more memory than this limit will cause errors. The single-user notebook server can discover its own memory limit by looking at the environment variable `MEM_LIMIT`, which is specified in absolute bytes. -`c.Spawner.mem_guarantee`: Sometimes, a **guarantee** of a *minimum amount of -memory* is desirable. In this case, you can set `c.Spawner.mem_guarantee` to +`c.Spawner.mem_guarantee`: Sometimes, a **guarantee** of a _minimum amount of +memory_ is desirable. In this case, you can set `c.Spawner.mem_guarantee` to to provide a guarantee that at minimum this much memory will always be available for the single-user notebook server to use. The environment variable `MEM_GUARANTEE` will also be set in the single-user notebook server. @@ -271,7 +264,7 @@ utilize these certs, there are two methods of interest on the base `Spawner` class: `.create_certs` and `.move_certs`. The first method, `.create_certs` will sign a key-cert pair using an internally -trusted authority for notebooks. During this process, `.create_certs` can +trusted authority for notebooks. During this process, `.create_certs` can apply `ip` and `dns` name information to the cert via an `alt_names` `kwarg`. This is used for certificate authentication (verification). Without proper verification, the `Notebook` will be unable to communicate with the `Hub` and diff --git a/docs/source/reference/templates.md b/docs/source/reference/templates.md index d820c099..38b7f0a0 100644 --- a/docs/source/reference/templates.md +++ b/docs/source/reference/templates.md @@ -1,8 +1,8 @@ # Working with templates and UI The pages of the JupyterHub application are generated from -[Jinja](http://jinja.pocoo.org/) templates. These allow the header, for -example, to be defined once and incorporated into all pages. By providing +[Jinja](http://jinja.pocoo.org/) templates. These allow the header, for +example, to be defined once and incorporated into all pages. By providing your own templates, you can have complete control over JupyterHub's appearance. @@ -20,7 +20,7 @@ or as few templates as you desire. Jinja provides a mechanism to [extend templates](http://jinja.pocoo.org/docs/2.10/templates/#template-inheritance). A base template can define a `block`, and child templates can replace or -supplement the material in the block. The +supplement the material in the block. The [JupyterHub templates](https://github.com/jupyterhub/jupyterhub/tree/master/share/jupyterhub/templates) make extensive use of blocks, which allows you to customize parts of the interface easily. @@ -32,8 +32,8 @@ In general, a child template can extend a base template, `page.html`, by beginni ``` This works, unless you are trying to extend the default template for the same -file name. Starting in version 0.9, you may refer to the base file with a -`templates/` prefix. Thus, if you are writing a custom `page.html`, start the +file name. Starting in version 0.9, you may refer to the base file with a +`templates/` prefix. Thus, if you are writing a custom `page.html`, start the file with this block: ```html @@ -41,7 +41,7 @@ file with this block: ``` By defining `block`s with same name as in the base template, child templates -can replace those sections with custom content. The content from the base +can replace those sections with custom content. The content from the base template can be included with the `{{ super() }}` directive. ### Example @@ -52,10 +52,7 @@ text about the server starting up, place this content in a file named `JupyterHub.template_paths` configuration option. ```html -{% extends "templates/spawn_pending.html" %} - -{% block message %} -{{ super() }} +{% extends "templates/spawn_pending.html" %} {% block message %} {{ super() }}

Patience is a virtue.

{% endblock %} ``` @@ -69,9 +66,8 @@ To add announcements to be displayed on a page, you have two options: ### Announcement Configuration Variables -If you set the configuration variable `JupyterHub.template_vars = -{'announcement': 'some_text'}`, the given `some_text` will be placed on -the top of all pages. The more specific variables +If you set the configuration variable `JupyterHub.template_vars = {'announcement': 'some_text'}`, the given `some_text` will be placed on +the top of all pages. The more specific variables `announcement_login`, `announcement_spawn`, `announcement_home`, and `announcement_logout` are more specific and only show on their respective pages (overriding the global `announcement` variable). @@ -79,13 +75,12 @@ Note that changing these variables require a restart, unlike direct template extension. You can get the same effect by extending templates, which allows you -to update the messages without restarting. Set +to update the messages without restarting. Set `c.JupyterHub.template_paths` as mentioned above, and then create a template (for example, `login.html`) with: ```html -{% extends "templates/login.html" %} -{% set announcement = 'some message' %} +{% extends "templates/login.html" %} {% set announcement = 'some message' %} ``` Extending `page.html` puts the message on all pages, but note that diff --git a/docs/source/reference/urls.md b/docs/source/reference/urls.md index 6497fcb1..d71feaf2 100644 --- a/docs/source/reference/urls.md +++ b/docs/source/reference/urls.md @@ -11,8 +11,6 @@ All authenticated handlers redirect to `/hub/login` to login users prior to being redirected back to the originating page. The returned request should preserve all query parameters. - - ## `/` The top-level request is always a simple redirect to `/hub/`, @@ -61,7 +59,7 @@ for starting and stopping the user's server. If named servers are enabled, there will be some additional tools for management of named servers. -*Version added: 1.0* named server UI is new in 1.0. +_Version added: 1.0_ named server UI is new in 1.0. ## `/hub/login` @@ -111,7 +109,7 @@ not the Hub. The username is the first part and, if using named servers, the server name is the second part. -If the user's server is *not* running, this will be redirected to `/hub/user/:username/...` +If the user's server is _not_ running, this will be redirected to `/hub/user/:username/...` ## `/hub/user/:username[/:servername]` @@ -123,8 +121,8 @@ Handling this URL is the most complicated condition in JupyterHub, because there can be many states: 1. server is not active - a. user matches - b. user doesn't match + a. user matches + b. user doesn't match 2. server is ready 3. server is pending, but not ready @@ -146,7 +144,7 @@ without additional user action (i.e. clicking the link on the page) ![Visiting a URL for a server that's not running](../images/not-running.png) -*Version changed: 1.0* +_Version changed: 1.0_ Prior to 1.0, this URL itself was responsible for spawning servers, and served the progress page if it was pending, @@ -165,7 +163,7 @@ indicating how to spawn the server. This is meant to help applications such as JupyterLab that are connected to a server that has stopped. -*Version changed: 1.0* +_Version changed: 1.0_ JupyterHub 0.9 failed these API requests with status 404, but 1.0 uses 503. @@ -207,12 +205,12 @@ and a POST request will trigger the actual spawn and redirect. ![The spawn form](../images/spawn-form.png) -*Version added: 1.0* +_Version added: 1.0_ 1.0 adds the ability to specify username and servername. Prior to 1.0, only `/hub/spawn` was recognized for the default server. -*Version changed: 1.0* +_Version changed: 1.0_ Prior to 1.0, this page redirected back to `/hub/user/:username`, which was responsible for triggering spawn and rendering progress, etc. @@ -221,7 +219,7 @@ which was responsible for triggering spawn and rendering progress, etc. ![The spawn pending page](../images/spawn-pending.png) -*Version added: 1.0* this URL is new in JupyterHub 1.0. +_Version added: 1.0_ this URL is new in JupyterHub 1.0. This page renders the progress view for the given spawn request. Once the server is ready, diff --git a/docs/source/reference/websecurity.md b/docs/source/reference/websecurity.md index b9b1df68..6171fac3 100644 --- a/docs/source/reference/websecurity.md +++ b/docs/source/reference/websecurity.md @@ -12,17 +12,17 @@ works. ## Semi-trusted and untrusted users -JupyterHub is designed to be a *simple multi-user server for modestly sized -groups* of **semi-trusted** users. While the design reflects serving semi-trusted +JupyterHub is designed to be a _simple multi-user server for modestly sized +groups_ of **semi-trusted** users. While the design reflects serving semi-trusted users, JupyterHub is not necessarily unsuitable for serving **untrusted** users. Using JupyterHub with **untrusted** users does mean more work by the administrator. Much care is required to secure a Hub, with extra caution on protecting users from each other as the Hub is serving untrusted users. -One aspect of JupyterHub's *design simplicity* for **semi-trusted** users is that -the Hub and single-user servers are placed in a *single domain*, behind a -[*proxy*][configurable-http-proxy]. If the Hub is serving untrusted +One aspect of JupyterHub's _design simplicity_ for **semi-trusted** users is that +the Hub and single-user servers are placed in a _single domain_, behind a +[_proxy_][configurable-http-proxy]. If the Hub is serving untrusted users, many of the web's cross-site protections are not applied between single-user servers and the Hub, or between single-user servers and each other, since browsers see the whole thing (proxy, Hub, and single user @@ -40,7 +40,7 @@ server. To protect all users from each other, JupyterHub administrators must ensure that: -* A user **does not have permission** to modify their single-user notebook server, +- A user **does not have permission** to modify their single-user notebook server, including: - A user **may not** install new packages in the Python environment that runs their single-user server. @@ -49,11 +49,11 @@ ensure that: directory that precedes the directory containing `jupyterhub-singleuser`. - A user may not modify environment variables (e.g. PATH, PYTHONPATH) for their single-user server. -* A user **may not** modify the configuration of the notebook server +- A user **may not** modify the configuration of the notebook server (the `~/.jupyter` or `JUPYTER_CONFIG_DIR` directory). If any additional services are run on the same domain as the Hub, the services -**must never** display user-authored HTML that is neither *sanitized* nor *sandboxed* +**must never** display user-authored HTML that is neither _sanitized_ nor _sandboxed_ (e.g. IFramed) to any user that lacks authentication as the author of a file. ## Mitigate security issues @@ -85,7 +85,7 @@ admin must enforce. ### Prevent spawners from evaluating shell configuration files For most Spawners, `PATH` is not something users can influence, but care should -be taken to ensure that the Spawner does *not* evaluate shell configuration +be taken to ensure that the Spawner does _not_ evaluate shell configuration files prior to launching the server. ### Isolate packages using virtualenv @@ -125,7 +125,6 @@ versions up to date. A handy website for testing your deployment is [Qualsys' SSL analyzer tool](https://www.ssllabs.com/ssltest/analyze.html). - [configurable-http-proxy]: https://github.com/jupyterhub/configurable-http-proxy ## Vulnerability reporting diff --git a/docs/source/troubleshooting.md b/docs/source/troubleshooting.md index 3958e590..3623c1b3 100644 --- a/docs/source/troubleshooting.md +++ b/docs/source/troubleshooting.md @@ -4,17 +4,20 @@ When troubleshooting, you may see unexpected behaviors or receive an error message. This section provide links for identifying the cause of the problem and how to resolve it. -[*Behavior*](#behavior) +[_Behavior_](#behavior) + - JupyterHub proxy fails to start - sudospawner fails to run - What is the default behavior when none of the lists (admin, allowed, allowed groups) are set? - JupyterHub Docker container not accessible at localhost -[*Errors*](#errors) +[_Errors_](#errors) + - 500 error after spawning my single-user server -[*How do I...?*](#how-do-i) +[_How do I...?_](#how-do-i) + - Use a chained SSL certificate - Install JupyterHub without a network connection - I want access to the whole filesystem, but still default users to their home directory @@ -25,7 +28,7 @@ problem and how to resolve it. - Toree integration with HDFS rack awareness script - Where do I find Docker images and Dockerfiles related to JupyterHub? -[*Troubleshooting commands*](#troubleshooting-commands) +[_Troubleshooting commands_](#troubleshooting-commands) ## Behavior @@ -34,8 +37,8 @@ problem and how to resolve it. If you have tried to start the JupyterHub proxy and it fails to start: - check if the JupyterHub IP configuration setting is - ``c.JupyterHub.ip = '*'``; if it is, try ``c.JupyterHub.ip = ''`` -- Try starting with ``jupyterhub --ip=0.0.0.0`` + `c.JupyterHub.ip = '*'`; if it is, try `c.JupyterHub.ip = ''` +- Try starting with `jupyterhub --ip=0.0.0.0` **Note**: If this occurs on Ubuntu/Debian, check that the you are using a recent version of node. Some versions of Ubuntu/Debian come with a version @@ -66,13 +69,13 @@ things like inspect other users' servers, or modify the user list at runtime). ### JupyterHub Docker container not accessible at localhost -Even though the command to start your Docker container exposes port 8000 -(`docker run -p 8000:8000 -d --name jupyterhub jupyterhub/jupyterhub jupyterhub`), -it is possible that the IP address itself is not accessible/visible. As a result -when you try http://localhost:8000 in your browser, you are unable to connect -even though the container is running properly. One workaround is to explicitly -tell Jupyterhub to start at `0.0.0.0` which is visible to everyone. Try this -command: +Even though the command to start your Docker container exposes port 8000 +(`docker run -p 8000:8000 -d --name jupyterhub jupyterhub/jupyterhub jupyterhub`), +it is possible that the IP address itself is not accessible/visible. As a result +when you try http://localhost:8000 in your browser, you are unable to connect +even though the container is running properly. One workaround is to explicitly +tell Jupyterhub to start at `0.0.0.0` which is visible to everyone. Try this +command: `docker run -p 8000:8000 -d --name jupyterhub jupyterhub/jupyterhub jupyterhub --ip 0.0.0.0 --port 8000` ### How can I kill ports from JupyterHub managed services that have been orphaned? @@ -108,7 +111,7 @@ sudo MY_ENV=abc123 \ ### How can I view the logs for JupyterHub or the user's Notebook servers when using the DockerSpawner? -Use `docker logs ` where `` is the container name defined within `docker-compose.yml`. For example, to view the logs of the JupyterHub container use: +Use `docker logs ` where `` is the container name defined within `docker-compose.yml`. For example, to view the logs of the JupyterHub container use: docker logs hub @@ -132,11 +135,11 @@ There are two likely reasons for this: 1. The single-user server cannot connect to the Hub's API (networking configuration problems) -2. The single-user server cannot *authenticate* its requests (invalid token) +2. The single-user server cannot _authenticate_ its requests (invalid token) #### Symptoms -The main symptom is a failure to load *any* page served by the single-user +The main symptom is a failure to load _any_ page served by the single-user server, met with a 500 error. This is typically the first page at `/user/` after logging in or clicking "Start my server". When a single-user notebook server receives a request, the notebook server makes an API request to the Hub to @@ -198,15 +201,15 @@ your server again. ##### Proxy settings (403 GET) -When your whole JupyterHub sits behind a organization proxy (*not* a reverse proxy like NGINX as part of your setup and *not* the configurable-http-proxy) the environment variables `HTTP_PROXY`, `HTTPS_PROXY`, `http_proxy` and `https_proxy` might be set. This confuses the jupyterhub-singleuser servers: When connecting to the Hub for authorization they connect via the proxy instead of directly connecting to the Hub on localhost. The proxy might deny the request (403 GET). This results in the singleuser server thinking it has a wrong auth token. To circumvent this you should add `,,localhost,127.0.0.1` to the environment variables `NO_PROXY` and `no_proxy`. +When your whole JupyterHub sits behind a organization proxy (_not_ a reverse proxy like NGINX as part of your setup and _not_ the configurable-http-proxy) the environment variables `HTTP_PROXY`, `HTTPS_PROXY`, `http_proxy` and `https_proxy` might be set. This confuses the jupyterhub-singleuser servers: When connecting to the Hub for authorization they connect via the proxy instead of directly connecting to the Hub on localhost. The proxy might deny the request (403 GET). This results in the singleuser server thinking it has a wrong auth token. To circumvent this you should add `,,localhost,127.0.0.1` to the environment variables `NO_PROXY` and `no_proxy`. ### Launching Jupyter Notebooks to run as an externally managed JupyterHub service with the `jupyterhub-singleuser` command returns a `JUPYTERHUB_API_TOKEN` error [JupyterHub services](https://jupyterhub.readthedocs.io/en/stable/reference/services.html) allow processes to interact with JupyterHub's REST API. Example use-cases include: -* **Secure Testing**: provide a canonical Jupyter Notebook for testing production data to reduce the number of entry points into production systems. -* **Grading Assignments**: provide access to shared Jupyter Notebooks that may be used for management tasks such grading assignments. -* **Private Dashboards**: share dashboards with certain group members. +- **Secure Testing**: provide a canonical Jupyter Notebook for testing production data to reduce the number of entry points into production systems. +- **Grading Assignments**: provide access to shared Jupyter Notebooks that may be used for management tasks such grading assignments. +- **Private Dashboards**: share dashboards with certain group members. If possible, try to run the Jupyter Notebook as an externally managed service with one of the provided [jupyter/docker-stacks](https://github.com/jupyter/docker-stacks). @@ -250,7 +253,6 @@ You would then set in your `jupyterhub_config.py` file the `ssl_key` and c.JupyterHub.ssl_cert = your_host-chained.crt c.JupyterHub.ssl_key = your_host.key - #### Example Your certificate provider gives you the following files: `example_host.crt`, @@ -402,8 +404,8 @@ SyntaxError: Missing parentheses in call to 'print' In order to resolve this issue, there are two potential options. 1. Update HDFS core-site.xml, so the parameter "net.topology.script.file.name" points to a custom -script (e.g. /etc/hadoop/conf/custom_topology_script.py). Copy the original script and change the first line point -to a python two installation (e.g. /usr/bin/python). + script (e.g. /etc/hadoop/conf/custom_topology_script.py). Copy the original script and change the first line point + to a python two installation (e.g. /usr/bin/python). 2. In spark-env.sh add a Python 2 installation to your path (e.g. export PATH=/opt/anaconda2/bin:$PATH). ### Where do I find Docker images and Dockerfiles related to JupyterHub? diff --git a/examples/bootstrap-script/README.md b/examples/bootstrap-script/README.md index d2f27053..ed7fe6ff 100644 --- a/examples/bootstrap-script/README.md +++ b/examples/bootstrap-script/README.md @@ -1,34 +1,34 @@ # Bootstrapping your users -Before spawning a notebook to the user, it could be useful to +Before spawning a notebook to the user, it could be useful to do some preparation work in a bootstrapping process. Common use cases are: -*Providing writeable storage for LDAP users* +_Providing writeable storage for LDAP users_ Your Jupyterhub is configured to use the LDAPAuthenticator and DockerSpawer. -* The user has no file directory on the host since your are using LDAP. -* When a user has no directory and DockerSpawner wants to mount a volume, -the spawner will use docker to create a directory. -Since the docker daemon is running as root, the generated directory for the volume -mount will not be writeable by the `jovyan` user inside of the container. -For the directory to be useful to the user, the permissions on the directory -need to be modified for the user to have write access. +- The user has no file directory on the host since your are using LDAP. +- When a user has no directory and DockerSpawner wants to mount a volume, + the spawner will use docker to create a directory. + Since the docker daemon is running as root, the generated directory for the volume + mount will not be writeable by the `jovyan` user inside of the container. + For the directory to be useful to the user, the permissions on the directory + need to be modified for the user to have write access. -*Prepopulating Content* +_Prepopulating Content_ Another use would be to copy initial content, such as tutorial files or reference - material, into the user's space when a notebook server is newly spawned. +material, into the user's space when a notebook server is newly spawned. You can define your own bootstrap process by implementing a `pre_spawn_hook` on any spawner. -The Spawner itself is passed as parameter to your hook and you can easily get the contextual information out of the spawning process. +The Spawner itself is passed as parameter to your hook and you can easily get the contextual information out of the spawning process. Similarly, there may be cases where you would like to clean up after a spawner stops. You may implement a `post_stop_hook` that is always executed after the spawner stops. -If you implement a hook, make sure that it is *idempotent*. It will be executed every time +If you implement a hook, make sure that it is _idempotent_. It will be executed every time a notebook server is spawned to the user. That means you should somehow ensure that things which should run only once are not running again and again. For example, before you create a directory, check if it exists. @@ -41,13 +41,13 @@ Create a directory for the user, if none exists ```python -# in jupyterhub_config.py +# in jupyterhub_config.py import os def create_dir_hook(spawner): username = spawner.user.name # get the username volume_path = os.path.join('/volumes/jupyterhub', username) if not os.path.exists(volume_path): - # create a directory with umask 0755 + # create a directory with umask 0755 # hub and container user must have the same UID to be writeable # still readable by other users on the system os.mkdir(volume_path, 0o755) @@ -83,17 +83,17 @@ in a new file in `/etc/sudoers.d`, or simply in `/etc/sudoers`. All new home directories will be created from `/etc/skel`, so make sure to place any custom homedir-contents in there. -### Example #3 - Run a shell script +### Example #3 - Run a shell script -You can specify a plain ole' shell script (or any other executable) to be run +You can specify a plain ole' shell script (or any other executable) to be run by the bootstrap process. -For example, you can execute a shell script and as first parameter pass the name +For example, you can execute a shell script and as first parameter pass the name of the user: ```python -# in jupyterhub_config.py +# in jupyterhub_config.py from subprocess import check_call import os def my_script_hook(spawner): @@ -106,7 +106,7 @@ c.Spawner.pre_spawn_hook = my_script_hook ``` -Here's an example on what you could do in your shell script. See also +Here's an example on what you could do in your shell script. See also `/examples/bootstrap-script/` ```bash @@ -126,7 +126,7 @@ fi # This example script will do the following: # - create one directory for the user $USER in a BASE_DIRECTORY (see below) -# - create a "tutorials" directory within and download and unzip +# - create a "tutorials" directory within and download and unzip # the PythonDataScienceHandbook from GitHub # Start the Bootstrap Process diff --git a/examples/external-oauth/README.md b/examples/external-oauth/README.md index a944cb68..fc94bb66 100644 --- a/examples/external-oauth/README.md +++ b/examples/external-oauth/README.md @@ -16,63 +16,62 @@ implementations in other web servers or languages. ## Run the example -1. generate an API token: +1. generate an API token: export JUPYTERHUB_API_TOKEN=$(openssl rand -hex 32) -2. launch a version of the the whoami service. - For `whoami-oauth`: +2. launch a version of the the whoami service. + For `whoami-oauth`: - bash launch-service.sh & + bash launch-service.sh & or for `whoami-oauth-basic`: - bash launch-service-basic.sh & + bash launch-service-basic.sh & -3. Launch JupyterHub: +3. Launch JupyterHub: jupyterhub -4. Visit http://127.0.0.1:5555/ +4. Visit http://127.0.0.1:5555/ After logging in with your local-system credentials, you should see a JSON dump of your user info: ```json { - "admin": false, - "last_activity": "2016-05-27T14:05:18.016372", - "name": "queequeg", - "pending": null, - "server": "/user/queequeg" + "admin": false, + "last_activity": "2016-05-27T14:05:18.016372", + "name": "queequeg", + "pending": null, + "server": "/user/queequeg" } ``` - The essential pieces for using JupyterHub as an OAuth provider are: 1. registering your service with jupyterhub: - ```python - c.JupyterHub.services = [ - { - # the name of your service - # should be simple and unique. - # mostly used to identify your service in logging - "name": "my-service", - # the oauth client id of your service - # must be unique but isn't private - # can be randomly generated or hand-written - "oauth_client_id": "abc123", - # the API token and client secret of the service - # should be generated securely, - # e.g. via `openssl rand -hex 32` - "api_token": "abc123...", - # the redirect target for jupyterhub to send users - # after successful authentication - "oauth_redirect_uri": "https://service-host/oauth_callback" - } - ] - ``` + ```python + c.JupyterHub.services = [ + { + # the name of your service + # should be simple and unique. + # mostly used to identify your service in logging + "name": "my-service", + # the oauth client id of your service + # must be unique but isn't private + # can be randomly generated or hand-written + "oauth_client_id": "abc123", + # the API token and client secret of the service + # should be generated securely, + # e.g. via `openssl rand -hex 32` + "api_token": "abc123...", + # the redirect target for jupyterhub to send users + # after successful authentication + "oauth_redirect_uri": "https://service-host/oauth_callback" + } + ] + ``` 2. Telling your service how to authenticate with JupyterHub. diff --git a/examples/postgres/README.md b/examples/postgres/README.md index 13cb9f5f..8c4aae33 100644 --- a/examples/postgres/README.md +++ b/examples/postgres/README.md @@ -4,14 +4,14 @@ This example shows how you can connect Jupyterhub to a Postgres database instead of the default SQLite backend. ### Running Postgres with Jupyterhub on the host. + 0. Uncomment and replace `ENV JPY_PSQL_PASSWORD arglebargle` with your own password in the Dockerfile for `examples/postgres/db`. (Alternatively, pass -e `JPY_PSQL_PASSWORD=` when you start the db container.) 1. `cd` to the root of your jupyterhub repo. -2. Build the postgres image with `docker build -t jupyterhub-postgres-db - examples/postgres/db`. This may take a minute or two the first time it's +2. Build the postgres image with `docker build -t jupyterhub-postgres-db examples/postgres/db`. This may take a minute or two the first time it's run. 3. Run the db image with `docker run -d -p 5433:5432 jupyterhub-postgres-db`. @@ -24,24 +24,22 @@ instead of the default SQLite backend. 5. Log in as the user running jupyterhub on your host machine. ### Running Postgres with Containerized Jupyterhub. + 0. Do steps 0-2 in from the above section, ensuring that the values set/passed for `JPY_PSQL_PASSWORD` match for the hub and db containers. -1. Build the hub image with `docker build -t jupyterhub-postgres-hub - examples/postgres/hub`. This may take a minute or two the first time it's +1. Build the hub image with `docker build -t jupyterhub-postgres-hub examples/postgres/hub`. This may take a minute or two the first time it's run. -2. Run the db image with `docker run -d --name=jpy-db - jupyterhub-postgres`. Note that, unlike when connecting to a host machine +2. Run the db image with `docker run -d --name=jpy-db jupyterhub-postgres`. Note that, unlike when connecting to a host machine jupyterhub, we don't specify a port-forwarding scheme here, but we do need to specify a name for the container. -3. Run the containerized hub with `docker run -it --link jpy-db:postgres - jupyterhub-postgres-hub`. This instructs docker to run the hub container +3. Run the containerized hub with `docker run -it --link jpy-db:postgres jupyterhub-postgres-hub`. This instructs docker to run the hub container with a link to the already-running db container, which will forward environment and connection information from the DB to the hub. 4. Log in as one of the users defined in the `examples/postgres/hub/` - Dockerfile. By default `rhea` is the server's admin user, `io` and + Dockerfile. By default `rhea` is the server's admin user, `io` and `ganymede` are non-admin users, and all users' passwords are their usernames. diff --git a/examples/service-announcement/README.md b/examples/service-announcement/README.md index 1476a57d..cff87ec3 100644 --- a/examples/service-announcement/README.md +++ b/examples/service-announcement/README.md @@ -1,4 +1,3 @@ - # Simple Announcement Service Example This is a simple service that allows administrators to manage announcements @@ -16,10 +15,10 @@ configuration file something like: ] This starts the announcements service up at `/services/announcement` when -JupyterHub launches. By default the announcement text is empty. +JupyterHub launches. By default the announcement text is empty. The `announcement` module has a configurable port (default 8888) and an API -prefix setting. By default the API prefix is `JUPYTERHUB_SERVICE_PREFIX` if +prefix setting. By default the API prefix is `JUPYTERHUB_SERVICE_PREFIX` if that environment variable is set or `/` if it is not. ## Managing the Announcement @@ -42,7 +41,7 @@ Anyone can read the announcement: The time the announcement was posted is recorded in the `timestamp` field and the user who posted the announcement is recorded in the `user` field. -To clear the announcement text, just DELETE. Only admin users can do this. +To clear the announcement text, just DELETE. Only admin users can do this. $ curl -X POST -H "Authorization: token " \ https://.../services/announcement @@ -50,11 +49,11 @@ To clear the announcement text, just DELETE. Only admin users can do this. ## Seeing the Announcement in JupyterHub To be able to render the announcement, include the provide `page.html` template -that extends the base `page.html` template. Set `c.JupyterHub.template_paths` +that extends the base `page.html` template. Set `c.JupyterHub.template_paths` in JupyterHub's configuration to include the path to the extending template. The template changes the `announcement` element and does a JQuery `$.get()` call to retrieve the announcement text. JupyterHub's configurable announcement template variables can be set for various -pages like login, logout, spawn, and home. Including the template provided in +pages like login, logout, spawn, and home. Including the template provided in this example overrides all of those. diff --git a/examples/service-announcement/templates/page.html b/examples/service-announcement/templates/page.html index 5ba023dd..42c976ab 100644 --- a/examples/service-announcement/templates/page.html +++ b/examples/service-announcement/templates/page.html @@ -1,14 +1,9 @@ -{% extends "templates/page.html" %} -{% block announcement %} -
-
-{% endblock %} - -{% block script %} -{{ super() }} +{% extends "templates/page.html" %} {% block announcement %} +
+{% endblock %} {% block script %} {{ super() }} {% endblock %} diff --git a/examples/service-notebook/README.md b/examples/service-notebook/README.md index f6be76b9..6ac3e84d 100644 --- a/examples/service-notebook/README.md +++ b/examples/service-notebook/README.md @@ -17,8 +17,8 @@ and the name of the shared-notebook service. In the external example, some extra steps are required to set up supervisor: -1. select a system user to run the service. This is a user on the system, and does not need to be a Hub user. Add this to the user field in `shared-notebook.conf`, replacing `someuser`. +1. select a system user to run the service. This is a user on the system, and does not need to be a Hub user. Add this to the user field in `shared-notebook.conf`, replacing `someuser`. 2. generate a secret token for authentication, and replace the `super-secret` fields in `shared-notebook-service` and `jupyterhub_config.py` 3. install `shared-notebook-service` somewhere on your system, and update `/path/to/shared-notebook-service` to the absolute path of this destination -3. copy `shared-notebook.conf` to `/etc/supervisor/conf.d/` -4. `supervisorctl reload` +4. copy `shared-notebook.conf` to `/etc/supervisor/conf.d/` +5. `supervisorctl reload` diff --git a/examples/service-whoami-flask/README.md b/examples/service-whoami-flask/README.md index 9addc52a..75555b24 100644 --- a/examples/service-whoami-flask/README.md +++ b/examples/service-whoami-flask/README.md @@ -4,21 +4,21 @@ Uses `jupyterhub.services.HubAuth` to authenticate requests with the Hub in a [f ## Run -1. Launch JupyterHub and the `whoami service` with +1. Launch JupyterHub and the `whoami service` with jupyterhub --ip=127.0.0.1 -2. Visit http://127.0.0.1:8000/services/whoami/ or http://127.0.0.1:8000/services/whoami-oauth/ +2. Visit http://127.0.0.1:8000/services/whoami/ or http://127.0.0.1:8000/services/whoami-oauth/ After logging in with your local-system credentials, you should see a JSON dump of your user info: ```json { - "admin": false, - "last_activity": "2016-05-27T14:05:18.016372", - "name": "queequeg", - "pending": null, - "server": "/user/queequeg" + "admin": false, + "last_activity": "2016-05-27T14:05:18.016372", + "name": "queequeg", + "pending": null, + "server": "/user/queequeg" } ``` @@ -29,5 +29,4 @@ A similar service could be run externally, by setting the JupyterHub service env JUPYTERHUB_API_TOKEN JUPYTERHUB_SERVICE_PREFIX - [flask]: http://flask.pocoo.org diff --git a/examples/service-whoami/README.md b/examples/service-whoami/README.md index b8ce3442..2a94385e 100644 --- a/examples/service-whoami/README.md +++ b/examples/service-whoami/README.md @@ -6,21 +6,21 @@ There is an implementation each of cookie-based `HubAuthenticated` and OAuth-bas ## Run -1. Launch JupyterHub and the `whoami service` with +1. Launch JupyterHub and the `whoami service` with jupyterhub --ip=127.0.0.1 -2. Visit http://127.0.0.1:8000/services/whoami or http://127.0.0.1:8000/services/whoami-oauth +2. Visit http://127.0.0.1:8000/services/whoami or http://127.0.0.1:8000/services/whoami-oauth After logging in with your local-system credentials, you should see a JSON dump of your user info: ```json { - "admin": false, - "last_activity": "2016-05-27T14:05:18.016372", - "name": "queequeg", - "pending": null, - "server": "/user/queequeg" + "admin": false, + "last_activity": "2016-05-27T14:05:18.016372", + "name": "queequeg", + "pending": null, + "server": "/user/queequeg" } ``` diff --git a/jupyterhub/apihandlers/users.py b/jupyterhub/apihandlers/users.py index f427455d..27e9bf0f 100644 --- a/jupyterhub/apihandlers/users.py +++ b/jupyterhub/apihandlers/users.py @@ -237,6 +237,13 @@ class UserAPIHandler(APIHandler): ) await maybe_future(self.authenticator.delete_user(user)) + + # allow the spawner to cleanup any persistent resources associated with the user + try: + await user.spawner.delete_forever() + except Exception as e: + self.log.error("Error cleaning up persistent resources: %s" % e) + # remove from registry self.users.delete(user) diff --git a/jupyterhub/app.py b/jupyterhub/app.py index a9e096bf..6d6da9ad 100644 --- a/jupyterhub/app.py +++ b/jupyterhub/app.py @@ -375,7 +375,8 @@ class JupyterHub(Application): 300, help="Interval (in seconds) at which to update last-activity timestamps." ).tag(config=True) proxy_check_interval = Integer( - 30, help="Interval (in seconds) at which to check if the proxy is running." + 5, + help="DEPRECATED since version 0.8: Use ConfigurableHTTPProxy.check_running_interval", ).tag(config=True) service_check_interval = Integer( 60, @@ -689,6 +690,7 @@ class JupyterHub(Application): ).tag(config=True) _proxy_config_map = { + 'proxy_check_interval': 'check_running_interval', 'proxy_cmd': 'command', 'debug_proxy': 'debug', 'proxy_auth_token': 'auth_token', @@ -847,15 +849,30 @@ class JupyterHub(Application): to reduce the cost of checking authentication tokens. """, ).tag(config=True) - cookie_secret = Bytes( + cookie_secret = Union( + [Bytes(), Unicode()], help="""The cookie secret to use to encrypt cookies. Loaded from the JPY_COOKIE_SECRET env variable by default. Should be exactly 256 bits (32 bytes). - """ + """, ).tag(config=True, env='JPY_COOKIE_SECRET') + @validate('cookie_secret') + def _validate_secret_key(self, proposal): + """Coerces strings with even number of hexadecimal characters to bytes.""" + r = proposal['value'] + if isinstance(r, str): + try: + return bytes.fromhex(r) + except ValueError: + raise ValueError( + "cookie_secret set as a string must contain an even amount of hexadecimal characters." + ) + else: + return r + @observe('cookie_secret') def _cookie_secret_check(self, change): secret = change.new @@ -1860,7 +1877,7 @@ class JupyterHub(Application): # don't allow bad tokens to create users db.delete(obj) db.commit() - raise + raise else: self.log.debug("Not duplicating token %s", orm_token) db.commit() diff --git a/jupyterhub/auth.py b/jupyterhub/auth.py index 33a00bef..c4151d18 100644 --- a/jupyterhub/auth.py +++ b/jupyterhub/auth.py @@ -185,6 +185,13 @@ class Authenticator(LoggingConfigurable): """ ) + def get_custom_html(self, base_url): + """Get custom HTML for the authenticator. + + .. versionadded: 1.4 + """ + return self.custom_html + login_service = Unicode( help=""" Name of the login service that this authenticator is providing using to authenticate users. diff --git a/jupyterhub/event-schemas/server-actions/v1.yaml b/jupyterhub/event-schemas/server-actions/v1.yaml index 35ffad67..9023b105 100644 --- a/jupyterhub/event-schemas/server-actions/v1.yaml +++ b/jupyterhub/event-schemas/server-actions/v1.yaml @@ -19,14 +19,14 @@ description: | 2. Events are only recorded when an action succeeds. type: object required: -- action -- username -- servername + - action + - username + - servername properties: action: enum: - - start - - stop + - start + - stop description: | Action performed by JupyterHub. @@ -36,7 +36,7 @@ properties: 1. start A user's server was successfully started - + 2. stop A user's server was successfully stopped username: diff --git a/jupyterhub/handlers/base.py b/jupyterhub/handlers/base.py index 0db1660c..b0e926ec 100644 --- a/jupyterhub/handlers/base.py +++ b/jupyterhub/handlers/base.py @@ -493,6 +493,11 @@ class BaseHandler(RequestHandler): path=url_path_join(self.base_url, 'services'), **kwargs, ) + # clear tornado cookie + self.clear_cookie( + '_xsrf', + **self.settings.get('xsrf_cookie_kwargs', {}), + ) # Reset _jupyterhub_user self._jupyterhub_user = None @@ -1186,8 +1191,8 @@ class BaseHandler(RequestHandler): """ Render jinja2 template - If sync is set to True, we return an awaitable - If sync is set to False, we render the template & return a string + If sync is set to True, we render the template & return a string + If sync is set to False, we return an awaitable """ template_ns = {} template_ns.update(self.template_namespace) @@ -1570,7 +1575,6 @@ class UserUrlHandler(BaseHandler): if self.subdomain_host: target = user.host + target - referer = self.request.headers.get('Referer', '') # record redirect count in query parameter if redirects: self.log.warning("Redirect loop detected on %s", self.request.uri) @@ -1582,8 +1586,12 @@ class UserUrlHandler(BaseHandler): query_parts['redirects'] = redirects + 1 url_parts = url_parts._replace(query=urlencode(query_parts, doseq=True)) target = urlunparse(url_parts) - elif '/user/{}'.format(user.name) in referer or not referer: - # add first counter only if it's a redirect from /user/:name -> /hub/user/:name + else: + # Start redirect counter. + # This should only occur for redirects from /user/:name -> /hub/user/:name + # when the corresponding server is already ready. + # We don't check this explicitly (direct visits to /hub/user are technically possible), + # but that's now the only normal way to get here. target = url_concat(target, {'redirects': 1}) self.redirect(target) diff --git a/jupyterhub/handlers/login.py b/jupyterhub/handlers/login.py index 605cd580..29f2ff02 100644 --- a/jupyterhub/handlers/login.py +++ b/jupyterhub/handlers/login.py @@ -3,6 +3,7 @@ # Distributed under the terms of the Modified BSD License. import asyncio +from jinja2 import Template from tornado import web from tornado.escape import url_escape from tornado.httputil import url_concat @@ -90,17 +91,23 @@ class LoginHandler(BaseHandler): """Render the login page.""" def _render(self, login_error=None, username=None): - return self.render_template( - 'login.html', - next=url_escape(self.get_argument('next', default='')), - username=username, - login_error=login_error, - custom_html=self.authenticator.custom_html, - login_url=self.settings['login_url'], - authenticator_login_url=url_concat( + context = { + "next": url_escape(self.get_argument('next', default='')), + "username": username, + "login_error": login_error, + "login_url": self.settings['login_url'], + "authenticator_login_url": url_concat( self.authenticator.login_url(self.hub.base_url), {'next': self.get_argument('next', '')}, ), + } + custom_html = Template( + self.authenticator.get_custom_html(self.hub.base_url) + ).render(**context) + return self.render_template( + 'login.html', + **context, + custom_html=custom_html, ) async def get(self): diff --git a/jupyterhub/handlers/pages.py b/jupyterhub/handlers/pages.py index 0acbc0d5..eae9b63f 100644 --- a/jupyterhub/handlers/pages.py +++ b/jupyterhub/handlers/pages.py @@ -501,20 +501,24 @@ class AdminHandler(BaseHandler): # get User.col.desc() order objects ordered = [getattr(c, o)() for c, o in zip(cols, orders)] + query = self.db.query(orm.User).outerjoin(orm.Spawner).distinct(orm.User.id) + subquery = query.subquery("users") users = ( self.db.query(orm.User) + .select_entity_from(subquery) .outerjoin(orm.Spawner) .order_by(*ordered) .limit(per_page) .offset(offset) ) + users = [self._user_from_orm(u) for u in users] running = [] for u in users: running.extend(s for s in u.spawners.values() if s.active) - pagination.total = self.db.query(orm.User.id).count() + pagination.total = query.count() auth_state = await self.current_user.get_auth_state() html = await self.render_template( diff --git a/jupyterhub/log.py b/jupyterhub/log.py index f9fbffe8..43a38d36 100644 --- a/jupyterhub/log.py +++ b/jupyterhub/log.py @@ -2,7 +2,9 @@ # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import json +import logging import traceback +from functools import partial from http.cookies import SimpleCookie from urllib.parse import urlparse from urllib.parse import urlunparse @@ -132,19 +134,25 @@ def log_request(handler): status < 300 and isinstance(handler, (StaticFileHandler, HealthCheckHandler)) ): # static-file success and 304 Found are debug-level - log_method = access_log.debug + log_level = logging.DEBUG elif status < 400: - log_method = access_log.info + log_level = logging.INFO elif status < 500: - log_method = access_log.warning + log_level = logging.WARNING else: - log_method = access_log.error + log_level = logging.ERROR uri = _scrub_uri(request.uri) headers = _scrub_headers(request.headers) request_time = 1000.0 * handler.request.request_time() + # always log slow responses (longer than 1s) at least info-level + if request_time >= 1000 and log_level < logging.INFO: + log_level = logging.INFO + + log_method = partial(access_log.log, log_level) + try: user = handler.current_user except (HTTPError, RuntimeError): diff --git a/jupyterhub/proxy.py b/jupyterhub/proxy.py index 077ed820..cf707d6f 100644 --- a/jupyterhub/proxy.py +++ b/jupyterhub/proxy.py @@ -450,7 +450,11 @@ class ConfigurableHTTPProxy(Proxy): Loaded from the CONFIGPROXY_AUTH_TOKEN env variable by default. """ ).tag(config=True) - check_running_interval = Integer(5, config=True) + check_running_interval = Integer( + 5, + help="Interval (in seconds) at which to check if the proxy is running.", + config=True, + ) @default('auth_token') def _auth_token_default(self): diff --git a/jupyterhub/services/auth.py b/jupyterhub/services/auth.py index 6eaa4caa..7b7320cb 100644 --- a/jupyterhub/services/auth.py +++ b/jupyterhub/services/auth.py @@ -19,6 +19,7 @@ import string import time import uuid import warnings +from unittest import mock from urllib.parse import quote from urllib.parse import urlencode @@ -832,8 +833,12 @@ class HubAuthenticated(object): # add state argument to OAuth url state = self.hub_auth.set_state_cookie(self, next_url=self.request.uri) login_url = url_concat(login_url, {'state': state}) - app_log.debug("Redirecting to login url: %s", login_url) - return login_url + # temporary override at setting level, + # to allow any subclass overrides of get_login_url to preserve their effect + # for example, APIHandler raises 403 to prevent redirects + with mock.patch.dict(self.application.settings, {"login_url": login_url}): + app_log.debug("Redirecting to login url: %s", login_url) + return super().get_login_url() def check_hub_user(self, model): """Check whether Hub-authenticated user or service should be allowed. diff --git a/jupyterhub/singleuser/mixins.py b/jupyterhub/singleuser/mixins.py index 850e592d..3fe7135e 100755 --- a/jupyterhub/singleuser/mixins.py +++ b/jupyterhub/singleuser/mixins.py @@ -9,13 +9,12 @@ with JupyterHub authentication mixins enabled. # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import asyncio -import importlib import json import os import random import secrets -from datetime import datetime -from datetime import timezone +import warnings +from datetime import datetime, timezone from textwrap import dedent from urllib.parse import urlparse @@ -24,7 +23,6 @@ from jinja2 import FunctionLoader from tornado import ioloop from tornado.httpclient import AsyncHTTPClient from tornado.httpclient import HTTPRequest -from tornado.web import HTTPError from tornado.web import RequestHandler from traitlets import Any from traitlets import Bool @@ -95,9 +93,19 @@ class JupyterHubLoginHandlerMixin: @staticmethod def get_user(handler): - """alternative get_current_user to query the Hub""" - # patch in HubAuthenticated class for querying the Hub for cookie authentication - if HubAuthenticatedHandler not in handler.__class__.__bases__: + """alternative get_current_user to query the Hub + + Thus shouldn't be called anymore because HubAuthenticatedHandler + should have already overridden get_current_user(). + + Keep here to prevent unlikely circumstance from losing auth. + """ + if HubAuthenticatedHandler not in handler.__class__.mro(): + warnings.warn( + f"Expected to see HubAuthenticatedHandler in {handler.__class__}.mro()", + RuntimeWarning, + stacklevel=2, + ) handler.__class__ = type( handler.__class__.__name__, (HubAuthenticatedHandler, handler.__class__), @@ -692,6 +700,7 @@ def make_singleuser_app(App): """ empty_parent_app = App() + log = empty_parent_app.log # detect base classes LoginHandler = empty_parent_app.login_handler_class @@ -708,6 +717,26 @@ def make_singleuser_app(App): "{}.base_handler_class must be defined".format(App.__name__) ) + # patch-in HubAuthenticatedHandler to BaseHandler, + # so anything inheriting from BaseHandler uses Hub authentication + if HubAuthenticatedHandler not in BaseHandler.__bases__: + new_bases = (HubAuthenticatedHandler,) + BaseHandler.__bases__ + log.debug( + f"Patching {BaseHandler}{BaseHandler.__bases__} -> {BaseHandler}{new_bases}" + ) + BaseHandler.__bases__ = new_bases + # We've now inserted our class as a parent of BaseHandler, + # but we also need to ensure BaseHandler *itself* doesn't + # override the public tornado API methods we have inserted. + # If they are defined in BaseHandler, explicitly replace them with our methods. + for name in ("get_current_user", "get_login_url"): + if name in BaseHandler.__dict__: + log.debug( + f"Overriding {BaseHandler}.{name} with HubAuthenticatedHandler.{name}" + ) + method = getattr(HubAuthenticatedHandler, name) + setattr(BaseHandler, name, method) + # create Handler classes from mixins + bases class JupyterHubLoginHandler(JupyterHubLoginHandlerMixin, LoginHandler): pass diff --git a/jupyterhub/spawner.py b/jupyterhub/spawner.py index 9121d165..dc335d47 100644 --- a/jupyterhub/spawner.py +++ b/jupyterhub/spawner.py @@ -13,6 +13,7 @@ import sys import warnings from subprocess import Popen from tempfile import mkdtemp +from urllib.parse import urlparse if os.name == 'nt': import psutil @@ -690,6 +691,19 @@ class Spawner(LoggingConfigurable): """ ).tag(config=True) + hub_connect_url = Unicode( + None, + allow_none=True, + help=""" + The URL the single-user server should connect to the Hub. + + If the Hub URL set in your JupyterHub config is not reachable + from spawned notebooks, you can set differnt URL by this config. + + Is None if you don't need to change the URL. + """, + ).tag(config=True) + def load_state(self, state): """Restore state of spawner from database. @@ -768,9 +782,15 @@ class Spawner(LoggingConfigurable): # Info previously passed on args env['JUPYTERHUB_USER'] = self.user.name env['JUPYTERHUB_SERVER_NAME'] = self.name - env['JUPYTERHUB_API_URL'] = self.hub.api_url + if self.hub_connect_url is not None: + hub_api_url = url_path_join( + self.hub_connect_url, urlparse(self.hub.api_url).path + ) + else: + hub_api_url = self.hub.api_url + env['JUPYTERHUB_API_URL'] = hub_api_url env['JUPYTERHUB_ACTIVITY_URL'] = url_path_join( - self.hub.api_url, + hub_api_url, 'users', # tolerate mocks defining only user.name getattr(self.user, 'escaped_name', self.user.name), diff --git a/jupyterhub/tests/mocking.py b/jupyterhub/tests/mocking.py index 5ae6ec8c..145ef2a9 100644 --- a/jupyterhub/tests/mocking.py +++ b/jupyterhub/tests/mocking.py @@ -93,6 +93,16 @@ class MockSpawner(SimpleLocalProcessSpawner): def _cmd_default(self): return [sys.executable, '-m', 'jupyterhub.tests.mocksu'] + async def delete_forever(self): + """Called when a user is deleted. + + This can do things like request removal of resources such as persistent storage. + Only called on stopped spawners, and is likely the last action ever taken for the user. + + Will only be called once on the user's default Spawner. + """ + pass + use_this_api_token = None def start(self): @@ -394,9 +404,10 @@ class StubSingleUserSpawner(MockSpawner): Should be: - authenticated, so we are testing auth - - always available (i.e. in base ServerApp and NotebookApp + - always available (i.e. in mocked ServerApp and NotebookApp) + - *not* an API handler that raises 403 instead of redirecting """ - return "/api/status" + return "/tree" _thread = None diff --git a/jupyterhub/tests/test_app.py b/jupyterhub/tests/test_app.py index accdd430..a918e9b7 100644 --- a/jupyterhub/tests/test_app.py +++ b/jupyterhub/tests/test_app.py @@ -199,6 +199,18 @@ def test_cookie_secret_env(tmpdir, request): assert not os.path.exists(hub.cookie_secret_file) +def test_cookie_secret_string_(): + cfg = Config() + + cfg.JupyterHub.cookie_secret = "not hex" + with pytest.raises(ValueError): + JupyterHub(config=cfg) + + cfg.JupyterHub.cookie_secret = "abc123" + app = JupyterHub(config=cfg) + assert app.cookie_secret == binascii.a2b_hex('abc123') + + async def test_load_groups(tmpdir, request): to_load = { 'blue': ['cyclops', 'rogue', 'wolverine'], diff --git a/jupyterhub/tests/test_db.py b/jupyterhub/tests/test_db.py index 9369cd77..beb63099 100644 --- a/jupyterhub/tests/test_db.py +++ b/jupyterhub/tests/test_db.py @@ -26,7 +26,8 @@ def generate_old_db(env_dir, hub_version, db_url): env_pip = os.path.join(env_dir, 'bin', 'pip') env_py = os.path.join(env_dir, 'bin', 'python') check_call([sys.executable, '-m', 'virtualenv', env_dir]) - pkgs = ['jupyterhub==' + hub_version] + # older jupyterhub needs older sqlachemy version + pkgs = ['jupyterhub==' + hub_version, 'sqlalchemy<1.4'] if 'mysql' in db_url: pkgs.append('mysql-connector-python') elif 'postgres' in db_url: diff --git a/jupyterhub/tests/test_singleuser.py b/jupyterhub/tests/test_singleuser.py index 49b366c9..8252f1d2 100644 --- a/jupyterhub/tests/test_singleuser.py +++ b/jupyterhub/tests/test_singleuser.py @@ -21,6 +21,7 @@ async def test_singleuser_auth(app): user = app.users['nandy'] if not user.running: await user.spawn() + await app.proxy.add_user(user) url = public_url(app, user) # no cookies, redirects to login page @@ -28,6 +29,11 @@ async def test_singleuser_auth(app): r.raise_for_status() assert '/hub/login' in r.url + # unauthenticated /api/ should 403, not redirect + api_url = url_path_join(url, "api/status") + r = await async_requests.get(api_url, allow_redirects=False) + assert r.status_code == 403 + # with cookies, login successful r = await async_requests.get(url, cookies=cookies) r.raise_for_status() diff --git a/jupyterhub/tests/test_spawner.py b/jupyterhub/tests/test_spawner.py index 7a37cc58..b73fb052 100644 --- a/jupyterhub/tests/test_spawner.py +++ b/jupyterhub/tests/test_spawner.py @@ -415,3 +415,14 @@ async def test_spawner_env(db): for key, value in env_overrides.items(): assert key in env assert env[key] == value + + +async def test_hub_connect_url(db): + spawner = new_spawner(db, hub_connect_url="https://example.com/") + name = spawner.user.name + env = spawner.get_env() + assert env["JUPYTERHUB_API_URL"] == "https://example.com/api" + assert ( + env["JUPYTERHUB_ACTIVITY_URL"] + == "https://example.com/api/users/%s/activity" % name + ) diff --git a/jupyterhub/tests/utils.py b/jupyterhub/tests/utils.py index b99ba4ea..e48d30b5 100644 --- a/jupyterhub/tests/utils.py +++ b/jupyterhub/tests/utils.py @@ -121,7 +121,7 @@ def auth_header(db, name): """Return header with user's API authorization token.""" user = find_user(db, name) if user is None: - user = add_user(db, name=name) + raise KeyError(f"No such user: {name}") token = user.new_api_token() return {'Authorization': 'token %s' % token} diff --git a/readthedocs.yml b/readthedocs.yml index 6349c32d..b7c0d3f0 100644 --- a/readthedocs.yml +++ b/readthedocs.yml @@ -13,7 +13,6 @@ python: path: . - requirements: docs/requirements.txt - formats: - htmlzip - epub diff --git a/requirements.txt b/requirements.txt index 3c4481be..0338b1c0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -alembic +alembic>=1.4 async_generator>=1.9 certipy>=0.1.2 entrypoints diff --git a/share/jupyterhub/static/js/admin.js b/share/jupyterhub/static/js/admin.js index 584786d7..d167853f 100644 --- a/share/jupyterhub/static/js/admin.js +++ b/share/jupyterhub/static/js/admin.js @@ -1,7 +1,7 @@ // Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. -require(["jquery", "moment", "jhapi", "utils"], function( +require(["jquery", "moment", "jhapi", "utils"], function ( $, moment, JHAPI, @@ -51,41 +51,41 @@ require(["jquery", "moment", "jhapi", "utils"], function( window.location = window.location.pathname + "?" + query.join("&"); } - $("th").map(function(i, th) { + $("th").map(function (i, th) { th = $(th); var col = th.data("sort"); if (!col || col.length === 0) { return; } var order = th.find("i").hasClass("fa-sort-desc") ? "asc" : "desc"; - th.find("a").click(function() { + th.find("a").click(function () { resort(col, order); }); }); - $(".time-col").map(function(i, el) { + $(".time-col").map(function (i, el) { // convert ISO datestamps to nice momentjs ones el = $(el); var m = moment(new Date(el.text().trim())); el.text(m.isValid() ? m.fromNow() : "Never"); }); - $(".stop-server").click(function() { + $(".stop-server").click(function () { var el = $(this); var row = getRow(el); var serverName = row.data("server-name"); var user = row.data("user"); el.text("stopping..."); - var stop = function(options) { + var stop = function (options) { return api.stop_server(user, options); }; if (serverName !== "") { - stop = function(options) { + stop = function (options) { return api.stop_named_server(user, serverName, options); }; } stop({ - success: function() { + success: function () { el.text("stop " + serverName).addClass("hidden"); row.find(".access-server").addClass("hidden"); row.find(".start-server").removeClass("hidden"); @@ -93,20 +93,20 @@ require(["jquery", "moment", "jhapi", "utils"], function( }); }); - $(".delete-server").click(function() { + $(".delete-server").click(function () { var el = $(this); var row = getRow(el); var serverName = row.data("server-name"); var user = row.data("user"); el.text("deleting..."); api.delete_named_server(user, serverName, { - success: function() { + success: function () { row.remove(); }, }); }); - $(".access-server").map(function(i, el) { + $(".access-server").map(function (i, el) { el = $(el); var row = getRow(el); var user = row.data("user"); @@ -120,7 +120,7 @@ require(["jquery", "moment", "jhapi", "utils"], function( if (admin_access && options_form) { // if admin access and options form are enabled // link to spawn page instead of making API requests - $(".start-server").map(function(i, el) { + $(".start-server").map(function (i, el) { el = $(el); var row = getRow(el); var user = row.data("user"); @@ -134,22 +134,22 @@ require(["jquery", "moment", "jhapi", "utils"], function( // since it would mean opening a bunch of tabs $("#start-all-servers").addClass("hidden"); } else { - $(".start-server").click(function() { + $(".start-server").click(function () { var el = $(this); var row = getRow(el); var user = row.data("user"); var serverName = row.data("server-name"); el.text("starting..."); - var start = function(options) { + var start = function (options) { return api.start_server(user, options); }; if (serverName !== "") { - start = function(options) { + start = function (options) { return api.start_named_server(user, serverName, options); }; } start({ - success: function() { + success: function () { el.text("start " + serverName).addClass("hidden"); row.find(".stop-server").removeClass("hidden"); row.find(".access-server").removeClass("hidden"); @@ -158,7 +158,7 @@ require(["jquery", "moment", "jhapi", "utils"], function( }); } - $(".edit-user").click(function() { + $(".edit-user").click(function () { var el = $(this); var row = getRow(el); var user = row.data("user"); @@ -172,7 +172,7 @@ require(["jquery", "moment", "jhapi", "utils"], function( $("#edit-user-dialog") .find(".save-button") - .click(function() { + .click(function () { var dialog = $("#edit-user-dialog"); var user = dialog.data("user"); var name = dialog.find(".username-input").val(); @@ -184,14 +184,14 @@ require(["jquery", "moment", "jhapi", "utils"], function( name: name, }, { - success: function() { + success: function () { window.location.reload(); }, } ); }); - $(".delete-user").click(function() { + $(".delete-user").click(function () { var el = $(this); var row = getRow(el); var user = row.data("user"); @@ -202,18 +202,18 @@ require(["jquery", "moment", "jhapi", "utils"], function( $("#delete-user-dialog") .find(".delete-button") - .click(function() { + .click(function () { var dialog = $("#delete-user-dialog"); var username = dialog.find(".delete-username").text(); console.log("deleting", username); api.delete_user(username, { - success: function() { + success: function () { window.location.reload(); }, }); }); - $("#add-users").click(function() { + $("#add-users").click(function () { var dialog = $("#add-users-dialog"); dialog.find(".username-input").val(""); dialog.find(".admin-checkbox").prop("checked", false); @@ -222,15 +222,12 @@ require(["jquery", "moment", "jhapi", "utils"], function( $("#add-users-dialog") .find(".save-button") - .click(function() { + .click(function () { var dialog = $("#add-users-dialog"); - var lines = dialog - .find(".username-input") - .val() - .split("\n"); + var lines = dialog.find(".username-input").val().split("\n"); var admin = dialog.find(".admin-checkbox").prop("checked"); var usernames = []; - lines.map(function(line) { + lines.map(function (line) { var username = line.trim(); if (username.length) { usernames.push(username); @@ -241,47 +238,45 @@ require(["jquery", "moment", "jhapi", "utils"], function( usernames, { admin: admin }, { - success: function() { + success: function () { window.location.reload(); }, } ); }); - $("#stop-all-servers").click(function() { + $("#stop-all-servers").click(function () { $("#stop-all-servers-dialog").modal(); }); - $("#start-all-servers").click(function() { + $("#start-all-servers").click(function () { $("#start-all-servers-dialog").modal(); }); $("#stop-all-servers-dialog") .find(".stop-all-button") - .click(function() { + .click(function () { // stop all clicks all the active stop buttons - $(".stop-server") - .not(".hidden") - .click(); + $(".stop-server").not(".hidden").click(); }); function start(el) { - return function() { + return function () { $(el).click(); }; } $("#start-all-servers-dialog") .find(".start-all-button") - .click(function() { + .click(function () { $(".start-server") .not(".hidden") - .each(function(i) { + .each(function (i) { setTimeout(start(this), i * 500); }); }); - $("#shutdown-hub").click(function() { + $("#shutdown-hub").click(function () { var dialog = $("#shutdown-hub-dialog"); dialog.find("input[type=checkbox]").prop("checked", true); dialog.modal(); @@ -289,7 +284,7 @@ require(["jquery", "moment", "jhapi", "utils"], function( $("#shutdown-hub-dialog") .find(".shutdown-button") - .click(function() { + .click(function () { var dialog = $("#shutdown-hub-dialog"); var servers = dialog.find(".shutdown-servers-checkbox").prop("checked"); var proxy = dialog.find(".shutdown-proxy-checkbox").prop("checked"); diff --git a/share/jupyterhub/static/js/home.js b/share/jupyterhub/static/js/home.js index 909c2b73..f4b30cf3 100644 --- a/share/jupyterhub/static/js/home.js +++ b/share/jupyterhub/static/js/home.js @@ -1,11 +1,7 @@ // Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. -require(["jquery", "moment", "jhapi"], function( - $, - moment, - JHAPI -) { +require(["jquery", "moment", "jhapi"], function ($, moment, JHAPI) { "use strict"; var base_url = window.jhdata.base_url; @@ -22,10 +18,7 @@ require(["jquery", "moment", "jhapi"], function( } function disableRow(row) { - row - .find(".btn") - .attr("disabled", true) - .off("click"); + row.find(".btn").attr("disabled", true).off("click"); } function enableRow(row, running) { @@ -68,7 +61,7 @@ require(["jquery", "moment", "jhapi"], function( // request api.stop_named_server(user, serverName, { - success: function() { + success: function () { enableRow(row, false); }, }); @@ -83,22 +76,22 @@ require(["jquery", "moment", "jhapi"], function( // request api.delete_named_server(user, serverName, { - success: function() { + success: function () { row.remove(); }, }); } // initial state: hook up click events - $("#stop").click(function() { + $("#stop").click(function () { $("#start") .attr("disabled", true) .attr("title", "Your server is stopping") - .click(function() { + .click(function () { return false; }); api.stop_server(user, { - success: function() { + success: function () { $("#stop").hide(); $("#start") .text("Start My Server") @@ -111,7 +104,7 @@ require(["jquery", "moment", "jhapi"], function( }); $(".new-server-btn").click(startServer); - $(".new-server-name").on('keypress', function(e) { + $(".new-server-name").on("keypress", function (e) { if (e.which === 13) { startServer.call(this); } @@ -121,7 +114,7 @@ require(["jquery", "moment", "jhapi"], function( $(".delete-server").click(deleteServer); // render timestamps - $(".time-col").map(function(i, el) { + $(".time-col").map(function (i, el) { // convert ISO datestamps to nice momentjs ones el = $(el); var m = moment(new Date(el.text().trim())); diff --git a/share/jupyterhub/static/js/jhapi.js b/share/jupyterhub/static/js/jhapi.js index c2d597ea..169cc143 100644 --- a/share/jupyterhub/static/js/jhapi.js +++ b/share/jupyterhub/static/js/jhapi.js @@ -1,10 +1,10 @@ // Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. -define(["jquery", "utils"], function($, utils) { +define(["jquery", "utils"], function ($, utils) { "use strict"; - var JHAPI = function(base_url) { + var JHAPI = function (base_url) { this.base_url = base_url; }; @@ -18,21 +18,21 @@ define(["jquery", "utils"], function($, utils) { error: utils.ajax_error_dialog, }; - var update = function(d1, d2) { - $.map(d2, function(i, key) { + var update = function (d1, d2) { + $.map(d2, function (i, key) { d1[key] = d2[key]; }); return d1; }; - var ajax_defaults = function(options) { + var ajax_defaults = function (options) { var d = {}; update(d, default_options); update(d, options); return d; }; - JHAPI.prototype.api_request = function(path, options) { + JHAPI.prototype.api_request = function (path, options) { options = options || {}; options = ajax_defaults(options || {}); var url = utils.url_path_join( @@ -43,13 +43,13 @@ define(["jquery", "utils"], function($, utils) { $.ajax(url, options); }; - JHAPI.prototype.start_server = function(user, options) { + JHAPI.prototype.start_server = function (user, options) { options = options || {}; options = update(options, { type: "POST", dataType: null }); this.api_request(utils.url_path_join("users", user, "server"), options); }; - JHAPI.prototype.start_named_server = function(user, server_name, options) { + JHAPI.prototype.start_named_server = function (user, server_name, options) { options = options || {}; options = update(options, { type: "POST", dataType: null }); this.api_request( @@ -58,13 +58,13 @@ define(["jquery", "utils"], function($, utils) { ); }; - JHAPI.prototype.stop_server = function(user, options) { + JHAPI.prototype.stop_server = function (user, options) { options = options || {}; options = update(options, { type: "DELETE", dataType: null }); this.api_request(utils.url_path_join("users", user, "server"), options); }; - JHAPI.prototype.stop_named_server = function(user, server_name, options) { + JHAPI.prototype.stop_named_server = function (user, server_name, options) { options = options || {}; options = update(options, { type: "DELETE", dataType: null }); this.api_request( @@ -73,21 +73,21 @@ define(["jquery", "utils"], function($, utils) { ); }; - JHAPI.prototype.delete_named_server = function(user, server_name, options) { + JHAPI.prototype.delete_named_server = function (user, server_name, options) { options = options || {}; options.data = JSON.stringify({ remove: true }); return this.stop_named_server(user, server_name, options); }; - JHAPI.prototype.list_users = function(options) { + JHAPI.prototype.list_users = function (options) { this.api_request("users", options); }; - JHAPI.prototype.get_user = function(user, options) { + JHAPI.prototype.get_user = function (user, options) { this.api_request(utils.url_path_join("users", user), options); }; - JHAPI.prototype.add_users = function(usernames, userinfo, options) { + JHAPI.prototype.add_users = function (usernames, userinfo, options) { options = options || {}; var data = update(userinfo, { usernames: usernames }); options = update(options, { @@ -99,7 +99,7 @@ define(["jquery", "utils"], function($, utils) { this.api_request("users", options); }; - JHAPI.prototype.edit_user = function(user, userinfo, options) { + JHAPI.prototype.edit_user = function (user, userinfo, options) { options = options || {}; options = update(options, { type: "PATCH", @@ -110,7 +110,7 @@ define(["jquery", "utils"], function($, utils) { this.api_request(utils.url_path_join("users", user), options); }; - JHAPI.prototype.admin_access = function(user, options) { + JHAPI.prototype.admin_access = function (user, options) { options = options || {}; options = update(options, { type: "POST", @@ -123,13 +123,13 @@ define(["jquery", "utils"], function($, utils) { ); }; - JHAPI.prototype.delete_user = function(user, options) { + JHAPI.prototype.delete_user = function (user, options) { options = options || {}; options = update(options, { type: "DELETE", dataType: null }); this.api_request(utils.url_path_join("users", user), options); }; - JHAPI.prototype.request_token = function(user, props, options) { + JHAPI.prototype.request_token = function (user, props, options) { options = options || {}; options = update(options, { type: "POST" }); if (props) { @@ -138,7 +138,7 @@ define(["jquery", "utils"], function($, utils) { this.api_request(utils.url_path_join("users", user, "tokens"), options); }; - JHAPI.prototype.revoke_token = function(user, token_id, options) { + JHAPI.prototype.revoke_token = function (user, token_id, options) { options = options || {}; options = update(options, { type: "DELETE" }); this.api_request( @@ -147,7 +147,7 @@ define(["jquery", "utils"], function($, utils) { ); }; - JHAPI.prototype.shutdown_hub = function(data, options) { + JHAPI.prototype.shutdown_hub = function (data, options) { options = options || {}; options = update(options, { type: "POST" }); if (data) { diff --git a/share/jupyterhub/static/js/not_running.js b/share/jupyterhub/static/js/not_running.js index 12ad601a..3195d65d 100644 --- a/share/jupyterhub/static/js/not_running.js +++ b/share/jupyterhub/static/js/not_running.js @@ -1,13 +1,13 @@ // Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. -require(["jquery", "utils"], function($, utils) { +require(["jquery", "utils"], function ($, utils) { "use strict"; var hash = utils.parse_url(window.location.href).hash; - if (hash !== undefined && hash !== '') { - var el = $("#start"); - var current_spawn_url = el.attr("href"); - el.attr("href", current_spawn_url + hash); + if (hash !== undefined && hash !== "") { + var el = $("#start"); + var current_spawn_url = el.attr("href"); + el.attr("href", current_spawn_url + hash); } }); diff --git a/share/jupyterhub/static/js/token.js b/share/jupyterhub/static/js/token.js index e7c0a992..2a0e3f7e 100644 --- a/share/jupyterhub/static/js/token.js +++ b/share/jupyterhub/static/js/token.js @@ -1,21 +1,21 @@ // Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. -require(["jquery", "jhapi", "moment"], function($, JHAPI, moment) { +require(["jquery", "jhapi", "moment"], function ($, JHAPI, moment) { "use strict"; var base_url = window.jhdata.base_url; var user = window.jhdata.user; var api = new JHAPI(base_url); - $(".time-col").map(function(i, el) { + $(".time-col").map(function (i, el) { // convert ISO datestamps to nice momentjs ones el = $(el); var m = moment(new Date(el.text().trim())); el.text(m.isValid() ? m.fromNow() : el.text()); }); - $("#request-token-form").submit(function() { + $("#request-token-form").submit(function () { var note = $("#token-note").val(); if (!note.length) { note = "Requested via token page"; @@ -24,7 +24,7 @@ require(["jquery", "jhapi", "moment"], function($, JHAPI, moment) { user, { note: note }, { - success: function(reply) { + success: function (reply) { $("#token-result").text(reply.token); $("#token-area").show(); }, @@ -40,12 +40,12 @@ require(["jquery", "jhapi", "moment"], function($, JHAPI, moment) { return element; } - $(".revoke-token-btn").click(function() { + $(".revoke-token-btn").click(function () { var el = $(this); var row = get_token_row(el); el.attr("disabled", true); api.revoke_token(user, row.data("token-id"), { - success: function(reply) { + success: function (reply) { row.remove(); }, }); diff --git a/share/jupyterhub/static/js/utils.js b/share/jupyterhub/static/js/utils.js index c09f48cf..96b3ee91 100644 --- a/share/jupyterhub/static/js/utils.js +++ b/share/jupyterhub/static/js/utils.js @@ -5,10 +5,10 @@ // Modifications Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. -define(["jquery"], function($) { +define(["jquery"], function ($) { "use strict"; - var url_path_join = function() { + var url_path_join = function () { // join a sequence of url components with '/' var url = ""; for (var i = 0; i < arguments.length; i++) { @@ -25,7 +25,7 @@ define(["jquery"], function($) { return url; }; - var parse_url = function(url) { + var parse_url = function (url) { // an `a` element with an href allows attr-access to the parsed segments of a URL // a = parse_url("http://localhost:8888/path/name#hash") // a.protocol = "http:" @@ -39,29 +39,24 @@ define(["jquery"], function($) { return a; }; - var encode_uri_components = function(uri) { + var encode_uri_components = function (uri) { // encode just the components of a multi-segment uri, // leaving '/' separators - return uri - .split("/") - .map(encodeURIComponent) - .join("/"); + return uri.split("/").map(encodeURIComponent).join("/"); }; - var url_join_encode = function() { + var url_join_encode = function () { // join a sequence of url components with '/', // encoding each component with encodeURIComponent return encode_uri_components(url_path_join.apply(null, arguments)); }; - var escape_html = function(text) { + var escape_html = function (text) { // escape text to HTML - return $("
") - .text(text) - .html(); + return $("
").text(text).html(); }; - var get_body_data = function(key) { + var get_body_data = function (key) { // get a url-encoded item from body.data and decode it // we should never have any encoded URLs anywhere else in code // until we are building an actual request @@ -69,7 +64,7 @@ define(["jquery"], function($) { }; // http://stackoverflow.com/questions/2400935/browser-detection-in-javascript - var browser = (function() { + var browser = (function () { if (typeof navigator === "undefined") { // navigator undefined in node return "None"; @@ -86,7 +81,7 @@ define(["jquery"], function($) { })(); // http://stackoverflow.com/questions/11219582/how-to-detect-my-browser-version-and-operating-system-using-javascript - var platform = (function() { + var platform = (function () { if (typeof navigator === "undefined") { // navigator undefined in node return "None"; @@ -99,7 +94,7 @@ define(["jquery"], function($) { return OSName; })(); - var ajax_error_msg = function(jqXHR) { + var ajax_error_msg = function (jqXHR) { // Return a JSON error message if there is one, // otherwise the basic HTTP status text. if (jqXHR.responseJSON && jqXHR.responseJSON.message) { @@ -109,7 +104,7 @@ define(["jquery"], function($) { } }; - var log_ajax_error = function(jqXHR, status, error) { + var log_ajax_error = function (jqXHR, status, error) { // log ajax failures with informative messages var msg = "API request failed (" + jqXHR.status + "): "; console.log(jqXHR); @@ -118,7 +113,7 @@ define(["jquery"], function($) { return msg; }; - var ajax_error_dialog = function(jqXHR, status, error) { + var ajax_error_dialog = function (jqXHR, status, error) { console.log("ajax dialog", arguments); var msg = log_ajax_error(jqXHR, status, error); var dialog = $("#error-dialog"); diff --git a/share/jupyterhub/static/less/login.less b/share/jupyterhub/static/less/login.less index f5ca78e5..2853749f 100644 --- a/share/jupyterhub/static/less/login.less +++ b/share/jupyterhub/static/less/login.less @@ -1,59 +1,62 @@ #login-main { - display: table; - height: 80vh; + display: table; + height: 80vh; - & #insecure-login-warning{ - .bg-warning(); - padding:10px; - } - - .service-login { - text-align: center; - display: table-cell; - vertical-align: middle; - margin: auto auto 20% auto; - } + & #insecure-login-warning { + .bg-warning(); + padding: 10px; + } - form { - display: table-cell; - vertical-align: middle; - margin: auto auto 20% auto; - width: 350px; - font-size: large; - } + .service-login { + text-align: center; + display: table-cell; + vertical-align: middle; + margin: auto auto 20% auto; + } - .input-group, input[type=text], button { - width: 100%; - } + form { + display: table-cell; + vertical-align: middle; + margin: auto auto 20% auto; + width: 350px; + font-size: large; + } - input[type=submit] { - margin-top: 0px; - } - - .form-control:focus, input[type=submit]:focus { - box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @jupyter-orange; - border-color: @jupyter-orange; - outline-color: @jupyter-orange; - } + .input-group, + input[type="text"], + button { + width: 100%; + } - .login_error { - color: orangered; - font-weight: bold; - text-align: center; - } + input[type="submit"] { + margin-top: 0px; + } - .auth-form-header { - padding: 10px 20px; - color: #fff; - background: @jupyter-orange; - border-radius: @border-radius-large @border-radius-large 0 0; - } + .form-control:focus, + input[type="submit"]:focus { + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px @jupyter-orange; + border-color: @jupyter-orange; + outline-color: @jupyter-orange; + } - .auth-form-body { - padding: 20px; - font-size: 14px; - border: thin silver solid; - border-top: none; - border-radius: 0 0 @border-radius-large @border-radius-large; - } + .login_error { + color: orangered; + font-weight: bold; + text-align: center; + } + + .auth-form-header { + padding: 10px 20px; + color: #fff; + background: @jupyter-orange; + border-radius: @border-radius-large @border-radius-large 0 0; + } + + .auth-form-body { + padding: 20px; + font-size: 14px; + border: thin silver solid; + border-top: none; + border-radius: 0 0 @border-radius-large @border-radius-large; + } } diff --git a/share/jupyterhub/static/less/page.less b/share/jupyterhub/static/less/page.less index 0d471a66..e8848b4e 100644 --- a/share/jupyterhub/static/less/page.less +++ b/share/jupyterhub/static/less/page.less @@ -49,18 +49,16 @@ // background: rgba(66, 165, 245, 0.2); // } - .feedback { - &-container { - margin-top: 16px; + &-container { + margin-top: 16px; + } + + &-widget { + padding: 5px 0px 0px 6px; + i { + font-size: 2em; + color: lightgrey; } - - &-widget { - padding: 5px 0px 0px 6px; - i { - font-size: 2em; - color: lightgrey; - } - } - + } } diff --git a/share/jupyterhub/static/less/style.less b/share/jupyterhub/static/less/style.less index d74d7efc..8cd185b8 100644 --- a/share/jupyterhub/static/less/style.less +++ b/share/jupyterhub/static/less/style.less @@ -12,7 +12,7 @@ * */ @import "../components/font-awesome/less/font-awesome.less"; -@fa-font-path: "../components/font-awesome/fonts"; +@fa-font-path: "../components/font-awesome/fonts"; /*! * diff --git a/share/jupyterhub/static/less/variables.less b/share/jupyterhub/static/less/variables.less index 88295e47..de11782d 100644 --- a/share/jupyterhub/static/less/variables.less +++ b/share/jupyterhub/static/less/variables.less @@ -4,8 +4,8 @@ @navbar-height: 40px; @grid-float-breakpoint: @screen-xs-min; -@jupyter-orange: #F37524; -@jupyter-red: #E34F21; +@jupyter-orange: #f37524; +@jupyter-red: #e34f21; // color blind-friendly alternative to red/green // from 5-class RdYlBu via colorbrewer.org // eliminate distinction between 'primary' and 'success' diff --git a/share/jupyterhub/templates/page.html b/share/jupyterhub/templates/page.html index f2564b66..f40a0a84 100644 --- a/share/jupyterhub/templates/page.html +++ b/share/jupyterhub/templates/page.html @@ -130,7 +130,9 @@ @@ -144,7 +146,7 @@ {% block login_widget %} {% if user %} - + Logout {% else %} Login diff --git a/singleuser/README.md b/singleuser/README.md index 9801b6dd..c39dcf78 100644 --- a/singleuser/README.md +++ b/singleuser/README.md @@ -31,6 +31,6 @@ This particular image runs as the `jovyan` user, with home directory at `/home/j ## Note on persistence -This home directory, `/home/jovyan`, is *not* persistent by default, +This home directory, `/home/jovyan`, is _not_ persistent by default, so some configuration is required unless the directory is to be used with temporary or demonstration JupyterHub deployments.