onionshare/docs/source/advanced.rst

166 lines
9.1 KiB
ReStructuredText
Raw Normal View History

2020-09-23 06:14:57 -04:00
Advanced Usage
==============
.. _save_tabs:
2020-09-23 06:14:57 -04:00
Save Tabs
---------
2020-11-10 23:41:50 -05:00
Everything in OnionShare is temporary by default. If you close an OnionShare tab, its address no longer exists and it can't be used again.
2020-09-23 06:14:57 -04:00
Sometimes you might want an OnionShare service to be persistent.
2020-11-10 23:41:50 -05:00
This is useful if you want to host a website available from the same OnionShare address even if you reboot your computer.
2020-09-23 06:14:57 -04:00
To make any tab persistent, check the "Save this tab, and automatically open it when I open OnionShare" box before starting the server.
When a tab is saved a purple pin icon appears to the left of its server status.
.. image:: _static/screenshots/advanced-save-tabs.png
2020-09-23 06:14:57 -04:00
When you quit OnionShare and then open it again, your saved tabs will start opened.
You'll have to manually start each service, but when you do they will start with the same OnionShare address and password.
If you save a tab, a copy of that tab's onion service secret key will be stored on your computer with your OnionShare settings.
2020-11-10 23:41:50 -05:00
.. _turn_off_passwords:
2020-11-10 23:41:50 -05:00
Turn Off Passwords
------------------
2020-11-10 23:41:50 -05:00
By default, all OnionShare services are protected with the username ``onionshare`` and a randomly-generated password.
2020-09-23 06:14:57 -04:00
If someone takes 20 wrong guesses at the password, your onion service is automatically stopped to prevent a brute force attack against the OnionShare service.
2020-11-10 23:41:50 -05:00
Sometimes you might want your OnionShare service to be accessible to the public, like if you want to set up an OnionShare receive service so the public can securely and anonymously send you files.
In this case, it's better to disable the password altogether.
2020-09-23 06:14:57 -04:00
If you don't do this, someone can force your server to stop just by making 20 wrong guesses of your password, even if they know the correct password.
2020-11-10 23:41:50 -05:00
To turn off the password for any tab, just check the "Don't use a password" box before starting the server. Then the server will be public and won't have a password.
2021-05-04 00:49:25 -04:00
.. _custom_titles:
Custom Titles
-------------
By default, when people load an OnionShare service in Tor Browser they see the default title for the type of service. For example, the default title of a chat service is "OnionShare Chat".
If you want to choose a custom title, set the "Custom title" setting before starting a server.
2020-09-23 06:14:57 -04:00
Scheduled Times
---------------
2020-09-23 06:14:57 -04:00
OnionShare supports scheduling exactly when a service should start and stop.
2020-11-10 23:41:50 -05:00
Before starting a server, click "Show advanced settings" in its tab and then check the boxes next to either "Start onion service at scheduled time", "Stop onion service at scheduled time", or both, and set the respective desired dates and times.
2020-09-23 06:14:57 -04:00
If you scheduled a service to start in the future, when you click the "Start sharing" button you will see a timer counting down until it starts.
If you scheduled it to stop in the future, after it's started you will see a timer counting down to when it will stop automatically.
2020-09-23 06:14:57 -04:00
**Scheduling an OnionShare service to automatically start can be used as a dead man's switch**, where your service will be made public at a given time in the future if anything happens to you.
If nothing happens to you, you can cancel the service before it's scheduled to start.
.. image:: _static/screenshots/advanced-schedule-start-timer.png
2020-09-23 06:14:57 -04:00
**Scheduling an OnionShare service to automatically stop can be useful to limit exposure**, like if you want to share secret documents while making sure they're not available on the Internet for more than a few days.
.. image:: _static/screenshots/advanced-schedule-stop-timer.png
2020-09-23 06:14:57 -04:00
Command-line Interface
----------------------
2020-09-23 06:14:57 -04:00
In addition to its graphical interface, OnionShare has a command-line interface.
2020-11-10 23:41:50 -05:00
You can install just the command-line version of OnionShare using ``pip3``::
2020-11-10 23:41:50 -05:00
pip3 install --user onionshare-cli
2020-11-10 23:41:50 -05:00
Note that you will also need the ``tor`` package installed. In macOS, install it with: ``brew install tor``
2020-11-10 23:41:50 -05:00
Then run it like this::
2020-11-10 23:41:50 -05:00
onionshare-cli --help
2020-11-10 23:41:50 -05:00
If you installed OnionShare using the Linux Snapcraft package, you can also just run ``onionshare.cli`` to access the command-line interface version.
Usage
^^^^^
2020-09-23 06:14:57 -04:00
You can browse the command-line documentation by running ``onionshare --help``::
2020-11-10 23:41:50 -05:00
$ onionshare-cli --help
2021-05-04 00:49:25 -04:00
╭───────────────────────────────────────────╮
* ▄▄█████▄▄ *
│ ▄████▀▀▀████▄ * │
│ ▀▀█▀ ▀██▄ │
│ * ▄█▄ ▀██▄ │
│ ▄█████▄ ███ -+- │
│ ███ ▀█████▀ │
│ ▀██▄ ▀█▀ │
* ▀██▄ ▄█▄▄ *
│ * ▀████▄▄▄████▀ │
│ ▀▀█████▀▀ │
│ -+- * │
│ ▄▀▄ ▄▀▀ █ │
│ █ █ ▀ ▀▄ █ │
│ █ █ █▀▄ █ ▄▀▄ █▀▄ ▀▄ █▀▄ ▄▀▄ █▄▀ ▄█▄ │
│ ▀▄▀ █ █ █ ▀▄▀ █ █ ▄▄▀ █ █ ▀▄█ █ ▀▄▄ │
│ │
│ v2.3.2 │
│ │
│ https://onionshare.org/ │
╰───────────────────────────────────────────╯
usage: onionshare-cli [-h] [--receive] [--website] [--chat] [--local-only] [--connect-timeout SECONDS] [--config FILENAME]
[--persistent FILENAME] [--title TITLE] [--public] [--auto-start-timer SECONDS]
[--auto-stop-timer SECONDS] [--legacy] [--client-auth] [--no-autostop-sharing] [--data-dir data_dir]
[--webhook-url webhook_url] [--disable-text] [--disable-files] [--disable_csp] [-v]
[filename ...]
positional arguments:
2020-11-10 23:41:50 -05:00
filename List of files or folders to share
2021-05-04 00:49:25 -04:00
optional arguments:
2020-11-10 23:41:50 -05:00
-h, --help show this help message and exit
--receive Receive files
--website Publish website
--chat Start chat server
--local-only Don't use Tor (only for development)
--connect-timeout SECONDS
Give up connecting to Tor after a given amount of seconds (default: 120)
2020-11-10 23:41:50 -05:00
--config FILENAME Filename of custom global settings
--persistent FILENAME Filename of persistent session
2021-05-04 00:49:25 -04:00
--title TITLE Set a title
2020-11-10 23:41:50 -05:00
--public Don't use a password
--auto-start-timer SECONDS
Start onion service at scheduled time (N seconds from now)
2020-11-10 23:41:50 -05:00
--auto-stop-timer SECONDS
Stop onion service at schedule time (N seconds from now)
2020-11-10 23:41:50 -05:00
--legacy Use legacy address (v2 onion service, not recommended)
--client-auth Use client authorization (requires --legacy)
2021-05-04 00:49:25 -04:00
--no-autostop-sharing Share files: Continue sharing after files have been sent (default is to stop sharing)
2020-11-10 23:41:50 -05:00
--data-dir data_dir Receive files: Save files received to this directory
2021-05-04 00:49:25 -04:00
--webhook-url webhook_url
Receive files: URL to receive webhook notifications
--disable-text Receive files: Disable receiving text messages
--disable-files Receive files: Disable receiving files
--disable_csp Publish website: Disable Content Security Policy header (allows your website to use third-party
resources)
2020-11-10 23:41:50 -05:00
-v, --verbose Log OnionShare errors to stdout, and web errors to disk
2020-09-23 06:14:57 -04:00
Legacy Addresses
----------------
2020-09-23 06:14:57 -04:00
OnionShare uses v3 Tor onion services by default.
These are modern onion addresses that have 56 characters, for example::
uf3wmtpbstcupvrrsetrtct7qcmnqvdcsxqzxthxbx2y7tidatxye7id.onion
2020-09-23 06:14:57 -04:00
OnionShare still has support for v2 onion addresses, the old type of onion addresses that have 16 characters, for example::
lc7j6u55vhrh45eq.onion
2020-09-23 06:14:57 -04:00
OnionShare calls v2 onion addresses "legacy addresses", and they are not recommended, as v3 onion addresses are more secure.
2020-09-23 06:14:57 -04:00
To use legacy addresses, before starting a server click "Show advanced settings" from its tab and check the "Use a legacy address (v2 onion service, not recommended)" box.
In legacy mode you can optionally turn on Tor client authentication.
Once you start a server in legacy mode you cannot remove legacy mode in that tab.
Instead you must start a separate service in a separate tab.
2020-11-10 23:41:50 -05:00
Tor Project plans to `completely deprecate v2 onion services <https://blog.torproject.org/v2-deprecation-timeline>`_ on October 15, 2021, and legacy onion services will be removed from OnionShare before then.