aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2022-03-06 13:55:36 -0800
committerMicah Lee <micah@micahflee.com>2022-03-06 13:55:36 -0800
commit782a9e1909ffc3ca4c17a53e26fa6cb806fd5948 (patch)
tree933d5435df273d87a2c5d6dcb1c4abc8ddd7ee60
parentbe506a65c30c849164aa6b24afd1c5d479d25272 (diff)
parent76b03b3fc3b9a09a375ee83f31b322f87c4a8cff (diff)
downloadonionshare-782a9e1909ffc3ca4c17a53e26fa6cb806fd5948.tar.gz
onionshare-782a9e1909ffc3ca4c17a53e26fa6cb806fd5948.zip
Merge branch 'develop' into censorship
-rwxr-xr-xbuild-source.sh4
-rw-r--r--cli/onionshare_cli/web/send_base_mode.py18
-rw-r--r--cli/onionshare_cli/web/web.py6
-rw-r--r--cli/tests/test_cli_web.py5
-rw-r--r--desktop/onionshare/resources/locale/en.json38
-rw-r--r--docs/source/advanced.rst16
-rw-r--r--docs/source/install.rst13
-rw-r--r--docs/source/security.rst41
8 files changed, 77 insertions, 64 deletions
diff --git a/build-source.sh b/build-source.sh
index 0946683d..7ca9e462 100755
--- a/build-source.sh
+++ b/build-source.sh
@@ -36,7 +36,7 @@ fi
mkdir -p build/source
mkdir -p dist
cd build/source
-git clone https://github.com/onionshare/onionshare.git
+git clone --single-branch --branch $TAG --depth 1 https://github.com/onionshare/onionshare.git
cd onionshare
# Verify tag
@@ -65,7 +65,7 @@ git checkout $TAG
# Delete .git, compress, and PGP sign
cd ..
rm -rf onionshare/.git
-tar -cf onionshare-$VERSION.tar.gz onionshare/
+tar -czf onionshare-$VERSION.tar.gz onionshare/
# Move source package to dist
cd ../..
diff --git a/cli/onionshare_cli/web/send_base_mode.py b/cli/onionshare_cli/web/send_base_mode.py
index e608298b..d690c98d 100644
--- a/cli/onionshare_cli/web/send_base_mode.py
+++ b/cli/onionshare_cli/web/send_base_mode.py
@@ -44,8 +44,9 @@ class SendBaseModeWeb:
self.download_filesize = None
self.zip_writer = None
- # Store the tempfile objects here, so when they're garbage collected the files are deleted
- self.gzip_files = []
+ # Create a temporary dir to store gzip files in
+ self.gzip_tmp_dir = tempfile.TemporaryDirectory(dir=self.common.build_tmp_dir())
+ self.gzip_counter = 0
# If autostop_sharing, only allow one download at a time
self.download_in_progress = False
@@ -193,15 +194,12 @@ class SendBaseModeWeb:
# gzip compress the individual file, if it hasn't already been compressed
if use_gzip:
if filesystem_path not in self.gzip_individual_files:
- self.gzip_files.append(
- tempfile.NamedTemporaryFile("wb+", dir=self.common.build_tmp_dir())
+ gzip_filename = os.path.join(
+ self.gzip_tmp_dir.name, str(self.gzip_counter)
)
- gzip_file = self.gzip_files[-1]
- self._gzip_compress(filesystem_path, gzip_file.name, 6, None)
- self.gzip_individual_files[filesystem_path] = gzip_file.name
-
- # Cleanup this temp file
- self.web.cleanup_tempfiles.append(gzip_file)
+ self.gzip_counter += 1
+ self._gzip_compress(filesystem_path, gzip_filename, 6, None)
+ self.gzip_individual_files[filesystem_path] = gzip_filename
file_to_download = self.gzip_individual_files[filesystem_path]
filesize = os.path.getsize(self.gzip_individual_files[filesystem_path])
diff --git a/cli/onionshare_cli/web/web.py b/cli/onionshare_cli/web/web.py
index 64844b5c..fdbed567 100644
--- a/cli/onionshare_cli/web/web.py
+++ b/cli/onionshare_cli/web/web.py
@@ -171,7 +171,6 @@ class Web:
self.socketio.init_app(self.app)
self.chat_mode = ChatModeWeb(self.common, self)
- self.cleanup_tempfiles = []
self.cleanup_tempdirs = []
def get_mode(self):
@@ -405,13 +404,8 @@ class Web:
"""
self.common.log("Web", "cleanup")
- # Close all of the tempfile.NamedTemporaryFile
- for file in self.cleanup_tempfiles:
- file.close()
-
# Clean up the tempfile.NamedTemporaryDirectory objects
for dir in self.cleanup_tempdirs:
dir.cleanup()
- self.cleanup_tempfiles = []
self.cleanup_tempdirs = []
diff --git a/cli/tests/test_cli_web.py b/cli/tests/test_cli_web.py
index f6076ef9..335c3a1a 100644
--- a/cli/tests/test_cli_web.py
+++ b/cli/tests/test_cli_web.py
@@ -50,7 +50,6 @@ def web_obj(temp_dir, common_obj, mode, num_files=0):
web = Web(common_obj, False, mode_settings, mode)
web.running = True
- web.cleanup_tempfiles == []
web.cleanup_tempdirs == []
web.app.testing = True
@@ -308,17 +307,13 @@ class TestWeb:
def test_cleanup(self, common_obj, temp_dir_1024):
web = web_obj(temp_dir_1024, common_obj, "share", 3)
- temp_file = tempfile.NamedTemporaryFile()
temp_dir = tempfile.TemporaryDirectory()
- web.cleanup_tempfiles = [temp_file]
web.cleanup_tempdirs = [temp_dir]
web.cleanup()
- assert os.path.exists(temp_file.name) is False
assert os.path.exists(temp_dir.name) is False
- assert web.cleanup_tempfiles == []
assert web.cleanup_tempdirs == []
diff --git a/desktop/onionshare/resources/locale/en.json b/desktop/onionshare/resources/locale/en.json
index 9627b4d9..e90547f7 100644
--- a/desktop/onionshare/resources/locale/en.json
+++ b/desktop/onionshare/resources/locale/en.json
@@ -10,7 +10,7 @@
"gui_add_files": "Add Files",
"gui_add_folder": "Add Folder",
"gui_remove": "Remove",
- "gui_dragdrop_sandbox_flatpak": "To make the Flatpak sandbox more secure, drag and drop is not supported. Use the Add Files and Add Folder buttons to browse for files instead.",
+ "gui_dragdrop_sandbox_flatpak": "To make the Flatpak sandbox more secure, drag and drop is not supported. Use the \"Add Files\" and \"Add Folder\" buttons to select files instead.",
"gui_file_selection_remove_all": "Remove All",
"gui_choose_items": "Choose",
"gui_share_start_server": "Start sharing",
@@ -27,9 +27,9 @@
"gui_copy_url": "Copy Address",
"gui_copy_client_auth": "Copy Private Key",
"gui_canceled": "Canceled",
- "gui_copied_url_title": "Copied OnionShare Address",
+ "gui_copied_url_title": "OnionShare Address Copied",
"gui_copied_url": "OnionShare address copied to clipboard",
- "gui_copied_client_auth_title": "Copied Private Key",
+ "gui_copied_client_auth_title": "Private Key Copied",
"gui_copied_client_auth": "Private Key copied to clipboard",
"gui_show_qr_code": "Show QR Code",
"gui_qr_code_dialog_title": "OnionShare QR Code",
@@ -80,7 +80,7 @@
"gui_settings_authenticate_password_option": "Password",
"gui_settings_password_label": "Password",
"gui_settings_tor_bridges": "Connect using a Tor bridge?",
- "gui_settings_tor_bridges_label": "Bridges help you access the Tor Network in places where Tor is blocked. Depending on where you are, one bridge may work better than another.",
+ "gui_settings_tor_bridges_label": "Bridges helps your traffic enter the Tor Network where Tor access is blocked. Depending on where you are, one bridge may work better than another.",
"gui_settings_bridge_use_checkbox": "Use a bridge",
"gui_settings_bridge_radio_builtin": "Select a built-in bridge",
"gui_settings_bridge_none_radio_option": "Don't use a bridge",
@@ -149,14 +149,14 @@
"history_requests_tooltip": "{} web requests",
"error_cannot_create_data_dir": "Could not create OnionShare data folder: {}",
"gui_receive_mode_warning": "Receive mode lets people upload files to your computer.<br><br><b>Some files can potentially take control of your computer if you open them. Only open things from people you trust, or if you know what you are doing.</b>",
- "gui_open_folder_error": "Failed to open folder with xdg-open. The file is here: {}",
+ "gui_open_folder_error": "Could not open the folder with xdg-open. The file is here: {}",
"gui_settings_language_label": "Language",
"gui_settings_theme_label": "Theme",
"gui_settings_theme_auto": "Auto",
"gui_settings_theme_light": "Light",
"gui_settings_theme_dark": "Dark",
- "gui_settings_language_changed_notice": "Restart OnionShare for the new language to be applied.",
- "gui_color_mode_changed_notice": "Restart OnionShare for the new color mode to be applied.",
+ "gui_settings_language_changed_notice": "Restart OnionShare to change to the new language.",
+ "gui_color_mode_changed_notice": "Restart OnionShare to see the new colors.",
"systray_menu_exit": "Quit",
"systray_page_loaded_title": "Page Loaded",
"systray_page_loaded_message": "OnionShare address loaded",
@@ -175,10 +175,10 @@
"gui_all_modes_progress_starting": "{0:s}, %p% (calculating)",
"gui_all_modes_progress_eta": "{0:s}, ETA: {1:s}, %p%",
"gui_share_mode_no_files": "No Files Sent Yet",
- "gui_share_mode_autostop_timer_waiting": "Waiting to finish sending",
+ "gui_share_mode_autostop_timer_waiting": "Finishing sending…",
"gui_website_mode_no_files": "No Website Shared Yet",
"gui_receive_mode_no_files": "No Files Received Yet",
- "gui_receive_mode_autostop_timer_waiting": "Waiting to finish receiving",
+ "gui_receive_mode_autostop_timer_waiting": "Finishing receiving…",
"days_first_letter": "d",
"hours_first_letter": "h",
"minutes_first_letter": "m",
@@ -198,14 +198,14 @@
"gui_tab_name_website": "Website",
"gui_tab_name_chat": "Chat",
"gui_close_tab_warning_title": "Are you sure?",
- "gui_close_tab_warning_persistent_description": "This tab is persistent. If you close it you'll lose the onion address that it's using. Are you sure you want to close it?",
- "gui_close_tab_warning_share_description": "You're in the process of sending files. Are you sure you want to close this tab?",
- "gui_close_tab_warning_receive_description": "You're in the process of receiving files. Are you sure you want to close this tab?",
- "gui_close_tab_warning_website_description": "You're actively hosting a website. Are you sure you want to close this tab?",
+ "gui_close_tab_warning_persistent_description": "Close persistent tab and lose the onion address it is using?",
+ "gui_close_tab_warning_share_description": "Close tab that is sending files?",
+ "gui_close_tab_warning_receive_description": "Close tab that is receiving files?",
+ "gui_close_tab_warning_website_description": "Close tab that is hosting a website?",
"gui_close_tab_warning_close": "Close",
"gui_close_tab_warning_cancel": "Cancel",
"gui_quit_warning_title": "Are you sure?",
- "gui_quit_warning_description": "Sharing is active in some of your tabs. If you quit, all of your tabs will close. Are you sure you want to quit?",
+ "gui_quit_warning_description": "Quit and close all tabs, even though sharing is active in some of them?",
"gui_quit_warning_quit": "Quit",
"gui_quit_warning_cancel": "Cancel",
"mode_settings_advanced_toggle_show": "Show advanced settings",
@@ -237,18 +237,18 @@
"settings_error_bundled_tor_not_supported": "Using the Tor version that comes with OnionShare does not work in developer mode on Windows or macOS.",
"settings_error_bundled_tor_timeout": "Taking too long to connect to Tor. Maybe you aren't connected to the Internet, or have an inaccurate system clock?",
"settings_error_bundled_tor_broken": "OnionShare could not connect to Tor:\n{}",
- "gui_rendezvous_cleanup": "Waiting for Tor circuits to close to be sure your files have successfully transferred.\n\nThis might take a few minutes.",
+ "gui_rendezvous_cleanup": "Waiting for Tor circuits to close to be sure your files have transferred.\n\nThis might take a few minutes.",
"gui_rendezvous_cleanup_quit_early": "Quit Early",
"error_port_not_available": "OnionShare port not available",
"history_receive_read_message_button": "Read Message",
"error_tor_protocol_error": "There was an error with Tor: {}",
- "moat_contact_label": "Contacting BridgeDB...",
+ "moat_contact_label": "Contacting BridgeDB…",
"moat_captcha_label": "Solve the CAPTCHA to request a bridge.",
"moat_captcha_placeholder": "Enter the characters from the image",
"moat_captcha_submit": "Submit",
"moat_captcha_reload": "Reload",
- "moat_bridgedb_error": "Error contacting BridgeDB.",
- "moat_captcha_error": "The solution is not correct. Please try again.",
- "moat_solution_empty_error": "You must enter the characters from the image",
+ "moat_bridgedb_error": "Could not contact BridgeDB.",
+ "moat_captcha_error": "Incorrect solution. Please try again.",
+ "moat_solution_empty_error": "Enter the characters from the image",
"mode_tor_not_connected_label": "OnionShare is not connected to the Tor network"
} \ No newline at end of file
diff --git a/docs/source/advanced.rst b/docs/source/advanced.rst
index 870f8777..951294b2 100644
--- a/docs/source/advanced.rst
+++ b/docs/source/advanced.rst
@@ -27,21 +27,25 @@ Turn Off Private Key
By default, all OnionShare services are protected with a private key, which Tor calls "client authentication".
-When browsing to an OnionShare service in Tor Browser, Tor Browser will prompt for the private key to be entered.
+The Tor Browser will ask you to enter your private key when you surf to an OnionShare service.
-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.
+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 private key altogether.
-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. Then the server will be public and won't need a private key to view in Tor Browser.
+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.
+Then the server will be public and won't need a private key to view in Tor Browser.
.. _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".
+By default, when people load an OnionShare service in the Tor Browser they see the default title for the type of service.
+For example,
-If you want to choose a custom title, set the "Custom title" setting before starting a server.
+If the "Custom title" is not set before starting a server, people see a default title for the type of service used.
+The default title of a chat service is "OnionShare Chat".
Scheduled Times
---------------
@@ -78,7 +82,7 @@ Then run it like this::
onionshare-cli --help
-For information about installing it on different operating systems, see the `CLI readme file <https://github.com/onionshare/onionshare/blob/develop/cli/README.md>`_ in the git repository.
+More info about installing it on different operating systems is available in the `CLI README file <https://github.com/onionshare/onionshare/blob/develop/cli/README.md>`_ in the Git repository.
If you installed OnionShare using the Linux Snapcraft package, you can also just run ``onionshare.cli`` to access the command-line interface version.
diff --git a/docs/source/install.rst b/docs/source/install.rst
index c5dd8197..c3fe5d16 100644
--- a/docs/source/install.rst
+++ b/docs/source/install.rst
@@ -12,13 +12,13 @@ Linux
-----
There are various ways to install OnionShare for Linux, but the recommended way is to use either the `Flatpak <https://flatpak.org/>`_ or the `Snap <https://snapcraft.io/>`_ package.
-Flatpak and Snap ensure that you'll always use the newest version and run OnionShare inside of a sandbox.
+Flatpak and Snapcraft ensure that you'll always use the newest version and run OnionShare inside of a sandbox.
-Snap support is built-in to Ubuntu and Fedora comes with Flatpak support, but which you use is up to you. Both work in all Linux distributions.
+Snapcraft support is built-in to Ubuntu and Fedora comes with Flatpak support, but which you use is up to you. Both work in all Linux distributions.
**Install OnionShare using Flatpak**: https://flathub.org/apps/details/org.onionshare.OnionShare
-**Install OnionShare using Snap**: https://snapcraft.io/onionshare
+**Install OnionShare using Snapcraft**: https://snapcraft.io/onionshare
You can also download and install PGP-signed ``.flatpak`` or ``.snap`` packages from https://onionshare.org/dist/ if you prefer.
@@ -27,7 +27,7 @@ You can also download and install PGP-signed ``.flatpak`` or ``.snap`` packages
Command-line only
-----------------
-You can install just the command line version of OnionShare on any operating system using the Python package manager ``pip``. See :ref:`cli` for more information.
+You can install just the command-line version of OnionShare on any operating system using the Python package manager ``pip``. :ref:`cli` has more info.
.. _verifying_sigs:
@@ -40,7 +40,8 @@ For Windows and macOS, this step is optional and provides defense in depth: the
Signing key
^^^^^^^^^^^
-Packages are signed by Micah Lee, the core developer, using his PGP public key with fingerprint ``927F419D7EC82C2F149C1BD1403C2657CD994F73``. You can download Micah's key `from the keys.openpgp.org keyserver <https://keys.openpgp.org/vks/v1/by-fingerprint/927F419D7EC82C2F149C1BD1403C2657CD994F73>`_.
+Packages are signed by Micah Lee, the core developer, using his PGP public key with fingerprint ``927F419D7EC82C2F149C1BD1403C2657CD994F73``.
+You can download Micah's key `from the keys.openpgp.org keyserver <https://keys.openpgp.org/vks/v1/by-fingerprint/927F419D7EC82C2F149C1BD1403C2657CD994F73>`_.
You must have GnuPG installed to verify signatures. For macOS you probably want `GPGTools <https://gpgtools.org/>`_, and for Windows you probably want `Gpg4win <https://www.gpg4win.org/>`_.
@@ -73,6 +74,6 @@ The expected output looks like this::
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 927F 419D 7EC8 2C2F 149C 1BD1 403C 2657 CD99 4F73
-If you don't see ``Good signature from``, there might be a problem with the integrity of the file (malicious or otherwise), and you should not install the package. (The ``WARNING:`` shown above, is not a problem with the package, it only means you haven't defined a level of "trust" of Micah's PGP key.)
+If you don't see ``Good signature from``, there might be a problem with the integrity of the file (malicious or otherwise), and you should not install the package. (The ``WARNING:`` shown above, is not a problem with the package, it only means you haven't defined a level of "trust" of Micah's (the core developer) PGP key.)
If you want to learn more about verifying PGP signatures, the guides for `Qubes OS <https://www.qubes-os.org/security/verifying-signatures/>`_ and the `Tor Project <https://support.torproject.org/tbb/how-to-verify-signature/>`_ may be useful.
diff --git a/docs/source/security.rst b/docs/source/security.rst
index 0727b957..25f4d5cb 100644
--- a/docs/source/security.rst
+++ b/docs/source/security.rst
@@ -8,17 +8,38 @@ Like all software, OnionShare may contain bugs or vulnerabilities.
What OnionShare protects against
--------------------------------
-**Third parties don't have access to anything that happens in OnionShare.** Using OnionShare means hosting services directly on your computer. When sharing files with OnionShare, they are not uploaded to any server. If you make an OnionShare chat room, your computer acts as a server for that too. This avoids the traditional model of having to trust the computers of others.
-
-**Network eavesdroppers can't spy on anything that happens in OnionShare in transit.** The connection between the Tor onion service and Tor Browser is end-to-end encrypted. This means network attackers can't eavesdrop on anything except encrypted Tor traffic. Even if an eavesdropper is a malicious rendezvous node used to connect the Tor Browser with OnionShare's onion service, the traffic is encrypted using the onion service's private key.
-
-**Anonymity of OnionShare users are protected by Tor.** OnionShare and Tor Browser protect the anonymity of the users. As long as the OnionShare user anonymously communicates the OnionShare address with the Tor Browser users, the Tor Browser users and eavesdroppers can't learn the identity of the OnionShare user.
-
-**If an attacker learns about the onion service, it still can't access anything.** Prior attacks against the Tor network to enumerate onion services allowed the attacker to discover private ``.onion`` addresses. If an attack discovers a private OnionShare address, they will also need to guess the private key used for client authentication in order to access it (unless the OnionShare user chooses make their service public by turning off the private key -- see :ref:`turn_off_private_key`).
+**Third parties don't have access to anything that happens in OnionShare.**
+Using OnionShare means hosting services directly on your computer.
+When sharing your files with OnionShare, they are not uploaded to any third-party server.
+If you make an OnionShare chat room, your computer acts as a server for that too.
+This avoids the traditional model of having to trust the computers of others.
+
+**Network eavesdroppers can't spy on anything that happens in OnionShare in transit.**
+The connection between the Tor onion service and Tor Browser is end-to-end encrypted.
+This means network attackers can't eavesdrop on anything except encrypted Tor traffic.
+Even if an eavesdropper is a malicious rendezvous node used to connect the Tor Browser with OnionShare's onion service,
+the traffic is encrypted using the onion service's private key.
+
+**Anonymity of OnionShare users are protected by Tor.**
+OnionShare and Tor Browser protect the anonymity of the users.
+As long as the OnionShare user anonymously communicates the OnionShare address with the Tor Browser users,
+the Tor Browser users and eavesdroppers can't learn the identity of the OnionShare user.
+
+**If an attacker learns about the onion service, it still can't access anything.**
+Prior attacks against the Tor network to enumerate onion services allowed attackers to discover private ``.onion`` addresses.
+To access an OnionShare service from its address, the private key used for client authentication must be guessed (unless the service is already made public by turning off the private key -- see :ref:`turn_off_private_key`).
What OnionShare doesn't protect against
---------------------------------------
-**Communicating the OnionShare address and private key might not be secure.** Communicating the OnionShare address to people is the responsibility of the OnionShare user. If sent insecurely (such as through an email message monitored by an attacker), an eavesdropper can tell that OnionShare is being used. If the eavesdropper loads the address in Tor Browser while the service is still up, they can access it. To avoid this, the address must be communicated securely, via encrypted text message (probably with disappearing messages enabled), encrypted email, or in person. This isn't necessary when using OnionShare for something that isn't secret.
-
-**Communicating the OnionShare address and private key might not be anonymous.** Extra precautions must be taken to ensure the OnionShare address is communicated anonymously. A new email or chat account, only accessed over Tor, can be used to share the address. This isn't necessary unless anonymity is a goal.
+**Communicating the OnionShare address and private key might not be secure.**
+Communicating the OnionShare address to people is the responsibility of the OnionShare user.
+If sent insecurely (such as through an e-mail message monitored by an attacker), an eavesdropper can tell that OnionShare is being used.
+Eavesdroppers can access services that are still up by loading their addresses and/or lost key in the Tor Browser.
+Avoid this by communicating the address securely, via encrypted text message (probably with disappearing messages enabled), encrypted e-mail, or in person.
+This isn't necessary when using OnionShare for something that isn't secret.
+
+**Communicating the OnionShare address and private key might not be anonymous.**
+Extra precaution must be taken to ensure the OnionShare address is communicated anonymously.
+A new e-mail or chat account, only accessed over Tor, can be used to share the address.
+This isn't necessary unless anonymity is a goal.