-
Notifications
You must be signed in to change notification settings - Fork 12
Add documentation #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| *.log | ||
| site/ | ||
| VENV/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| all: html | ||
|
|
||
| html: | ||
| mkdocs build -v |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # About SaltyRTC | ||
|
|
||
| For more information about the project, please visit | ||
| [saltyrtc.org](http://saltyrtc.org). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| /* Workaround for duplicate headings: https://github.com/mkdocs/mkdocs/issues/318 */ | ||
| li.toctree-l3:first-child { | ||
| display: none; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # SaltyRTC Server | ||
|
|
||
| This is a SaltyRTC server implementation written in Python 3 with asyncio. | ||
|
|
||
| **Contents** | ||
|
|
||
| * [Installing](installing.md) | ||
| * [Usage](usage.md) | ||
| * [About](about.md) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Installing | ||
|
|
||
| **Note:** On machines where Python 3 is not the default Python runtime, you | ||
| should use `pip3` instead of `pip`. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| You need the following packages installed to be able to run the SaltyRTC | ||
| server: | ||
|
|
||
| - python3 | ||
| - python3-pip | ||
| - libsodium-dev | ||
|
|
||
| ## Option A: Installing System-Wide | ||
|
|
||
| Now install `saltyrtc.server` from [PyPI](https://pypi.python.org/): | ||
|
|
||
| $ sudo pip install saltyrtc.server | ||
|
|
||
| ## Option B: Installing in a Venv | ||
|
|
||
| If you don't want to install saltyrtc-server-python system-wide, we | ||
| recommend using [venv](https://docs.python.org/3/library/venv.html) to create | ||
| an isolated Python environment. | ||
|
|
||
| $ python3 -m venv venv | ||
|
|
||
| You can switch into the created virtual environment venv by running this command: | ||
|
|
||
| $ source venv/bin/activate | ||
|
|
||
| While the virtual environment is active, all packages installed using `pip` | ||
| will be installed into this environment. | ||
|
|
||
| $ pip install saltyrtc.server | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # Test Certificates | ||
|
|
||
| To be able to start the SaltyRTC server, you need to specify a TLS key and | ||
| certificate. In production you will want to use a certificate signed by a | ||
| trusted CA, but for testing purposes, the easiest way is to create a | ||
| self-signed certificate. | ||
|
|
||
| ## Generating a Test Certificate | ||
|
|
||
| Use the following command to create such a certificate, valid for `localhost` | ||
| during the next 5 years: | ||
|
|
||
| $ openssl req \ | ||
| -newkey rsa:1024 \ | ||
|
||
| -x509 \ | ||
| -nodes \ | ||
| -keyout saltyrtc.key \ | ||
| -new \ | ||
| -out saltyrtc.crt \ | ||
| -subj /CN=localhost \ | ||
| -reqexts SAN \ | ||
| -extensions SAN \ | ||
| -config <(cat /etc/ssl/openssl.cnf \ | ||
| <(printf '[SAN]\nsubjectAltName=DNS:localhost')) \ | ||
| -sha256 \ | ||
| -days 1825 | ||
|
||
|
|
||
| ## Importing | ||
|
|
||
| ### Chrome / Chromium | ||
|
|
||
| The best way to import this certificate into Chrome is via the command line: | ||
|
|
||
| $ certutil -d sql:$HOME/.pki/nssdb \ | ||
| -A -t "P,," -n saltyrtc-test-ca \ | ||
| -i saltyrtc.crt | ||
|
|
||
| Then make sure to restart your browser (or simply visit `chrome://restart`). | ||
|
|
||
| ### Firefox | ||
|
|
||
| In Firefox the easiest way to add your certificate to the browser is to start | ||
| the SaltyRTC server (e.g. on `localhost` port 8765), then to visit the | ||
| corresponding URL via https (e.g. `https://localhost:8765`). Then, in the | ||
| certificate warning dialog that pops up, choose "Advanced" and add a permanent | ||
| exception. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Usage | ||
|
|
||
| The script `saltyrtc-server` will be automatically installed and provides a | ||
| command line interface for the server. Run the following command to see usage | ||
| information: | ||
|
|
||
| $ saltyrtc-server --help |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| site_name: SaltyRTC Server | ||
| site_description: Documentation for saltyrtc-server-python. | ||
| site_author: Lennart Grahl | ||
|
||
| copyright: © 2016-2017 Lennart Grahl | ||
| theme: readthedocs | ||
| repo_url: https://github.com/saltyrtc/saltyrtc-server-python | ||
| edit_uri: edit/master/docs/docs/ | ||
| markdown_extensions: | ||
| - smarty | ||
| - toc: | ||
| permalink: False | ||
| pages: | ||
| - Home: index.md | ||
| - Guide: | ||
| - Installing: installing.md | ||
| - Usage: usage.md | ||
| - Test Certificates: testcerts.md | ||
| - About: about.md | ||
| theme_dir: theme_overrides | ||
| extra_css: | ||
| - custom.css | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| mkdocs==0.16.3 | ||
| Pygments==2.1.3 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| {% extends "base.html" %} | ||
|
|
||
| {% block site_name %} | ||
| <img src="https://saltyrtc.org/static/img/shaker.svg" alt="Logo"> | ||
| <a href="{{ nav.homepage.url }}" class="icon icon-home"> {{ config.site_name }}</a> | ||
| {% endblock %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you're at it, can you patch this in the readme, too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^