2020-09-23 06:14:57 -04:00
Advanced Usage
2020-08-23 22:52:43 -04:00
==============
2020-08-25 20:11:05 -04:00
.. _save_tabs:
2020-09-23 06:14:57 -04:00
Save Tabs
2020-08-23 22:52:43 -04:00
---------
2022-03-06 18:01:42 -05:00
Everything in OnionShare is temporary by default. When OnionShare tabs are closed, addresses no longer exist and can't be used again.
2022-01-21 18:26:37 -05:00
Your OnionShare service can also be persistent.
2022-03-06 18:01:42 -05:00
If you host a website, persistence means it will be available on the same OnionShare address even if you reboot your computer.
2020-08-26 16:34:03 -04:00
2022-01-21 18:26:37 -05:00
To make any tab persistent, check the "Save this tab, and automatically open it when I open OnionShare" box before starting your server.
A purple pin icon appears to the left of its server status to tell you the tab is saved.
2020-08-26 16:34:03 -04:00
.. image :: _static/screenshots/advanced-save-tabs.png
2022-01-21 18:26:37 -05:00
When opening OnionShare, your saved tabs from the prior session will start opened.
Each service then can be started manually, and will be available on the same OnionShare address and be protected by the same private key.
2020-08-26 16:34:03 -04:00
2022-02-24 17:08:15 -05:00
If you save a tab, a copy of its onion service secret key is stored on your computer.
2020-08-26 16:34:03 -04:00
2021-08-27 20:34:51 -04:00
.. _turn_off_private_key:
2020-08-25 20:11:05 -04:00
2021-08-27 20:34:51 -04:00
Turn Off Private Key
--------------------
2020-08-23 22:52:43 -04:00
2021-09-09 22:04:04 -04:00
By default, all OnionShare services are protected with a private key, which Tor calls "client authentication".
2021-08-27 20:34:51 -04:00
2022-03-06 18:01:42 -05:00
The Tor Browser will ask you to enter your private key when you load an OnionShare service.
If you want allow the public to use your service, it's better to disable the private key altogether.
2020-08-26 16:34:03 -04:00
2022-02-13 07:28:16 -05:00
To turn off the private key for any tab, check the "This is a public OnionShare service (disables private key)" box before starting the server.
2022-03-06 18:01:42 -05:00
Then the server will be public and a private key is not needed to load it in the Tor Browser.
2020-08-26 16:34:03 -04:00
2021-05-04 00:49:25 -04:00
.. _custom_titles:
Custom Titles
-------------
2022-03-06 18:01:42 -05:00
When people load OnionShare services in the Tor Browser they see the default title for each type of service.
For example, the default title for chat services is "OnionShare Chat".
2021-05-04 00:49:25 -04:00
2022-01-21 18:26:37 -05:00
If you edit the "Custom title" setting before starting a server you can change it.
2021-05-04 00:49:25 -04:00
2020-09-23 06:14:57 -04:00
Scheduled Times
2020-08-23 22:52:43 -04:00
---------------
2020-09-23 06:14:57 -04:00
OnionShare supports scheduling exactly when a service should start and stop.
2022-01-21 18:26:37 -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-08-26 16:34:03 -04:00
2022-01-21 18:26:37 -05:00
Services scheduled to start in the future display a countdown timer when when the "Start sharing" button is clicked.
Services scheduled to stop in the future display a countdown timer when started.
2020-08-26 16:34:03 -04:00
2022-01-21 18:26:37 -05:00
**Scheduling an OnionShare service to automatically start can be used as a dead man's switch** .
This means your service is made public at a given time in the future if you are not there to prevent it.
2020-09-23 06:14:57 -04:00
If nothing happens to you, you can cancel the service before it's scheduled to start.
2020-08-26 16:34:03 -04:00
.. image :: _static/screenshots/advanced-schedule-start-timer.png
2022-01-21 18:26:37 -05:00
**Scheduling an OnionShare service to automatically stop limits its exposure** .
If you want to share secret info or something that will be outdated, you can do so for selected limited time.
2020-08-26 16:34:03 -04:00
.. image :: _static/screenshots/advanced-schedule-stop-timer.png
2021-09-09 21:21:56 -04:00
.. _cli:
2020-09-23 06:14:57 -04:00
Command-line Interface
2020-08-27 20:30:42 -04:00
----------------------
2020-09-23 06:14:57 -04:00
In addition to its graphical interface, OnionShare has a command-line interface.
2020-08-27 20:30:42 -04:00
2020-11-10 23:41:50 -05:00
You can install just the command-line version of OnionShare using `` pip3 `` ::
2020-08-27 20:30:42 -04:00
2020-11-10 23:41:50 -05:00
pip3 install --user onionshare-cli
2020-08-27 20:30:42 -04:00
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-08-27 20:30:42 -04:00
2020-11-10 23:41:50 -05:00
Then run it like this::
2020-08-27 20:30:42 -04:00
2020-11-10 23:41:50 -05:00
onionshare-cli --help
2020-08-27 20:30:42 -04:00
2022-01-21 18:26:37 -05:00
Info about installing it on different operating systems can be found in the `CLI README file <https://github.com/onionshare/onionshare/blob/develop/cli/README.md> `_ in the Git repository.
2021-09-09 21:21:56 -04:00
2022-01-21 18:26:37 -05:00
If you installed OnionShare using the Snap package, you can also just run `` onionshare.cli `` to access the command-line interface version.
2020-08-27 20:30:42 -04:00
Usage
^^^^^
2022-01-21 18:26:37 -05:00
Browse the command-line documentation by running `` onionshare --help `` ::
2020-08-27 20:30:42 -04:00
2020-11-10 23:41:50 -05:00
$ onionshare-cli --help
2021-05-04 00:49:25 -04:00
╭───────────────────────────────────────────╮
│ * ▄▄█████▄▄ * │
│ ▄████▀▀▀████▄ * │
│ ▀▀█▀ ▀██▄ │
│ * ▄█▄ ▀██▄ │
│ ▄█████▄ ███ -+- │
│ ███ ▀█████▀ │
│ ▀██▄ ▀█▀ │
│ * ▀██▄ ▄█▄▄ * │
│ * ▀████▄▄▄████▀ │
│ ▀▀█████▀▀ │
│ -+- * │
│ ▄▀▄ ▄▀▀ █ │
│ █ █ ▀ ▀▄ █ │
│ █ █ █▀▄ █ ▄▀▄ █▀▄ ▀▄ █▀▄ ▄▀▄ █▄▀ ▄█▄ │
│ ▀▄▀ █ █ █ ▀▄▀ █ █ ▄▄▀ █ █ ▀▄█ █ ▀▄▄ │
│ │
2021-11-23 22:33:21 -05:00
│ v2.4.1 │
2021-05-04 00:49:25 -04:00
│ │
│ https://onionshare.org/ │
╰───────────────────────────────────────────╯
2021-09-09 22:04:04 -04:00
usage: onionshare-cli [-h] [--receive] [--website] [--chat] [--local-only] [--connect-timeout SECONDS] [--config FILENAME] [--persistent FILENAME] [--title TITLE] [--public]
2021-11-23 22:33:21 -05:00
[--auto-start-timer SECONDS] [--auto-stop-timer SECONDS] [--no-autostop-sharing] [--data-dir data_dir] [--webhook-url webhook_url] [--disable-text]
[--disable-files] [--disable_csp] [--custom_csp custom_csp] [-v]
2021-09-09 22:04:04 -04:00
[filename ...]
2020-08-27 20:30:42 -04:00
positional arguments:
2020-11-10 23:41:50 -05:00
filename List of files or folders to share
2021-09-09 22:04:04 -04:00
2020-08-27 20:30:42 -04:00
optional arguments:
2022-01-21 18:26:37 -05:00
-h, --help Show this help message and exit
2020-11-10 23:41:50 -05:00
--receive Receive files
--website Publish website
--chat Start chat server
--local-only Don't use Tor (only for development)
--connect-timeout SECONDS
2021-09-09 22:04:04 -04:00
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
2021-08-27 20:34:51 -04:00
--public Don't use a private key
2020-11-10 23:41:50 -05:00
--auto-start-timer SECONDS
2021-09-09 22:04:04 -04:00
Start onion service at scheduled time (N seconds from now)
2020-11-10 23:41:50 -05:00
--auto-stop-timer SECONDS
2022-01-21 18:26:37 -05:00
Stop onion service at scheduled time (N seconds from now)
--no-autostop-sharing Share files: Continue sharing after files have been sent (the default is to stop sharing)
2021-09-09 22:04:04 -04: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
2021-09-09 22:04:04 -04:00
Receive files: URL to receive webhook notifications
2021-05-04 00:49:25 -04:00
--disable-text Receive files: Disable receiving text messages
--disable-files Receive files: Disable receiving files
2021-11-23 22:33:21 -05:00
--disable_csp Publish website: Disable the default Content Security Policy header (allows your website to use third-party resources)
--custom_csp custom_csp Publish website: Set a custom Content Security Policy header
2021-09-09 22:04:04 -04:00
-v, --verbose Log OnionShare errors to stdout, and web errors to disk