Skip to content

Commit a7bf2e8

Browse files
authored
Merge pull request #299 from datalayer-contrib/docs-1.0.0-review
docs: reviews for release 1.0.0
2 parents 097676b + 36d259b commit a7bf2e8

File tree

10 files changed

+224
-14
lines changed

10 files changed

+224
-14
lines changed

docs/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Jupyter Server Docs Sources
2+
3+
Read [this page](https://jupyter-server.readthedocs.io/en/latest/contributors/contributing.html#building-the-docs) to build the docs.

docs/source/developers/dependency.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ To pin your jupyter_server install to a specific version:
1818

1919
.. code-block:: console
2020
21-
> pip install jupyter_server==1.0
21+
> pip install jupyter_server==1.0.0

docs/source/developers/extensions.rst

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Server Extensions
44

55
A Jupyter Server extension is typically a module or package that extends to Server’s REST API/endpoints—i.e. adds extra request handlers to Server’s Tornado Web Application.
66

7+
You can check some simple examples on the `examples folder
8+
<https://github.com/jupyter/jupyter_server/tree/master/examples/simple>`_ in the GitHub jupyter_server repository.
9+
710
Authoring a basic server extension
811
==================================
912

@@ -376,12 +379,6 @@ Putting it all together, authors can distribute their extension following this s
376379
)
377380
378381
379-
Example Server Extension
380-
========================
381-
382-
You can check some simple example on the `GitHub jupyter_server repository
383-
<https://github.com/jupyter/jupyter_server/tree/master/examples/simple>`_.
384-
385382
386383
387384
.. links

docs/source/index.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ Welcome!
33

44
You've landed on the documentation pages for the **Jupyter Server** Project. Some other pages you may have been looking for:
55

6-
* `Jupyter Server Github Repo <https://github.com/jupyter/jupyter_server>`_
7-
* `JupyterLab Github Repo <https://github.com/jupyterlab/jupyterlab>`_
8-
* `Jupyter Notebook Github Repo <https://github.com/jupyter/notebook>`_
6+
* `Jupyter Server Github Repo <https://github.com/jupyter/jupyter_server>`_, the source code we describe in this code.
7+
* `Jupyter Notebook Github Repo <https://github.com/jupyter/notebook>`_ , the source code for the classic Notebook.
8+
* `JupyterLab Github Repo <https://github.com/jupyterlab/jupyterlab>`_, the JupyterLab server wich runs on the Jupyter Server.
99

1010

1111
Introduction
@@ -15,7 +15,7 @@ Jupyter Server is the backend—the core services, APIs, and `REST endpoints`_
1515

1616
.. note::
1717

18-
Jupyter Server is a replacement for the Tornado Web Server in `Jupyter Notebook`_. Jupyter web applications should move to using Jupyter Server. For help, see `this page <operators/migrate-from-nbserver>`_.
18+
Jupyter Server is a replacement for the Tornado Web Server in `Jupyter Notebook`_. Jupyter web applications should move to using Jupyter Server. For help, see the :ref:`migrate_from_notebook` page.
1919

2020
.. _Tornado: https://www.tornadoweb.org/en/stable/
2121
.. _Jupyter Notebook: https://github.com/jupyter/notebook
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
-----BEGIN PGP PUBLIC KEY BLOCK-----
2+
Version: GnuPG v2.0.22 (GNU/Linux)
3+
4+
mQINBFMx2LoBEAC9xU8JiKI1VlCJ4PT9zqhU5nChQZ06/bj1BBftiMJG07fdGVO0
5+
ibOn4TrCoRYaeRlet0UpHzxT4zDa5h3/usJaJNTSRwtWePw2o7Lik8J+F3LionRf
6+
8Jz81WpJ+81Klg4UWKErXjBHsu/50aoQm6ZNYG4S2nwOmMVEC4nc44IAA0bb+6kW
7+
saFKKzEDsASGyuvyutdyUHiCfvvh5GOC2h9mXYvl4FaMW7K+d2UgCYERcXDNy7C1
8+
Bw+uepQ9ELKdG4ZpvonO6BNr1BWLln3wk93AQfD5qhfsYRJIyj0hJlaRLtBU3i6c
9+
xs+gQNF4mPmybpPSGuOyUr4FYC7NfoG7IUMLj+DYa6d8LcMJO+9px4IbdhQvzGtC
10+
qz5av1TX7/+gnS4L8C9i1g8xgI+MtvogngPmPY4repOlK6y3l/W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39HAPRSIOFEX70+xV+6FZ17B7nixFGN+giTpGYOEdGFxtUNmHmf+
43+
waJoPECyImDwJvmlMTeP9jfahlB6Pzaxt6TBZYHetI/JR9FU69EmA+XfCSGt5S+0
44+
Eoc330gpsSzo2VlxwRCVNrcuKmG7PsFFANok05ssFq1/Djv5rJ++3lYb88b8HSP2
45+
3pQJPrM7cQNU8iPku9yLXkY5qsoZOH+3yAia554Dgc8WBhp6fWh58R0dIONQxbbo
46+
apNdwvlI8hKFB7TiUL6PNShE1yL+XD201iNkGAJXbLMIC1ImGLirUfU267A3Cop5
47+
hoGs179HGBcyj/sKA3uUIFdNtP+NndaP3v4iYhCitdVCvBJMm6K3tW88qkyRGzOk
48+
4PW422oyWKwbAPeMk5PubvEFuFAIoBAFn1zecrcOg85RzRnEeXaiemmmH8GOe1Xu
49+
Kh+7h8XXyG6RPFy8tCcLOTk+miTqX+4VWy+kVqoS2cQ5IV8WsJ3S7aeIy0H89Z8n
50+
5vmLc+Ibz+eT+rM=
51+
=XVDe
52+
-----END PGP PUBLIC KEY BLOCK-----

