Document collaboration for JupyterLab and JupyterLite, powered by y-webrtc
Project description
jupyterlab-webrtc-docprovider
Document collaboration for JupyterLab, powered by y-webrtc.
Requirements
- Python >=3.7
- JupyterLab >=3.1
- or a derived application like JupyterLite or RetroLab
How to Use It
- Install the package
- Configure your server for collaboration
- Launch a Lumino-based Jupyter client that supports collaboration
- e.g. JupyterLab 3.1+, RetroLab 0.3+, or JupyterLite (beta)
- Open the client with the
room
URL parameters- e.g.
http://localhost:8888/lab?room=demo
- optionally provide
username
andusercolor
- e.g.
http://localhost:8888/lab?room=demo&username=jo&usercolor=e65100
- e.g.
- these parameters will probably be consumed, but that's okay
- e.g.
- Open a shared editing activity like Notebook or Editor
Install
To install the extension, run:
pip install jupyterlab-webrtc-docprovider
For a development install, see the contributing guide.
How it Works
Unlike JupyterLab's built-in, purely WebSocket-based collaborative document provider,
jupyterlab-webrtc-docprovider
relies on:
- an initialing signaling server to locate peers
- the WebRTC protocol to coordinate actual data exchange
Configuration
Server Configuration
Jupyter Server is configured with jupyter_server_config.json
:
{
"LabServerApp": {
"collaborative": true
}
}
collaborative
This flag must be enabled for the provider to be used.
In JupyterLite, this is a configurable of
jupyter-config-data
injupyter-lite.json
.
Client Configuration
User-configurable settings can be pre-populated in
{sys.prefix}/share/jupyter/lab/settings/overrides.json
: roomPrefix
and
signalingUrls
are security-related.
{
"@jupyterlite/webrtc-docprovider:plugin": {
"disabled": false,
"room": "an pre-shared room name",
"roomPrefix": "a-very-unique-name",
"signalingUrls": [
"wss://y-webrtc-signaling-eu.herokuapp.com",
"wss://y-webrtc-signaling-us.herokuapp.com",
"wss://signaling.yjs.dev"
],
"usercolor": "f57c00",
"username": "Jo V. Un"
}
}
In JupyterLite, this can be configured with an
overrides.json
roomPrefix
By default, the final room ID that is actually sent to the signaling server will be the SHA256 hash of the configured room prefix and the chosen room name.
By default this prefix is the domain serving the site, but for common URLs (like
localhost
) a more random prefix should be chosen.
signalingUrls
By default, a number of public signaling servers are provided, as described by y-webrtc, as shown above.
Note: the signaling server, as the name suggests, should only know high-level metadata about your exchange, and should be protected from third-parties by standard SSL encryption.
However, a real deployment should not rely on free hosted services at runtime. Some research would be required to find an appropriate server for your specific deployment.
username
The name displayed to others next to your cursor in shared editing sessions.
usercolor
A suggested color of your cursor, as displayed to others next in shared editing sessions.
Uninstall
To remove the extension, run:
pip uninstall jupyterlab_webrtc_docprovider
Open Source
This work is licensed under the BSD 3-Clause License.
The code was originally extracted from JupyterLite and JupyterLab, which are also covered under the BSD 3-Clause License.
Two vendored patches (special thanks to @datakurre) are applied to simple-peer and int64-buffer, both of which are licensed under the MIT license, and should hopefully be merged some day.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for jupyterlab-webrtc-docprovider-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95c542bfd06eafa679a7196a339dfe27d20847dddef03ec23a0b1c12c73b3460 |
|
MD5 | b5b5c661bf61b6b13e8673dc41d3e677 |
|
BLAKE2b-256 | 017b71bad5f9d11fc9041d361308664a19757e1880f534bf1070439784b33b27 |
Hashes for jupyterlab_webrtc_docprovider-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86db28657b96f2b82550de7e72ca7827605081e8d40f87f66303a9e06de3a7e2 |
|
MD5 | ed4d93f3aecf0e0ae41ef7b932eda0d6 |
|
BLAKE2b-256 | 6783814473f7fe1a9db7b34e6b69ec25d8de9d6f127b845962836437bcc1790d |