docs/source/operators/migrate-from-nbserver.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ You will have to create the following ``jupyter_server_config.py`` file.
2929
Running Jupyter Notebook on Jupyter Server
3030
==========================================
3131

32-
If you want to switch to Jupyter Server, but you still want to serve `Jupyter Notebook <https://github.com/jupyter/notebook>`_ to users, you can try `NBClassic <https://github.com/Zsailer/nbclassic>`_.
32+
If you want to switch to Jupyter Server, but you still want to serve `Jupyter Notebook <https://github.com/jupyter/notebook>`_ to users, you can try `NBClassic <https://github.com/jupyterlab/nbclassic>`_.
3333

3434
NBClassic is a Jupyter Server extension that serves the Notebook frontend (i.e. all static assets) on top of Jupyter Server. It even loads Jupyter Notebook's config files.
3535

docs/source/operators/security.rst

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,144 @@ but this is **NOT RECOMMENDED**, unless authentication or access restrictions ar
7777
c.ServerApp.token = ''
7878
c.ServerApp.password = ''
7979

80+
Security in notebook documents
81+
==============================
82+
83+
As Jupyter Server become more popular for sharing and collaboration,
84+
the potential for malicious people to attempt to exploit the notebook
85+
for their nefarious purposes increases. IPython 2.0 introduced a
86+
security model to prevent execution of untrusted code without explicit
87+
user input.
88+
89+
The problem
90+
-----------
91+
92+
The whole point of Jupyter is arbitrary code execution. We have no
93+
desire to limit what can be done with a notebook, which would negatively
94+
impact its utility.
95+
96+
Unlike other programs, a Jupyter notebook document includes output.
97+
Unlike other documents, that output exists in a context that can execute
98+
code (via Javascript).
99+
100+
The security problem we need to solve is that no code should execute
101+
just because a user has **opened** a notebook that **they did not
102+
write**. Like any other program, once a user decides to execute code in
103+
a notebook, it is considered trusted, and should be allowed to do
104+
anything.
105+
106+
Our security model
107+
------------------
108+
109+
- Untrusted HTML is always sanitized
110+
- Untrusted Javascript is never executed
111+
- HTML and Javascript in Markdown cells are never trusted
112+
- **Outputs** generated by the user are trusted
113+
- Any other HTML or Javascript (in Markdown cells, output generated by
114+
others) is never trusted
115+
- The central question of trust is "Did the current user do this?"
116+
117+
The details of trust
118+
--------------------
119+
120+
When a notebook is executed and saved, a signature is computed from a
121+
digest of the notebook's contents plus a secret key. This is stored in a
122+
database, writable only by the current user. By default, this is located at::
123+
124+
~/.local/share/jupyter/nbsignatures.db # Linux
125+
~/Library/Jupyter/nbsignatures.db # OS X
126+
%APPDATA%/jupyter/nbsignatures.db # Windows
127+
128+
Each signature represents a series of outputs which were produced by code the
129+
current user executed, and are therefore trusted.
130+
131+
When you open a notebook, the server computes its signature, and checks if it's
132+
in the database. If a match is found, HTML and Javascript
133+
output in the notebook will be trusted at load, otherwise it will be
134+
untrusted.
135+
136+
Any output generated during an interactive session is trusted.
137+
138+
Updating trust
139+
**************
140+
141+
A notebook's trust is updated when the notebook is saved. If there are
142+
any untrusted outputs still in the notebook, the notebook will not be
143+
trusted, and no signature will be stored. If all untrusted outputs have
144+
been removed (either via ``Clear Output`` or re-execution), then the
145+
notebook will become trusted.
146+
147+
While trust is updated per output, this is only for the duration of a
148+
single session. A newly loaded notebook file is either trusted or not in its
149+
entirety.
150+
151+
Explicit trust
152+
**************
153+
154+
Sometimes re-executing a notebook to generate trusted output is not an
155+
option, either because dependencies are unavailable, or it would take a
156+
long time. Users can explicitly trust a notebook in two ways:
157+
158+
- At the command-line, with::
159+
160+
jupyter trust /path/to/notebook.ipynb
161+
162+
- After loading the untrusted notebook, with ``File / Trust Notebook``
163+
164+
These two methods simply load the notebook, compute a new signature, and add
165+
that signature to the user's database.
166+
167+
Reporting security issues
168+
-------------------------
169+
170+
If you find a security vulnerability in Jupyter, either a failure of the
171+
code to properly implement the model described here, or a failure of the
172+
model itself, please report it to [email protected].
173+
174+
If you prefer to encrypt your security reports,
175+
you can use :download:`this PGP public key <ipython_security.asc>`.
176+
177+
Affected use cases
178+
------------------
179+
180+
Some use cases that work in Jupyter 1.0 became less convenient in
181+
2.0 as a result of the security changes. We do our best to minimize
182+
these annoyances, but security is always at odds with convenience.
183+
184+
Javascript and CSS in Markdown cells
185+
************************************
186+
187+
While never officially supported, it had become common practice to put
188+
hidden Javascript or CSS styling in Markdown cells, so that they would
189+
not be visible on the page. Since Markdown cells are now sanitized (by
190+
`Google Caja <https://developers.google.com/caja>`__), all Javascript
191+
(including click event handlers, etc.) and CSS will be stripped.
192+
193+
We plan to provide a mechanism for notebook themes, but in the meantime
194+
styling the notebook can only be done via either ``custom.css`` or CSS
195+
in HTML output. The latter only have an effect if the notebook is
196+
trusted, because otherwise the output will be sanitized just like
197+
Markdown.
198+
199+
Collaboration
200+
*************
201+
202+
When collaborating on a notebook, people probably want to see the
203+
outputs produced by their colleagues' most recent executions. Since each
204+
collaborator's key will differ, this will result in each share starting
205+
in an untrusted state. There are three basic approaches to this:
206+
207+
- re-run notebooks when you get them (not always viable)
208+
- explicitly trust notebooks via ``jupyter trust`` or the notebook menu
209+
(annoying, but easy)
210+
- share a notebook signatures database, and use configuration dedicated to the
211+
collaboration while working on the project.
212+
213+
To share a signatures database among users, you can configure:
214+
215+
.. code-block:: python
216+
217+
c.NotebookNotary.data_dir = "/path/to/signature_dir"
218+
219+
to specify a non-default path to the SQLite database (of notebook hashes,
220+
essentially).

docs/source/other/changelog.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@ We strongly recommend that you upgrade to version 9+ of pip before upgrading ``j
2121
Use ``pip install pip --upgrade`` to upgrade pip. Check pip version with
2222
``pip --version``.
2323

24+
.. _release-1.0.0:
25+
26+
1.0.0
27+
-----
28+
29+
- Extension discovery
30+
- Classic server extension discovery and support
31+
- Bug fixes
32+
- Ready for users
33+
- JupyterLab is the first server running on top of Jupyter Server
34+
2435
.. _release-0.0.2:
2536

2637
0.0.2

docs/source/other/full-config.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ Session.unpacker : DottedObjectName
669669
Only used with custom functions for `packer`.
670670

671671
Session.username : Unicode
672-
Default: ``'zsailer'``
672+
Default: ``'echar4'``
673673

674674
Username for the Session. Default is your system username.
675675

@@ -685,6 +685,11 @@ MultiKernelManager.kernel_manager_class : DottedObjectName
685685
subclassing of the KernelManager for customized behavior.
686686

687687

688+
MultiKernelManager.shared_context : Bool
689+
Default: ``True``
690+
691+
Share a single zmq.Context to talk to all my kernels
692+
688693
MappingKernelManager.allowed_message_types : List
689694
Default: ``[]``
690695

@@ -897,7 +902,7 @@ FileContentsManager.root_dir : Unicode
897902

898903
No description
899904

900-
NotebookNotary.algorithm : 'md5'|'sha3_384'|'sha3_512'|'sha256'|'sha1'|'blake2s'|'sha3_256'|'sha3_224'|'sha384'|'sha512'|'blake2b'|'sha224'
905+
NotebookNotary.algorithm : 'md5'|'sha3_512'|'blake2b'|'sha3_384'|'sha3_256'|'sha224'|'sha3_224'|'sha384'|'sha512'|'blake2s'|'sha1'|'sha256'
901906
Default: ``'sha256'``
902907
903908
The hashing algorithm used to sign notebooks.

docs/source/users/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ The Jupyter Server is a highly technical piece of the Jupyter Stack, so users pr
55

66

77
.. toctree::
8+
:caption: Users
89
:maxdepth: 1
910
:name: users
1011

0 commit comments

Comments
 (0)