From f4abcf1be9122a28005dc3e0949bf5952192e982 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Mon, 12 Oct 2020 22:40:55 -0700 Subject: Add onionshare CLI to cli folder, move GUI to desktop folder, and start refactoring it to work with briefcase --- BUILD.md | 418 -- CHANGELOG.md | 233 - LICENSE | 679 -- MANIFEST.in | 13 - README.md | 2 +- apparmor/abstractions/onionshare | 29 - apparmor/local/usr.bin.onionshare | 2 - apparmor/local/usr.bin.onionshare-gui | 2 - apparmor/usr.bin.onionshare | 10 - apparmor/usr.bin.onionshare-gui | 28 - cli/.circleci/config.yml | 38 + cli/CHANGELOG.md | 3 + cli/LICENSE | 679 ++ cli/README.md | 87 + cli/onionshare_cli/__init__.py | 514 ++ cli/onionshare_cli/common.py | 300 + cli/onionshare_cli/mode_settings.py | 146 + cli/onionshare_cli/onion.py | 805 ++ cli/onionshare_cli/onionshare.py | 111 + cli/onionshare_cli/resources/static/css/style.css | 393 + cli/onionshare_cli/resources/static/img/ajax.gif | Bin 0 -> 847 bytes .../resources/static/img/favicon.ico | Bin 0 -> 4286 bytes cli/onionshare_cli/resources/static/img/logo.png | Bin 0 -> 3824 bytes .../resources/static/img/logo_large.png | Bin 0 -> 9663 bytes .../resources/static/img/web_file.png | Bin 0 -> 251 bytes .../resources/static/img/web_folder.png | Bin 0 -> 338 bytes cli/onionshare_cli/resources/static/js/chat.js | 165 + .../resources/static/js/jquery-3.5.1.min.js | 2 + cli/onionshare_cli/resources/static/js/receive.js | 130 + cli/onionshare_cli/resources/static/js/send.js | 75 + .../resources/static/js/socket.io.min.js | 3 + cli/onionshare_cli/resources/templates/401.html | 21 + cli/onionshare_cli/resources/templates/403.html | 21 + cli/onionshare_cli/resources/templates/404.html | 21 + cli/onionshare_cli/resources/templates/405.html | 21 + cli/onionshare_cli/resources/templates/chat.html | 46 + cli/onionshare_cli/resources/templates/denied.html | 15 + .../resources/templates/listing.html | 55 + .../resources/templates/receive.html | 46 + cli/onionshare_cli/resources/templates/send.html | 69 + .../resources/templates/thankyou.html | 27 + cli/onionshare_cli/resources/torrc_template | 8 + .../resources/torrc_template-meek_lite_amazon | 2 + .../resources/torrc_template-meek_lite_azure | 2 + cli/onionshare_cli/resources/torrc_template-obfs4 | 27 + cli/onionshare_cli/resources/version.txt | 1 + cli/onionshare_cli/resources/wordlist.txt | 7776 ++++++++++++++++++++ cli/onionshare_cli/settings.py | 197 + cli/onionshare_cli/web/__init__.py | 21 + cli/onionshare_cli/web/chat_mode.py | 159 + cli/onionshare_cli/web/receive_mode.py | 488 ++ cli/onionshare_cli/web/send_base_mode.py | 321 + cli/onionshare_cli/web/share_mode.py | 411 ++ cli/onionshare_cli/web/web.py | 424 ++ cli/onionshare_cli/web/website_mode.py | 123 + cli/poetry.lock | 618 ++ cli/pyproject.toml | 40 + cli/tests/__init__.py | 0 cli/tests/conftest.py | 198 + cli/tests/pytest.ini | 4 + cli/tests/test_cli.py | 58 + cli/tests/test_cli_common.py | 275 + cli/tests/test_cli_settings.py | 147 + cli/tests/test_cli_web.py | 231 + desktop/BUILD.md | 437 ++ desktop/CHANGELOG.md | 233 + desktop/LICENSE | 679 ++ desktop/MANIFEST.in | 13 + desktop/apparmor/abstractions/onionshare | 29 + desktop/apparmor/local/usr.bin.onionshare | 2 + desktop/apparmor/local/usr.bin.onionshare-gui | 2 + desktop/apparmor/usr.bin.onionshare | 10 + desktop/apparmor/usr.bin.onionshare-gui | 28 + desktop/dev_scripts/onionshare | 30 + desktop/dev_scripts/onionshare-gui | 30 + desktop/docs/Makefile | 20 + desktop/docs/README.md | 38 + desktop/docs/build.sh | 34 + desktop/docs/gettext/.doctrees/advanced.doctree | Bin 0 -> 29050 bytes desktop/docs/gettext/.doctrees/develop.doctree | Bin 0 -> 41566 bytes desktop/docs/gettext/.doctrees/environment.pickle | Bin 0 -> 38898 bytes desktop/docs/gettext/.doctrees/features.doctree | Bin 0 -> 43702 bytes desktop/docs/gettext/.doctrees/help.doctree | Bin 0 -> 8171 bytes desktop/docs/gettext/.doctrees/index.doctree | Bin 0 -> 3439 bytes desktop/docs/gettext/.doctrees/install.doctree | Bin 0 -> 20103 bytes desktop/docs/gettext/.doctrees/security.doctree | Bin 0 -> 15257 bytes desktop/docs/gettext/.doctrees/tor.doctree | Bin 0 -> 28661 bytes desktop/docs/gettext/advanced.pot | 153 + desktop/docs/gettext/develop.pot | 177 + desktop/docs/gettext/features.pot | 226 + desktop/docs/gettext/help.pot | 57 + desktop/docs/gettext/index.pot | 25 + desktop/docs/gettext/install.pot | 101 + desktop/docs/gettext/security.pot | 61 + desktop/docs/gettext/sphinx.pot | 25 + desktop/docs/gettext/tor.pot | 137 + desktop/docs/make.bat | 35 + desktop/docs/poetry.lock | 464 ++ desktop/docs/pyproject.toml | 17 + desktop/docs/source/_static/apple-logo.png | Bin 0 -> 6620 bytes desktop/docs/source/_static/custom.css | 21 + desktop/docs/source/_static/favicon.ico | Bin 0 -> 4286 bytes desktop/docs/source/_static/linux-logo.png | Bin 0 -> 10237 bytes desktop/docs/source/_static/logo.png | Bin 0 -> 18375 bytes .../_static/screenshots/advanced-save-tabs.png | Bin 0 -> 18667 bytes .../screenshots/advanced-schedule-start-timer.png | Bin 0 -> 47799 bytes .../screenshots/advanced-schedule-stop-timer.png | Bin 0 -> 114019 bytes .../source/_static/screenshots/chat-sharing.png | Bin 0 -> 60339 bytes .../source/_static/screenshots/chat-torbrowser.png | Bin 0 -> 48464 bytes desktop/docs/source/_static/screenshots/chat.png | Bin 0 -> 54235 bytes .../source/_static/screenshots/receive-sharing.png | Bin 0 -> 84635 bytes .../_static/screenshots/receive-torbrowser.png | Bin 0 -> 56883 bytes .../docs/source/_static/screenshots/receive.png | Bin 0 -> 84892 bytes .../docs/source/_static/screenshots/settings.png | Bin 0 -> 55802 bytes .../source/_static/screenshots/share-files.png | Bin 0 -> 48917 bytes .../source/_static/screenshots/share-sharing.png | Bin 0 -> 48161 bytes .../_static/screenshots/share-torbrowser.png | Bin 0 -> 42133 bytes desktop/docs/source/_static/screenshots/share.png | Bin 0 -> 43822 bytes desktop/docs/source/_static/screenshots/tabs.png | Bin 0 -> 61545 bytes .../source/_static/screenshots/website-files.png | Bin 0 -> 66994 bytes .../docs/source/_static/screenshots/website.png | Bin 0 -> 46330 bytes desktop/docs/source/_static/windows-logo.png | Bin 0 -> 5187 bytes desktop/docs/source/_templates/versions.html | 25 + desktop/docs/source/advanced.rst | 148 + desktop/docs/source/conf.py | 34 + desktop/docs/source/develop.rst | 200 + desktop/docs/source/features.rst | 144 + desktop/docs/source/help.rst | 24 + desktop/docs/source/index.rst | 17 + desktop/docs/source/install.rst | 66 + .../docs/source/locale/ar/LC_MESSAGES/advanced.po | 227 + .../docs/source/locale/ar/LC_MESSAGES/develop.po | 256 + .../docs/source/locale/ar/LC_MESSAGES/features.po | 382 + desktop/docs/source/locale/ar/LC_MESSAGES/help.po | 72 + desktop/docs/source/locale/ar/LC_MESSAGES/index.po | 29 + .../docs/source/locale/ar/LC_MESSAGES/install.po | 143 + .../docs/source/locale/ar/LC_MESSAGES/security.po | 114 + .../docs/source/locale/ar/LC_MESSAGES/sphinx.po | 27 + desktop/docs/source/locale/ar/LC_MESSAGES/tor.po | 216 + .../docs/source/locale/ca/LC_MESSAGES/advanced.po | 227 + .../docs/source/locale/ca/LC_MESSAGES/develop.po | 256 + .../docs/source/locale/ca/LC_MESSAGES/features.po | 382 + desktop/docs/source/locale/ca/LC_MESSAGES/help.po | 72 + desktop/docs/source/locale/ca/LC_MESSAGES/index.po | 29 + .../docs/source/locale/ca/LC_MESSAGES/install.po | 143 + .../docs/source/locale/ca/LC_MESSAGES/security.po | 114 + .../docs/source/locale/ca/LC_MESSAGES/sphinx.po | 27 + desktop/docs/source/locale/ca/LC_MESSAGES/tor.po | 216 + .../docs/source/locale/da/LC_MESSAGES/advanced.po | 227 + .../docs/source/locale/da/LC_MESSAGES/develop.po | 256 + .../docs/source/locale/da/LC_MESSAGES/features.po | 382 + desktop/docs/source/locale/da/LC_MESSAGES/help.po | 72 + desktop/docs/source/locale/da/LC_MESSAGES/index.po | 29 + .../docs/source/locale/da/LC_MESSAGES/install.po | 143 + .../docs/source/locale/da/LC_MESSAGES/security.po | 114 + .../docs/source/locale/da/LC_MESSAGES/sphinx.po | 27 + desktop/docs/source/locale/da/LC_MESSAGES/tor.po | 216 + .../docs/source/locale/de/LC_MESSAGES/advanced.po | 227 + .../docs/source/locale/de/LC_MESSAGES/develop.po | 256 + .../docs/source/locale/de/LC_MESSAGES/features.po | 382 + desktop/docs/source/locale/de/LC_MESSAGES/help.po | 72 + desktop/docs/source/locale/de/LC_MESSAGES/index.po | 29 + .../docs/source/locale/de/LC_MESSAGES/install.po | 143 + .../docs/source/locale/de/LC_MESSAGES/security.po | 114 + .../docs/source/locale/de/LC_MESSAGES/sphinx.po | 27 + desktop/docs/source/locale/de/LC_MESSAGES/tor.po | 216 + .../docs/source/locale/el/LC_MESSAGES/advanced.po | 227 + .../docs/source/locale/el/LC_MESSAGES/develop.po | 256 + .../docs/source/locale/el/LC_MESSAGES/features.po | 382 + desktop/docs/source/locale/el/LC_MESSAGES/help.po | 72 + desktop/docs/source/locale/el/LC_MESSAGES/index.po | 29 + .../docs/source/locale/el/LC_MESSAGES/install.po | 143 + .../docs/source/locale/el/LC_MESSAGES/security.po | 114 + .../docs/source/locale/el/LC_MESSAGES/sphinx.po | 27 + desktop/docs/source/locale/el/LC_MESSAGES/tor.po | 216 + .../docs/source/locale/en/LC_MESSAGES/advanced.po | 227 + .../docs/source/locale/en/LC_MESSAGES/develop.po | 256 + .../docs/source/locale/en/LC_MESSAGES/features.po | 382 + desktop/docs/source/locale/en/LC_MESSAGES/help.po | 72 + desktop/docs/source/locale/en/LC_MESSAGES/index.po | 29 + .../docs/source/locale/en/LC_MESSAGES/install.po | 143 + .../docs/source/locale/en/LC_MESSAGES/security.po | 114 + .../docs/source/locale/en/LC_MESSAGES/sphinx.po | 27 + desktop/docs/source/locale/en/LC_MESSAGES/tor.po | 216 + .../docs/source/locale/es/LC_MESSAGES/advanced.po | 304 + .../docs/source/locale/es/LC_MESSAGES/develop.po | 325 + .../docs/source/locale/es/LC_MESSAGES/features.po | 399 + desktop/docs/source/locale/es/LC_MESSAGES/help.po | 75 + desktop/docs/source/locale/es/LC_MESSAGES/index.po | 30 + .../docs/source/locale/es/LC_MESSAGES/install.po | 144 + .../docs/source/locale/es/LC_MESSAGES/security.po | 116 + .../docs/source/locale/es/LC_MESSAGES/sphinx.po | 27 + desktop/docs/source/locale/es/LC_MESSAGES/tor.po | 291 + .../docs/source/locale/fa/LC_MESSAGES/advanced.po | 227 + .../docs/source/locale/fa/LC_MESSAGES/develop.po | 256 + .../docs/source/locale/fa/LC_MESSAGES/features.po | 382 + desktop/docs/source/locale/fa/LC_MESSAGES/help.po | 72 + desktop/docs/source/locale/fa/LC_MESSAGES/index.po | 29 + .../docs/source/locale/fa/LC_MESSAGES/install.po | 143 + .../docs/source/locale/fa/LC_MESSAGES/security.po | 114 + .../docs/source/locale/fa/LC_MESSAGES/sphinx.po | 27 + desktop/docs/source/locale/fa/LC_MESSAGES/tor.po | 216 + .../docs/source/locale/fr/LC_MESSAGES/advanced.po | 228 + .../docs/source/locale/fr/LC_MESSAGES/develop.po | 257 + .../docs/source/locale/fr/LC_MESSAGES/features.po | 226 + desktop/docs/source/locale/fr/LC_MESSAGES/help.po | 57 + desktop/docs/source/locale/fr/LC_MESSAGES/index.po | 25 + .../docs/source/locale/fr/LC_MESSAGES/install.po | 101 + .../docs/source/locale/fr/LC_MESSAGES/security.po | 61 + .../docs/source/locale/fr/LC_MESSAGES/sphinx.po | 25 + desktop/docs/source/locale/fr/LC_MESSAGES/tor.po | 217 + .../docs/source/locale/ga/LC_MESSAGES/advanced.po | 227 + .../docs/source/locale/ga/LC_MESSAGES/develop.po | 256 + .../docs/source/locale/ga/LC_MESSAGES/features.po | 382 + desktop/docs/source/locale/ga/LC_MESSAGES/help.po | 72 + desktop/docs/source/locale/ga/LC_MESSAGES/index.po | 29 + .../docs/source/locale/ga/LC_MESSAGES/install.po | 143 + .../docs/source/locale/ga/LC_MESSAGES/security.po | 114 + .../docs/source/locale/ga/LC_MESSAGES/sphinx.po | 27 + desktop/docs/source/locale/ga/LC_MESSAGES/tor.po | 216 + .../docs/source/locale/is/LC_MESSAGES/advanced.po | 227 + .../docs/source/locale/is/LC_MESSAGES/develop.po | 256 + .../docs/source/locale/is/LC_MESSAGES/features.po | 382 + desktop/docs/source/locale/is/LC_MESSAGES/help.po | 72 + desktop/docs/source/locale/is/LC_MESSAGES/index.po | 29 + .../docs/source/locale/is/LC_MESSAGES/install.po | 143 + .../docs/source/locale/is/LC_MESSAGES/security.po | 114 + .../docs/source/locale/is/LC_MESSAGES/sphinx.po | 27 + desktop/docs/source/locale/is/LC_MESSAGES/tor.po | 216 + .../docs/source/locale/it/LC_MESSAGES/advanced.po | 227 + .../docs/source/locale/it/LC_MESSAGES/develop.po | 256 + .../docs/source/locale/it/LC_MESSAGES/features.po | 382 + desktop/docs/source/locale/it/LC_MESSAGES/help.po | 72 + desktop/docs/source/locale/it/LC_MESSAGES/index.po | 29 + .../docs/source/locale/it/LC_MESSAGES/install.po | 143 + .../docs/source/locale/it/LC_MESSAGES/security.po | 114 + .../docs/source/locale/it/LC_MESSAGES/sphinx.po | 27 + desktop/docs/source/locale/it/LC_MESSAGES/tor.po | 216 + .../docs/source/locale/ja/LC_MESSAGES/advanced.po | 227 + .../docs/source/locale/ja/LC_MESSAGES/develop.po | 256 + .../docs/source/locale/ja/LC_MESSAGES/features.po | 382 + desktop/docs/source/locale/ja/LC_MESSAGES/help.po | 72 + desktop/docs/source/locale/ja/LC_MESSAGES/index.po | 29 + .../docs/source/locale/ja/LC_MESSAGES/install.po | 143 + .../docs/source/locale/ja/LC_MESSAGES/security.po | 114 + .../docs/source/locale/ja/LC_MESSAGES/sphinx.po | 27 + desktop/docs/source/locale/ja/LC_MESSAGES/tor.po | 216 + .../source/locale/nb_NO/LC_MESSAGES/advanced.po | 228 + .../source/locale/nb_NO/LC_MESSAGES/develop.po | 257 + .../source/locale/nb_NO/LC_MESSAGES/features.po | 226 + .../docs/source/locale/nb_NO/LC_MESSAGES/help.po | 57 + .../docs/source/locale/nb_NO/LC_MESSAGES/index.po | 25 + .../source/locale/nb_NO/LC_MESSAGES/install.po | 101 + .../source/locale/nb_NO/LC_MESSAGES/security.po | 61 + .../docs/source/locale/nb_NO/LC_MESSAGES/sphinx.po | 25 + .../docs/source/locale/nb_NO/LC_MESSAGES/tor.po | 235 + .../docs/source/locale/nl/LC_MESSAGES/advanced.po | 227 + .../docs/source/locale/nl/LC_MESSAGES/develop.po | 256 + .../docs/source/locale/nl/LC_MESSAGES/features.po | 382 + desktop/docs/source/locale/nl/LC_MESSAGES/help.po | 72 + desktop/docs/source/locale/nl/LC_MESSAGES/index.po | 29 + .../docs/source/locale/nl/LC_MESSAGES/install.po | 143 + .../docs/source/locale/nl/LC_MESSAGES/security.po | 114 + .../docs/source/locale/nl/LC_MESSAGES/sphinx.po | 27 + desktop/docs/source/locale/nl/LC_MESSAGES/tor.po | 216 + .../docs/source/locale/pl/LC_MESSAGES/advanced.po | 227 + .../docs/source/locale/pl/LC_MESSAGES/develop.po | 256 + .../docs/source/locale/pl/LC_MESSAGES/features.po | 382 + desktop/docs/source/locale/pl/LC_MESSAGES/help.po | 72 + desktop/docs/source/locale/pl/LC_MESSAGES/index.po | 29 + .../docs/source/locale/pl/LC_MESSAGES/install.po | 143 + .../docs/source/locale/pl/LC_MESSAGES/security.po | 114 + .../docs/source/locale/pl/LC_MESSAGES/sphinx.po | 27 + desktop/docs/source/locale/pl/LC_MESSAGES/tor.po | 216 + .../source/locale/pt_BR/LC_MESSAGES/advanced.po | 227 + .../source/locale/pt_BR/LC_MESSAGES/develop.po | 256 + .../source/locale/pt_BR/LC_MESSAGES/features.po | 382 + .../docs/source/locale/pt_BR/LC_MESSAGES/help.po | 72 + .../docs/source/locale/pt_BR/LC_MESSAGES/index.po | 29 + .../source/locale/pt_BR/LC_MESSAGES/install.po | 143 + .../source/locale/pt_BR/LC_MESSAGES/security.po | 114 + .../docs/source/locale/pt_BR/LC_MESSAGES/sphinx.po | 27 + .../docs/source/locale/pt_BR/LC_MESSAGES/tor.po | 216 + .../source/locale/pt_PT/LC_MESSAGES/advanced.po | 227 + .../source/locale/pt_PT/LC_MESSAGES/develop.po | 256 + .../source/locale/pt_PT/LC_MESSAGES/features.po | 382 + .../docs/source/locale/pt_PT/LC_MESSAGES/help.po | 72 + .../docs/source/locale/pt_PT/LC_MESSAGES/index.po | 29 + .../source/locale/pt_PT/LC_MESSAGES/install.po | 143 + .../source/locale/pt_PT/LC_MESSAGES/security.po | 114 + .../docs/source/locale/pt_PT/LC_MESSAGES/sphinx.po | 27 + .../docs/source/locale/pt_PT/LC_MESSAGES/tor.po | 216 + .../docs/source/locale/ro/LC_MESSAGES/advanced.po | 227 + .../docs/source/locale/ro/LC_MESSAGES/develop.po | 256 + .../docs/source/locale/ro/LC_MESSAGES/features.po | 382 + desktop/docs/source/locale/ro/LC_MESSAGES/help.po | 72 + desktop/docs/source/locale/ro/LC_MESSAGES/index.po | 29 + .../docs/source/locale/ro/LC_MESSAGES/install.po | 143 + .../docs/source/locale/ro/LC_MESSAGES/security.po | 114 + .../docs/source/locale/ro/LC_MESSAGES/sphinx.po | 27 + desktop/docs/source/locale/ro/LC_MESSAGES/tor.po | 216 + .../docs/source/locale/ru/LC_MESSAGES/advanced.po | 227 + .../docs/source/locale/ru/LC_MESSAGES/develop.po | 256 + .../docs/source/locale/ru/LC_MESSAGES/features.po | 382 + desktop/docs/source/locale/ru/LC_MESSAGES/help.po | 72 + desktop/docs/source/locale/ru/LC_MESSAGES/index.po | 29 + .../docs/source/locale/ru/LC_MESSAGES/install.po | 143 + .../docs/source/locale/ru/LC_MESSAGES/security.po | 114 + .../docs/source/locale/ru/LC_MESSAGES/sphinx.po | 27 + desktop/docs/source/locale/ru/LC_MESSAGES/tor.po | 216 + .../source/locale/sr@latin/LC_MESSAGES/advanced.po | 227 + .../source/locale/sr@latin/LC_MESSAGES/develop.po | 256 + .../source/locale/sr@latin/LC_MESSAGES/features.po | 382 + .../source/locale/sr@latin/LC_MESSAGES/help.po | 72 + .../source/locale/sr@latin/LC_MESSAGES/index.po | 29 + .../source/locale/sr@latin/LC_MESSAGES/install.po | 143 + .../source/locale/sr@latin/LC_MESSAGES/security.po | 114 + .../source/locale/sr@latin/LC_MESSAGES/sphinx.po | 27 + .../docs/source/locale/sr@latin/LC_MESSAGES/tor.po | 216 + .../docs/source/locale/sv/LC_MESSAGES/advanced.po | 227 + .../docs/source/locale/sv/LC_MESSAGES/develop.po | 256 + .../docs/source/locale/sv/LC_MESSAGES/features.po | 382 + desktop/docs/source/locale/sv/LC_MESSAGES/help.po | 72 + desktop/docs/source/locale/sv/LC_MESSAGES/index.po | 29 + .../docs/source/locale/sv/LC_MESSAGES/install.po | 143 + .../docs/source/locale/sv/LC_MESSAGES/security.po | 114 + .../docs/source/locale/sv/LC_MESSAGES/sphinx.po | 27 + desktop/docs/source/locale/sv/LC_MESSAGES/tor.po | 216 + .../docs/source/locale/te/LC_MESSAGES/advanced.po | 227 + .../docs/source/locale/te/LC_MESSAGES/develop.po | 256 + .../docs/source/locale/te/LC_MESSAGES/features.po | 382 + desktop/docs/source/locale/te/LC_MESSAGES/help.po | 72 + desktop/docs/source/locale/te/LC_MESSAGES/index.po | 29 + .../docs/source/locale/te/LC_MESSAGES/install.po | 143 + .../docs/source/locale/te/LC_MESSAGES/security.po | 114 + .../docs/source/locale/te/LC_MESSAGES/sphinx.po | 27 + desktop/docs/source/locale/te/LC_MESSAGES/tor.po | 216 + .../docs/source/locale/tr/LC_MESSAGES/advanced.po | 227 + .../docs/source/locale/tr/LC_MESSAGES/develop.po | 256 + .../docs/source/locale/tr/LC_MESSAGES/features.po | 382 + desktop/docs/source/locale/tr/LC_MESSAGES/help.po | 72 + desktop/docs/source/locale/tr/LC_MESSAGES/index.po | 29 + .../docs/source/locale/tr/LC_MESSAGES/install.po | 143 + .../docs/source/locale/tr/LC_MESSAGES/security.po | 114 + .../docs/source/locale/tr/LC_MESSAGES/sphinx.po | 27 + desktop/docs/source/locale/tr/LC_MESSAGES/tor.po | 216 + .../docs/source/locale/uk/LC_MESSAGES/advanced.po | 298 + .../docs/source/locale/uk/LC_MESSAGES/develop.po | 328 + .../docs/source/locale/uk/LC_MESSAGES/features.po | 389 + desktop/docs/source/locale/uk/LC_MESSAGES/help.po | 73 + desktop/docs/source/locale/uk/LC_MESSAGES/index.po | 31 + .../docs/source/locale/uk/LC_MESSAGES/install.po | 144 + .../docs/source/locale/uk/LC_MESSAGES/security.po | 118 + .../docs/source/locale/uk/LC_MESSAGES/sphinx.po | 28 + desktop/docs/source/locale/uk/LC_MESSAGES/tor.po | 292 + .../source/locale/zh_CN/LC_MESSAGES/advanced.po | 227 + .../source/locale/zh_CN/LC_MESSAGES/develop.po | 256 + .../source/locale/zh_CN/LC_MESSAGES/features.po | 382 + .../docs/source/locale/zh_CN/LC_MESSAGES/help.po | 72 + .../docs/source/locale/zh_CN/LC_MESSAGES/index.po | 29 + .../source/locale/zh_CN/LC_MESSAGES/install.po | 143 + .../source/locale/zh_CN/LC_MESSAGES/security.po | 114 + .../docs/source/locale/zh_CN/LC_MESSAGES/sphinx.po | 27 + .../docs/source/locale/zh_CN/LC_MESSAGES/tor.po | 216 + .../source/locale/zh_TW/LC_MESSAGES/advanced.po | 227 + .../source/locale/zh_TW/LC_MESSAGES/develop.po | 256 + .../source/locale/zh_TW/LC_MESSAGES/features.po | 382 + .../docs/source/locale/zh_TW/LC_MESSAGES/help.po | 72 + .../docs/source/locale/zh_TW/LC_MESSAGES/index.po | 29 + .../source/locale/zh_TW/LC_MESSAGES/install.po | 143 + .../source/locale/zh_TW/LC_MESSAGES/security.po | 114 + .../docs/source/locale/zh_TW/LC_MESSAGES/sphinx.po | 27 + .../docs/source/locale/zh_TW/LC_MESSAGES/tor.po | 216 + desktop/docs/source/security.rst | 24 + desktop/docs/source/tor.rst | 93 + desktop/git-hooks/README.md | 3 + desktop/git-hooks/pre-push | 4 + desktop/install/build_deb.sh | 25 + desktop/install/build_exe.bat | 17 + desktop/install/build_osx.sh | 57 + desktop/install/build_rpm.sh | 17 + desktop/install/build_source.sh | 81 + desktop/install/check_lacked_trans.py | 155 + desktop/install/get-tor-osx.py | 126 + desktop/install/get-tor-windows.py | 104 + desktop/install/licenses/license-jquery.txt | 20 + desktop/install/licenses/license-obfs4.txt | 55 + desktop/install/licenses/license-onionshare.txt | 676 ++ desktop/install/licenses/license-tor.txt | 381 + desktop/install/licenses/readme.txt | 1 + desktop/install/macos_sandbox/child.plist | 10 + desktop/install/macos_sandbox/parent.plist | 43 + desktop/install/onionshare.icns | Bin 0 -> 34168 bytes desktop/install/onionshare.ico | Bin 0 -> 15086 bytes desktop/install/onionshare.nsi | 111 + desktop/install/onionshare80.xpm | 257 + .../install/org.onionshare.OnionShare.appdata.xml | 29 + desktop/install/org.onionshare.OnionShare.desktop | 18 + desktop/install/org.onionshare.OnionShare.png | Bin 0 -> 24613 bytes desktop/install/org.onionshare.OnionShare.svg | 2154 ++++++ desktop/install/ppa_release.sh | 18 + desktop/install/pyinstaller.spec | 116 + desktop/install/scripts/onionshare | 23 + desktop/install/scripts/onionshare-gui | 23 + desktop/install/scripts/onionshare-nautilus.py | 105 + desktop/install/scripts/onionshare-pyinstaller | 47 + desktop/onionshare/__init__.py | 514 ++ desktop/onionshare/common.py | 336 + desktop/onionshare/mode_settings.py | 146 + desktop/onionshare/onion.py | 775 ++ desktop/onionshare/onionshare.py | 111 + desktop/onionshare/settings.py | 199 + desktop/onionshare/strings.py | 61 + desktop/onionshare/web/__init__.py | 21 + desktop/onionshare/web/chat_mode.py | 159 + desktop/onionshare/web/receive_mode.py | 492 ++ desktop/onionshare/web/send_base_mode.py | 323 + desktop/onionshare/web/share_mode.py | 412 ++ desktop/onionshare/web/web.py | 426 ++ desktop/onionshare/web/website_mode.py | 124 + desktop/onionshare_gui/__init__.py | 192 + desktop/onionshare_gui/gui_common.py | 329 + desktop/onionshare_gui/main_window.py | 289 + desktop/onionshare_gui/settings_dialog.py | 1056 +++ desktop/onionshare_gui/tab/__init__.py | 21 + desktop/onionshare_gui/tab/mode/__init__.py | 494 ++ .../onionshare_gui/tab/mode/chat_mode/__init__.py | 153 + desktop/onionshare_gui/tab/mode/file_selection.py | 496 ++ desktop/onionshare_gui/tab/mode/history.py | 807 ++ .../tab/mode/mode_settings_widget.py | 296 + .../tab/mode/receive_mode/__init__.py | 323 + .../onionshare_gui/tab/mode/share_mode/__init__.py | 470 ++ .../onionshare_gui/tab/mode/share_mode/threads.py | 65 + .../tab/mode/website_mode/__init__.py | 330 + desktop/onionshare_gui/tab/server_status.py | 466 ++ desktop/onionshare_gui/tab/tab.py | 661 ++ desktop/onionshare_gui/tab_widget.py | 267 + desktop/onionshare_gui/threads.py | 253 + desktop/onionshare_gui/tor_connection_dialog.py | 168 + desktop/onionshare_gui/update_checker.py | 234 + desktop/onionshare_gui/widgets.py | 156 + desktop/pyproject.toml | 51 + .../appdata-onionshare-receive-client.png | Bin 0 -> 361337 bytes .../appdata-onionshare-receive-server.png | Bin 0 -> 340924 bytes .../appdata-onionshare-share-client.png | Bin 0 -> 372511 bytes .../appdata-onionshare-share-server.png | Bin 0 -> 526914 bytes desktop/screenshots/onionshare-receive-client.png | Bin 0 -> 589481 bytes desktop/screenshots/onionshare-receive-server.png | Bin 0 -> 569260 bytes desktop/screenshots/onionshare-share-client.png | Bin 0 -> 43404 bytes desktop/screenshots/onionshare-share-server.png | Bin 0 -> 57758 bytes desktop/screenshots/onionshare-website-server.png | Bin 0 -> 148709 bytes desktop/setup.cfg | 2 + desktop/setup.py | 98 + desktop/share/images/close_tab.png | Bin 0 -> 688 bytes desktop/share/images/file_delete.png | Bin 0 -> 182 bytes desktop/share/images/history_completed.png | Bin 0 -> 646 bytes desktop/share/images/history_completed_none.png | Bin 0 -> 437 bytes desktop/share/images/history_in_progress.png | Bin 0 -> 638 bytes desktop/share/images/history_in_progress_none.png | Bin 0 -> 412 bytes desktop/share/images/history_requests.png | Bin 0 -> 738 bytes desktop/share/images/history_requests_none.png | Bin 0 -> 754 bytes desktop/share/images/info.png | Bin 0 -> 435 bytes desktop/share/images/logo.png | Bin 0 -> 3824 bytes desktop/share/images/logo_grayscale.png | Bin 0 -> 2258 bytes desktop/share/images/logo_text.png | Bin 0 -> 3798 bytes desktop/share/images/logo_transparent.png | Bin 0 -> 3740 bytes desktop/share/images/mode_chat.png | Bin 0 -> 27306 bytes desktop/share/images/mode_chat.svg | 81 + desktop/share/images/mode_new_tab_chat.png | Bin 0 -> 5213 bytes desktop/share/images/mode_new_tab_receive.png | Bin 0 -> 6470 bytes desktop/share/images/mode_new_tab_share.png | Bin 0 -> 4485 bytes desktop/share/images/mode_new_tab_website.png | Bin 0 -> 3860 bytes desktop/share/images/mode_receive.png | Bin 0 -> 37288 bytes desktop/share/images/mode_receive.svg | 74 + desktop/share/images/mode_share.png | Bin 0 -> 9472 bytes desktop/share/images/mode_share.svg | 63 + desktop/share/images/mode_website.png | Bin 0 -> 8126 bytes desktop/share/images/mode_website.svg | 35 + desktop/share/images/open_folder.png | Bin 0 -> 221 bytes desktop/share/images/persistent_enabled.png | Bin 0 -> 3398 bytes desktop/share/images/receive_icon_toggle.png | Bin 0 -> 380 bytes .../share/images/receive_icon_toggle_selected.png | Bin 0 -> 468 bytes desktop/share/images/receive_icon_transparent.png | Bin 0 -> 2138 bytes desktop/share/images/server_started.png | Bin 0 -> 347 bytes desktop/share/images/server_stopped.png | Bin 0 -> 342 bytes desktop/share/images/server_working.png | Bin 0 -> 349 bytes desktop/share/images/settings.png | Bin 0 -> 1157 bytes desktop/share/images/share_icon_toggle.png | Bin 0 -> 389 bytes .../share/images/share_icon_toggle_selected.png | Bin 0 -> 473 bytes desktop/share/images/share_icon_transparent.png | Bin 0 -> 2096 bytes desktop/share/locale/af.json | 183 + desktop/share/locale/am.json | 185 + desktop/share/locale/ar.json | 237 + desktop/share/locale/bg.json | 185 + desktop/share/locale/bn.json | 267 + desktop/share/locale/ca.json | 276 + desktop/share/locale/cs.json | 112 + desktop/share/locale/da.json | 291 + desktop/share/locale/de.json | 287 + desktop/share/locale/el.json | 238 + desktop/share/locale/en.json | 191 + desktop/share/locale/eo.json | 63 + desktop/share/locale/es.json | 299 + desktop/share/locale/fa.json | 239 + desktop/share/locale/fi.json | 236 + desktop/share/locale/fr.json | 294 + desktop/share/locale/ga.json | 227 + desktop/share/locale/gu.json | 188 + desktop/share/locale/he.json | 191 + desktop/share/locale/hi.json | 190 + desktop/share/locale/hr.json | 232 + desktop/share/locale/hu.json | 196 + desktop/share/locale/id.json | 192 + desktop/share/locale/is.json | 287 + desktop/share/locale/it.json | 237 + desktop/share/locale/ja.json | 237 + desktop/share/locale/ka.json | 187 + desktop/share/locale/km.json | 175 + desktop/share/locale/ko.json | 185 + desktop/share/locale/lg.json | 185 + desktop/share/locale/lt.json | 208 + desktop/share/locale/mk.json | 185 + desktop/share/locale/ms.json | 184 + desktop/share/locale/nb_NO.json | 295 + desktop/share/locale/nl.json | 259 + desktop/share/locale/pa.json | 185 + desktop/share/locale/pl.json | 237 + desktop/share/locale/pt_BR.json | 268 + desktop/share/locale/pt_PT.json | 254 + desktop/share/locale/ro.json | 236 + desktop/share/locale/ru.json | 237 + desktop/share/locale/sl.json | 193 + desktop/share/locale/sn.json | 188 + desktop/share/locale/sr_Latn.json | 183 + desktop/share/locale/sv.json | 275 + desktop/share/locale/sw.json | 175 + desktop/share/locale/te.json | 175 + desktop/share/locale/tr.json | 257 + desktop/share/locale/uk.json | 232 + desktop/share/locale/wo.json | 185 + desktop/share/locale/yo.json | 185 + desktop/share/locale/zh_Hans.json | 273 + desktop/share/locale/zh_Hant.json | 253 + desktop/share/static/css/style.css | 393 + desktop/share/static/img/ajax.gif | Bin 0 -> 847 bytes desktop/share/static/img/favicon.ico | Bin 0 -> 4286 bytes desktop/share/static/img/logo.png | Bin 0 -> 3824 bytes desktop/share/static/img/logo_large.png | Bin 0 -> 9663 bytes desktop/share/static/img/web_file.png | Bin 0 -> 251 bytes desktop/share/static/img/web_folder.png | Bin 0 -> 338 bytes desktop/share/static/js/chat.js | 165 + desktop/share/static/js/jquery-3.5.1.min.js | 2 + desktop/share/static/js/receive.js | 130 + desktop/share/static/js/send.js | 75 + desktop/share/static/js/socket.io.min.js | 3 + desktop/share/templates/401.html | 21 + desktop/share/templates/403.html | 21 + desktop/share/templates/404.html | 21 + desktop/share/templates/405.html | 21 + desktop/share/templates/chat.html | 46 + desktop/share/templates/denied.html | 15 + desktop/share/templates/listing.html | 55 + desktop/share/templates/receive.html | 46 + desktop/share/templates/send.html | 69 + desktop/share/templates/thankyou.html | 27 + desktop/share/torrc_template | 8 + desktop/share/torrc_template-meek_lite_amazon | 2 + desktop/share/torrc_template-meek_lite_azure | 2 + desktop/share/torrc_template-obfs4 | 27 + desktop/share/version.txt | 1 + desktop/share/wordlist.txt | 7776 ++++++++++++++++++++ desktop/src/onionshare/__init__.py | 0 desktop/src/onionshare/resources/__init__.py | 0 desktop/src/onionshare/resources/onionshare.icns | Bin 0 -> 34168 bytes desktop/src/onionshare/resources/onionshare.ico | Bin 0 -> 15086 bytes desktop/src/onionshare/resources/onionshare.png | Bin 0 -> 24613 bytes desktop/stdeb.cfg | 6 + desktop/tests/__init__.py | 0 desktop/tests/conftest.py | 209 + desktop/tests/gui_base_test.py | 467 ++ desktop/tests/pytest.ini | 4 + desktop/tests/run.bat | 9 + desktop/tests/run.sh | 26 + desktop/tests/test_cli.py | 56 + desktop/tests/test_cli_common.py | 275 + desktop/tests/test_cli_settings.py | 149 + desktop/tests/test_cli_strings.py | 46 + desktop/tests/test_cli_web.py | 233 + desktop/tests/test_gui_receive.py | 252 + desktop/tests/test_gui_share.py | 629 ++ desktop/tests/test_gui_tabs.py | 236 + desktop/tests/test_gui_website.py | 107 + dev_scripts/onionshare | 30 - dev_scripts/onionshare-gui | 30 - docs/Makefile | 20 - docs/README.md | 38 - docs/build.sh | 34 - docs/gettext/.doctrees/advanced.doctree | Bin 29050 -> 0 bytes docs/gettext/.doctrees/develop.doctree | Bin 41566 -> 0 bytes docs/gettext/.doctrees/environment.pickle | Bin 38898 -> 0 bytes docs/gettext/.doctrees/features.doctree | Bin 43702 -> 0 bytes docs/gettext/.doctrees/help.doctree | Bin 8171 -> 0 bytes docs/gettext/.doctrees/index.doctree | Bin 3439 -> 0 bytes docs/gettext/.doctrees/install.doctree | Bin 20103 -> 0 bytes docs/gettext/.doctrees/security.doctree | Bin 15257 -> 0 bytes docs/gettext/.doctrees/tor.doctree | Bin 28661 -> 0 bytes docs/gettext/advanced.pot | 153 - docs/gettext/develop.pot | 177 - docs/gettext/features.pot | 226 - docs/gettext/help.pot | 57 - docs/gettext/index.pot | 25 - docs/gettext/install.pot | 101 - docs/gettext/security.pot | 61 - docs/gettext/sphinx.pot | 25 - docs/gettext/tor.pot | 137 - docs/make.bat | 35 - docs/poetry.lock | 464 -- docs/pyproject.toml | 17 - docs/source/_static/apple-logo.png | Bin 6620 -> 0 bytes docs/source/_static/custom.css | 21 - docs/source/_static/favicon.ico | Bin 4286 -> 0 bytes docs/source/_static/linux-logo.png | Bin 10237 -> 0 bytes docs/source/_static/logo.png | Bin 18375 -> 0 bytes .../_static/screenshots/advanced-save-tabs.png | Bin 18667 -> 0 bytes .../screenshots/advanced-schedule-start-timer.png | Bin 47799 -> 0 bytes .../screenshots/advanced-schedule-stop-timer.png | Bin 114019 -> 0 bytes docs/source/_static/screenshots/chat-sharing.png | Bin 60339 -> 0 bytes .../source/_static/screenshots/chat-torbrowser.png | Bin 48464 -> 0 bytes docs/source/_static/screenshots/chat.png | Bin 54235 -> 0 bytes .../source/_static/screenshots/receive-sharing.png | Bin 84635 -> 0 bytes .../_static/screenshots/receive-torbrowser.png | Bin 56883 -> 0 bytes docs/source/_static/screenshots/receive.png | Bin 84892 -> 0 bytes docs/source/_static/screenshots/settings.png | Bin 55802 -> 0 bytes docs/source/_static/screenshots/share-files.png | Bin 48917 -> 0 bytes docs/source/_static/screenshots/share-sharing.png | Bin 48161 -> 0 bytes .../_static/screenshots/share-torbrowser.png | Bin 42133 -> 0 bytes docs/source/_static/screenshots/share.png | Bin 43822 -> 0 bytes docs/source/_static/screenshots/tabs.png | Bin 61545 -> 0 bytes docs/source/_static/screenshots/website-files.png | Bin 66994 -> 0 bytes docs/source/_static/screenshots/website.png | Bin 46330 -> 0 bytes docs/source/_static/windows-logo.png | Bin 5187 -> 0 bytes docs/source/_templates/versions.html | 25 - docs/source/advanced.rst | 148 - docs/source/conf.py | 34 - docs/source/develop.rst | 200 - docs/source/features.rst | 144 - docs/source/help.rst | 24 - docs/source/index.rst | 17 - docs/source/install.rst | 66 - docs/source/locale/ar/LC_MESSAGES/advanced.po | 227 - docs/source/locale/ar/LC_MESSAGES/develop.po | 256 - docs/source/locale/ar/LC_MESSAGES/features.po | 382 - docs/source/locale/ar/LC_MESSAGES/help.po | 72 - docs/source/locale/ar/LC_MESSAGES/index.po | 29 - docs/source/locale/ar/LC_MESSAGES/install.po | 143 - docs/source/locale/ar/LC_MESSAGES/security.po | 114 - docs/source/locale/ar/LC_MESSAGES/sphinx.po | 27 - docs/source/locale/ar/LC_MESSAGES/tor.po | 216 - docs/source/locale/ca/LC_MESSAGES/advanced.po | 227 - docs/source/locale/ca/LC_MESSAGES/develop.po | 256 - docs/source/locale/ca/LC_MESSAGES/features.po | 382 - docs/source/locale/ca/LC_MESSAGES/help.po | 72 - docs/source/locale/ca/LC_MESSAGES/index.po | 29 - docs/source/locale/ca/LC_MESSAGES/install.po | 143 - docs/source/locale/ca/LC_MESSAGES/security.po | 114 - docs/source/locale/ca/LC_MESSAGES/sphinx.po | 27 - docs/source/locale/ca/LC_MESSAGES/tor.po | 216 - docs/source/locale/da/LC_MESSAGES/advanced.po | 227 - docs/source/locale/da/LC_MESSAGES/develop.po | 256 - docs/source/locale/da/LC_MESSAGES/features.po | 382 - docs/source/locale/da/LC_MESSAGES/help.po | 72 - docs/source/locale/da/LC_MESSAGES/index.po | 29 - docs/source/locale/da/LC_MESSAGES/install.po | 143 - docs/source/locale/da/LC_MESSAGES/security.po | 114 - docs/source/locale/da/LC_MESSAGES/sphinx.po | 27 - docs/source/locale/da/LC_MESSAGES/tor.po | 216 - docs/source/locale/de/LC_MESSAGES/advanced.po | 227 - docs/source/locale/de/LC_MESSAGES/develop.po | 256 - docs/source/locale/de/LC_MESSAGES/features.po | 382 - docs/source/locale/de/LC_MESSAGES/help.po | 72 - docs/source/locale/de/LC_MESSAGES/index.po | 29 - docs/source/locale/de/LC_MESSAGES/install.po | 143 - docs/source/locale/de/LC_MESSAGES/security.po | 114 - docs/source/locale/de/LC_MESSAGES/sphinx.po | 27 - docs/source/locale/de/LC_MESSAGES/tor.po | 216 - docs/source/locale/el/LC_MESSAGES/advanced.po | 227 - docs/source/locale/el/LC_MESSAGES/develop.po | 256 - docs/source/locale/el/LC_MESSAGES/features.po | 382 - docs/source/locale/el/LC_MESSAGES/help.po | 72 - docs/source/locale/el/LC_MESSAGES/index.po | 29 - docs/source/locale/el/LC_MESSAGES/install.po | 143 - docs/source/locale/el/LC_MESSAGES/security.po | 114 - docs/source/locale/el/LC_MESSAGES/sphinx.po | 27 - docs/source/locale/el/LC_MESSAGES/tor.po | 216 - docs/source/locale/en/LC_MESSAGES/advanced.po | 227 - docs/source/locale/en/LC_MESSAGES/develop.po | 256 - docs/source/locale/en/LC_MESSAGES/features.po | 382 - docs/source/locale/en/LC_MESSAGES/help.po | 72 - docs/source/locale/en/LC_MESSAGES/index.po | 29 - docs/source/locale/en/LC_MESSAGES/install.po | 143 - docs/source/locale/en/LC_MESSAGES/security.po | 114 - docs/source/locale/en/LC_MESSAGES/sphinx.po | 27 - docs/source/locale/en/LC_MESSAGES/tor.po | 216 - docs/source/locale/es/LC_MESSAGES/advanced.po | 304 - docs/source/locale/es/LC_MESSAGES/develop.po | 325 - docs/source/locale/es/LC_MESSAGES/features.po | 399 - docs/source/locale/es/LC_MESSAGES/help.po | 75 - docs/source/locale/es/LC_MESSAGES/index.po | 30 - docs/source/locale/es/LC_MESSAGES/install.po | 144 - docs/source/locale/es/LC_MESSAGES/security.po | 116 - docs/source/locale/es/LC_MESSAGES/sphinx.po | 27 - docs/source/locale/es/LC_MESSAGES/tor.po | 291 - docs/source/locale/fa/LC_MESSAGES/advanced.po | 227 - docs/source/locale/fa/LC_MESSAGES/develop.po | 256 - docs/source/locale/fa/LC_MESSAGES/features.po | 382 - docs/source/locale/fa/LC_MESSAGES/help.po | 72 - docs/source/locale/fa/LC_MESSAGES/index.po | 29 - docs/source/locale/fa/LC_MESSAGES/install.po | 143 - docs/source/locale/fa/LC_MESSAGES/security.po | 114 - docs/source/locale/fa/LC_MESSAGES/sphinx.po | 27 - docs/source/locale/fa/LC_MESSAGES/tor.po | 216 - docs/source/locale/fr/LC_MESSAGES/advanced.po | 228 - docs/source/locale/fr/LC_MESSAGES/develop.po | 257 - docs/source/locale/fr/LC_MESSAGES/features.po | 226 - docs/source/locale/fr/LC_MESSAGES/help.po | 57 - docs/source/locale/fr/LC_MESSAGES/index.po | 25 - docs/source/locale/fr/LC_MESSAGES/install.po | 101 - docs/source/locale/fr/LC_MESSAGES/security.po | 61 - docs/source/locale/fr/LC_MESSAGES/sphinx.po | 25 - docs/source/locale/fr/LC_MESSAGES/tor.po | 217 - docs/source/locale/ga/LC_MESSAGES/advanced.po | 227 - docs/source/locale/ga/LC_MESSAGES/develop.po | 256 - docs/source/locale/ga/LC_MESSAGES/features.po | 382 - docs/source/locale/ga/LC_MESSAGES/help.po | 72 - docs/source/locale/ga/LC_MESSAGES/index.po | 29 - docs/source/locale/ga/LC_MESSAGES/install.po | 143 - docs/source/locale/ga/LC_MESSAGES/security.po | 114 - docs/source/locale/ga/LC_MESSAGES/sphinx.po | 27 - docs/source/locale/ga/LC_MESSAGES/tor.po | 216 - docs/source/locale/is/LC_MESSAGES/advanced.po | 227 - docs/source/locale/is/LC_MESSAGES/develop.po | 256 - docs/source/locale/is/LC_MESSAGES/features.po | 382 - docs/source/locale/is/LC_MESSAGES/help.po | 72 - docs/source/locale/is/LC_MESSAGES/index.po | 29 - docs/source/locale/is/LC_MESSAGES/install.po | 143 - docs/source/locale/is/LC_MESSAGES/security.po | 114 - docs/source/locale/is/LC_MESSAGES/sphinx.po | 27 - docs/source/locale/is/LC_MESSAGES/tor.po | 216 - docs/source/locale/it/LC_MESSAGES/advanced.po | 227 - docs/source/locale/it/LC_MESSAGES/develop.po | 256 - docs/source/locale/it/LC_MESSAGES/features.po | 382 - docs/source/locale/it/LC_MESSAGES/help.po | 72 - docs/source/locale/it/LC_MESSAGES/index.po | 29 - docs/source/locale/it/LC_MESSAGES/install.po | 143 - docs/source/locale/it/LC_MESSAGES/security.po | 114 - docs/source/locale/it/LC_MESSAGES/sphinx.po | 27 - docs/source/locale/it/LC_MESSAGES/tor.po | 216 - docs/source/locale/ja/LC_MESSAGES/advanced.po | 227 - docs/source/locale/ja/LC_MESSAGES/develop.po | 256 - docs/source/locale/ja/LC_MESSAGES/features.po | 382 - docs/source/locale/ja/LC_MESSAGES/help.po | 72 - docs/source/locale/ja/LC_MESSAGES/index.po | 29 - docs/source/locale/ja/LC_MESSAGES/install.po | 143 - docs/source/locale/ja/LC_MESSAGES/security.po | 114 - docs/source/locale/ja/LC_MESSAGES/sphinx.po | 27 - docs/source/locale/ja/LC_MESSAGES/tor.po | 216 - docs/source/locale/nb_NO/LC_MESSAGES/advanced.po | 228 - docs/source/locale/nb_NO/LC_MESSAGES/develop.po | 257 - docs/source/locale/nb_NO/LC_MESSAGES/features.po | 226 - docs/source/locale/nb_NO/LC_MESSAGES/help.po | 57 - docs/source/locale/nb_NO/LC_MESSAGES/index.po | 25 - docs/source/locale/nb_NO/LC_MESSAGES/install.po | 101 - docs/source/locale/nb_NO/LC_MESSAGES/security.po | 61 - docs/source/locale/nb_NO/LC_MESSAGES/sphinx.po | 25 - docs/source/locale/nb_NO/LC_MESSAGES/tor.po | 235 - docs/source/locale/nl/LC_MESSAGES/advanced.po | 227 - docs/source/locale/nl/LC_MESSAGES/develop.po | 256 - docs/source/locale/nl/LC_MESSAGES/features.po | 382 - docs/source/locale/nl/LC_MESSAGES/help.po | 72 - docs/source/locale/nl/LC_MESSAGES/index.po | 29 - docs/source/locale/nl/LC_MESSAGES/install.po | 143 - docs/source/locale/nl/LC_MESSAGES/security.po | 114 - docs/source/locale/nl/LC_MESSAGES/sphinx.po | 27 - docs/source/locale/nl/LC_MESSAGES/tor.po | 216 - docs/source/locale/pl/LC_MESSAGES/advanced.po | 227 - docs/source/locale/pl/LC_MESSAGES/develop.po | 256 - docs/source/locale/pl/LC_MESSAGES/features.po | 382 - docs/source/locale/pl/LC_MESSAGES/help.po | 72 - docs/source/locale/pl/LC_MESSAGES/index.po | 29 - docs/source/locale/pl/LC_MESSAGES/install.po | 143 - docs/source/locale/pl/LC_MESSAGES/security.po | 114 - docs/source/locale/pl/LC_MESSAGES/sphinx.po | 27 - docs/source/locale/pl/LC_MESSAGES/tor.po | 216 - docs/source/locale/pt_BR/LC_MESSAGES/advanced.po | 227 - docs/source/locale/pt_BR/LC_MESSAGES/develop.po | 256 - docs/source/locale/pt_BR/LC_MESSAGES/features.po | 382 - docs/source/locale/pt_BR/LC_MESSAGES/help.po | 72 - docs/source/locale/pt_BR/LC_MESSAGES/index.po | 29 - docs/source/locale/pt_BR/LC_MESSAGES/install.po | 143 - docs/source/locale/pt_BR/LC_MESSAGES/security.po | 114 - docs/source/locale/pt_BR/LC_MESSAGES/sphinx.po | 27 - docs/source/locale/pt_BR/LC_MESSAGES/tor.po | 216 - docs/source/locale/pt_PT/LC_MESSAGES/advanced.po | 227 - docs/source/locale/pt_PT/LC_MESSAGES/develop.po | 256 - docs/source/locale/pt_PT/LC_MESSAGES/features.po | 382 - docs/source/locale/pt_PT/LC_MESSAGES/help.po | 72 - docs/source/locale/pt_PT/LC_MESSAGES/index.po | 29 - docs/source/locale/pt_PT/LC_MESSAGES/install.po | 143 - docs/source/locale/pt_PT/LC_MESSAGES/security.po | 114 - docs/source/locale/pt_PT/LC_MESSAGES/sphinx.po | 27 - docs/source/locale/pt_PT/LC_MESSAGES/tor.po | 216 - docs/source/locale/ro/LC_MESSAGES/advanced.po | 227 - docs/source/locale/ro/LC_MESSAGES/develop.po | 256 - docs/source/locale/ro/LC_MESSAGES/features.po | 382 - docs/source/locale/ro/LC_MESSAGES/help.po | 72 - docs/source/locale/ro/LC_MESSAGES/index.po | 29 - docs/source/locale/ro/LC_MESSAGES/install.po | 143 - docs/source/locale/ro/LC_MESSAGES/security.po | 114 - docs/source/locale/ro/LC_MESSAGES/sphinx.po | 27 - docs/source/locale/ro/LC_MESSAGES/tor.po | 216 - docs/source/locale/ru/LC_MESSAGES/advanced.po | 227 - docs/source/locale/ru/LC_MESSAGES/develop.po | 256 - docs/source/locale/ru/LC_MESSAGES/features.po | 382 - docs/source/locale/ru/LC_MESSAGES/help.po | 72 - docs/source/locale/ru/LC_MESSAGES/index.po | 29 - docs/source/locale/ru/LC_MESSAGES/install.po | 143 - docs/source/locale/ru/LC_MESSAGES/security.po | 114 - docs/source/locale/ru/LC_MESSAGES/sphinx.po | 27 - docs/source/locale/ru/LC_MESSAGES/tor.po | 216 - .../source/locale/sr@latin/LC_MESSAGES/advanced.po | 227 - docs/source/locale/sr@latin/LC_MESSAGES/develop.po | 256 - .../source/locale/sr@latin/LC_MESSAGES/features.po | 382 - docs/source/locale/sr@latin/LC_MESSAGES/help.po | 72 - docs/source/locale/sr@latin/LC_MESSAGES/index.po | 29 - docs/source/locale/sr@latin/LC_MESSAGES/install.po | 143 - .../source/locale/sr@latin/LC_MESSAGES/security.po | 114 - docs/source/locale/sr@latin/LC_MESSAGES/sphinx.po | 27 - docs/source/locale/sr@latin/LC_MESSAGES/tor.po | 216 - docs/source/locale/sv/LC_MESSAGES/advanced.po | 227 - docs/source/locale/sv/LC_MESSAGES/develop.po | 256 - docs/source/locale/sv/LC_MESSAGES/features.po | 382 - docs/source/locale/sv/LC_MESSAGES/help.po | 72 - docs/source/locale/sv/LC_MESSAGES/index.po | 29 - docs/source/locale/sv/LC_MESSAGES/install.po | 143 - docs/source/locale/sv/LC_MESSAGES/security.po | 114 - docs/source/locale/sv/LC_MESSAGES/sphinx.po | 27 - docs/source/locale/sv/LC_MESSAGES/tor.po | 216 - docs/source/locale/te/LC_MESSAGES/advanced.po | 227 - docs/source/locale/te/LC_MESSAGES/develop.po | 256 - docs/source/locale/te/LC_MESSAGES/features.po | 382 - docs/source/locale/te/LC_MESSAGES/help.po | 72 - docs/source/locale/te/LC_MESSAGES/index.po | 29 - docs/source/locale/te/LC_MESSAGES/install.po | 143 - docs/source/locale/te/LC_MESSAGES/security.po | 114 - docs/source/locale/te/LC_MESSAGES/sphinx.po | 27 - docs/source/locale/te/LC_MESSAGES/tor.po | 216 - docs/source/locale/tr/LC_MESSAGES/advanced.po | 227 - docs/source/locale/tr/LC_MESSAGES/develop.po | 256 - docs/source/locale/tr/LC_MESSAGES/features.po | 382 - docs/source/locale/tr/LC_MESSAGES/help.po | 72 - docs/source/locale/tr/LC_MESSAGES/index.po | 29 - docs/source/locale/tr/LC_MESSAGES/install.po | 143 - docs/source/locale/tr/LC_MESSAGES/security.po | 114 - docs/source/locale/tr/LC_MESSAGES/sphinx.po | 27 - docs/source/locale/tr/LC_MESSAGES/tor.po | 216 - docs/source/locale/uk/LC_MESSAGES/advanced.po | 298 - docs/source/locale/uk/LC_MESSAGES/develop.po | 328 - docs/source/locale/uk/LC_MESSAGES/features.po | 389 - docs/source/locale/uk/LC_MESSAGES/help.po | 73 - docs/source/locale/uk/LC_MESSAGES/index.po | 31 - docs/source/locale/uk/LC_MESSAGES/install.po | 144 - docs/source/locale/uk/LC_MESSAGES/security.po | 118 - docs/source/locale/uk/LC_MESSAGES/sphinx.po | 28 - docs/source/locale/uk/LC_MESSAGES/tor.po | 292 - docs/source/locale/zh_CN/LC_MESSAGES/advanced.po | 227 - docs/source/locale/zh_CN/LC_MESSAGES/develop.po | 256 - docs/source/locale/zh_CN/LC_MESSAGES/features.po | 382 - docs/source/locale/zh_CN/LC_MESSAGES/help.po | 72 - docs/source/locale/zh_CN/LC_MESSAGES/index.po | 29 - docs/source/locale/zh_CN/LC_MESSAGES/install.po | 143 - docs/source/locale/zh_CN/LC_MESSAGES/security.po | 114 - docs/source/locale/zh_CN/LC_MESSAGES/sphinx.po | 27 - docs/source/locale/zh_CN/LC_MESSAGES/tor.po | 216 - docs/source/locale/zh_TW/LC_MESSAGES/advanced.po | 227 - docs/source/locale/zh_TW/LC_MESSAGES/develop.po | 256 - docs/source/locale/zh_TW/LC_MESSAGES/features.po | 382 - docs/source/locale/zh_TW/LC_MESSAGES/help.po | 72 - docs/source/locale/zh_TW/LC_MESSAGES/index.po | 29 - docs/source/locale/zh_TW/LC_MESSAGES/install.po | 143 - docs/source/locale/zh_TW/LC_MESSAGES/security.po | 114 - docs/source/locale/zh_TW/LC_MESSAGES/sphinx.po | 27 - docs/source/locale/zh_TW/LC_MESSAGES/tor.po | 216 - docs/source/security.rst | 24 - docs/source/tor.rst | 93 - git-hooks/README.md | 3 - git-hooks/pre-push | 4 - install/build_deb.sh | 25 - install/build_exe.bat | 17 - install/build_osx.sh | 57 - install/build_rpm.sh | 17 - install/build_source.sh | 81 - install/check_lacked_trans.py | 155 - install/get-tor-osx.py | 126 - install/get-tor-windows.py | 104 - install/licenses/license-jquery.txt | 20 - install/licenses/license-obfs4.txt | 55 - install/licenses/license-onionshare.txt | 676 -- install/licenses/license-tor.txt | 381 - install/licenses/readme.txt | 1 - install/macos_sandbox/child.plist | 10 - install/macos_sandbox/parent.plist | 43 - install/onionshare.icns | Bin 34168 -> 0 bytes install/onionshare.ico | Bin 15086 -> 0 bytes install/onionshare.nsi | 111 - install/onionshare80.xpm | 257 - install/org.onionshare.OnionShare.appdata.xml | 29 - install/org.onionshare.OnionShare.desktop | 18 - install/org.onionshare.OnionShare.png | Bin 24613 -> 0 bytes install/org.onionshare.OnionShare.svg | 2154 ------ install/ppa_release.sh | 18 - install/pyinstaller.spec | 116 - install/scripts/onionshare | 23 - install/scripts/onionshare-gui | 23 - install/scripts/onionshare-nautilus.py | 105 - install/scripts/onionshare-pyinstaller | 47 - onionshare/__init__.py | 514 -- onionshare/common.py | 336 - onionshare/mode_settings.py | 146 - onionshare/onion.py | 775 -- onionshare/onionshare.py | 111 - onionshare/settings.py | 199 - onionshare/strings.py | 61 - onionshare/web/__init__.py | 21 - onionshare/web/chat_mode.py | 159 - onionshare/web/receive_mode.py | 492 -- onionshare/web/send_base_mode.py | 323 - onionshare/web/share_mode.py | 412 -- onionshare/web/web.py | 426 -- onionshare/web/website_mode.py | 124 - onionshare_gui/__init__.py | 192 - onionshare_gui/gui_common.py | 329 - onionshare_gui/main_window.py | 289 - onionshare_gui/settings_dialog.py | 1056 --- onionshare_gui/tab/__init__.py | 21 - onionshare_gui/tab/mode/__init__.py | 494 -- onionshare_gui/tab/mode/chat_mode/__init__.py | 153 - onionshare_gui/tab/mode/file_selection.py | 496 -- onionshare_gui/tab/mode/history.py | 807 -- onionshare_gui/tab/mode/mode_settings_widget.py | 296 - onionshare_gui/tab/mode/receive_mode/__init__.py | 323 - onionshare_gui/tab/mode/share_mode/__init__.py | 470 -- onionshare_gui/tab/mode/share_mode/threads.py | 65 - onionshare_gui/tab/mode/website_mode/__init__.py | 330 - onionshare_gui/tab/server_status.py | 466 -- onionshare_gui/tab/tab.py | 661 -- onionshare_gui/tab_widget.py | 267 - onionshare_gui/threads.py | 253 - onionshare_gui/tor_connection_dialog.py | 168 - onionshare_gui/update_checker.py | 234 - onionshare_gui/widgets.py | 156 - poetry.lock | 954 --- pyproject.toml | 43 - screenshots/appdata-onionshare-receive-client.png | Bin 361337 -> 0 bytes screenshots/appdata-onionshare-receive-server.png | Bin 340924 -> 0 bytes screenshots/appdata-onionshare-share-client.png | Bin 372511 -> 0 bytes screenshots/appdata-onionshare-share-server.png | Bin 526914 -> 0 bytes screenshots/onionshare-receive-client.png | Bin 589481 -> 0 bytes screenshots/onionshare-receive-server.png | Bin 569260 -> 0 bytes screenshots/onionshare-share-client.png | Bin 43404 -> 0 bytes screenshots/onionshare-share-server.png | Bin 57758 -> 0 bytes screenshots/onionshare-website-server.png | Bin 148709 -> 0 bytes setup.cfg | 2 - setup.py | 98 - share/images/close_tab.png | Bin 688 -> 0 bytes share/images/file_delete.png | Bin 182 -> 0 bytes share/images/history_completed.png | Bin 646 -> 0 bytes share/images/history_completed_none.png | Bin 437 -> 0 bytes share/images/history_in_progress.png | Bin 638 -> 0 bytes share/images/history_in_progress_none.png | Bin 412 -> 0 bytes share/images/history_requests.png | Bin 738 -> 0 bytes share/images/history_requests_none.png | Bin 754 -> 0 bytes share/images/info.png | Bin 435 -> 0 bytes share/images/logo.png | Bin 3824 -> 0 bytes share/images/logo_grayscale.png | Bin 2258 -> 0 bytes share/images/logo_text.png | Bin 3798 -> 0 bytes share/images/logo_transparent.png | Bin 3740 -> 0 bytes share/images/mode_chat.png | Bin 27306 -> 0 bytes share/images/mode_chat.svg | 81 - share/images/mode_new_tab_chat.png | Bin 5213 -> 0 bytes share/images/mode_new_tab_receive.png | Bin 6470 -> 0 bytes share/images/mode_new_tab_share.png | Bin 4485 -> 0 bytes share/images/mode_new_tab_website.png | Bin 3860 -> 0 bytes share/images/mode_receive.png | Bin 37288 -> 0 bytes share/images/mode_receive.svg | 74 - share/images/mode_share.png | Bin 9472 -> 0 bytes share/images/mode_share.svg | 63 - share/images/mode_website.png | Bin 8126 -> 0 bytes share/images/mode_website.svg | 35 - share/images/open_folder.png | Bin 221 -> 0 bytes share/images/persistent_enabled.png | Bin 3398 -> 0 bytes share/images/receive_icon_toggle.png | Bin 380 -> 0 bytes share/images/receive_icon_toggle_selected.png | Bin 468 -> 0 bytes share/images/receive_icon_transparent.png | Bin 2138 -> 0 bytes share/images/server_started.png | Bin 347 -> 0 bytes share/images/server_stopped.png | Bin 342 -> 0 bytes share/images/server_working.png | Bin 349 -> 0 bytes share/images/settings.png | Bin 1157 -> 0 bytes share/images/share_icon_toggle.png | Bin 389 -> 0 bytes share/images/share_icon_toggle_selected.png | Bin 473 -> 0 bytes share/images/share_icon_transparent.png | Bin 2096 -> 0 bytes share/locale/af.json | 183 - share/locale/am.json | 185 - share/locale/ar.json | 237 - share/locale/bg.json | 185 - share/locale/bn.json | 267 - share/locale/ca.json | 276 - share/locale/cs.json | 112 - share/locale/da.json | 291 - share/locale/de.json | 287 - share/locale/el.json | 238 - share/locale/en.json | 191 - share/locale/eo.json | 63 - share/locale/es.json | 299 - share/locale/fa.json | 239 - share/locale/fi.json | 236 - share/locale/fr.json | 294 - share/locale/ga.json | 227 - share/locale/gu.json | 188 - share/locale/he.json | 191 - share/locale/hi.json | 190 - share/locale/hr.json | 232 - share/locale/hu.json | 196 - share/locale/id.json | 192 - share/locale/is.json | 287 - share/locale/it.json | 237 - share/locale/ja.json | 237 - share/locale/ka.json | 187 - share/locale/km.json | 175 - share/locale/ko.json | 185 - share/locale/lg.json | 185 - share/locale/lt.json | 208 - share/locale/mk.json | 185 - share/locale/ms.json | 184 - share/locale/nb_NO.json | 295 - share/locale/nl.json | 259 - share/locale/pa.json | 185 - share/locale/pl.json | 237 - share/locale/pt_BR.json | 268 - share/locale/pt_PT.json | 254 - share/locale/ro.json | 236 - share/locale/ru.json | 237 - share/locale/sl.json | 193 - share/locale/sn.json | 188 - share/locale/sr_Latn.json | 183 - share/locale/sv.json | 275 - share/locale/sw.json | 175 - share/locale/te.json | 175 - share/locale/tr.json | 257 - share/locale/uk.json | 232 - share/locale/wo.json | 185 - share/locale/yo.json | 185 - share/locale/zh_Hans.json | 273 - share/locale/zh_Hant.json | 253 - share/static/css/style.css | 393 - share/static/img/ajax.gif | Bin 847 -> 0 bytes share/static/img/favicon.ico | Bin 4286 -> 0 bytes share/static/img/logo.png | Bin 3824 -> 0 bytes share/static/img/logo_large.png | Bin 9663 -> 0 bytes share/static/img/web_file.png | Bin 251 -> 0 bytes share/static/img/web_folder.png | Bin 338 -> 0 bytes share/static/js/chat.js | 165 - share/static/js/jquery-3.5.1.min.js | 2 - share/static/js/receive.js | 130 - share/static/js/send.js | 75 - share/static/js/socket.io.min.js | 3 - share/templates/401.html | 21 - share/templates/403.html | 21 - share/templates/404.html | 21 - share/templates/405.html | 21 - share/templates/chat.html | 46 - share/templates/denied.html | 15 - share/templates/listing.html | 55 - share/templates/receive.html | 46 - share/templates/send.html | 69 - share/templates/thankyou.html | 27 - share/torrc_template | 8 - share/torrc_template-meek_lite_amazon | 2 - share/torrc_template-meek_lite_azure | 2 - share/torrc_template-obfs4 | 27 - share/version.txt | 1 - share/wordlist.txt | 7776 -------------------- stdeb.cfg | 6 - tests/__init__.py | 0 tests/conftest.py | 209 - tests/gui_base_test.py | 467 -- tests/pytest.ini | 4 - tests/run.bat | 9 - tests/run.sh | 26 - tests/test_cli.py | 56 - tests/test_cli_common.py | 275 - tests/test_cli_settings.py | 149 - tests/test_cli_strings.py | 46 - tests/test_cli_web.py | 233 - tests/test_gui_receive.py | 252 - tests/test_gui_share.py | 629 -- tests/test_gui_tabs.py | 236 - tests/test_gui_website.py | 107 - 1107 files changed, 98675 insertions(+), 84278 deletions(-) delete mode 100644 BUILD.md delete mode 100644 CHANGELOG.md delete mode 100644 LICENSE delete mode 100644 MANIFEST.in delete mode 100644 apparmor/abstractions/onionshare delete mode 100644 apparmor/local/usr.bin.onionshare delete mode 100644 apparmor/local/usr.bin.onionshare-gui delete mode 100644 apparmor/usr.bin.onionshare delete mode 100644 apparmor/usr.bin.onionshare-gui create mode 100644 cli/.circleci/config.yml create mode 100644 cli/CHANGELOG.md create mode 100644 cli/LICENSE create mode 100644 cli/README.md create mode 100644 cli/onionshare_cli/__init__.py create mode 100644 cli/onionshare_cli/common.py create mode 100644 cli/onionshare_cli/mode_settings.py create mode 100644 cli/onionshare_cli/onion.py create mode 100644 cli/onionshare_cli/onionshare.py create mode 100644 cli/onionshare_cli/resources/static/css/style.css create mode 100644 cli/onionshare_cli/resources/static/img/ajax.gif create mode 100644 cli/onionshare_cli/resources/static/img/favicon.ico create mode 100644 cli/onionshare_cli/resources/static/img/logo.png create mode 100644 cli/onionshare_cli/resources/static/img/logo_large.png create mode 100644 cli/onionshare_cli/resources/static/img/web_file.png create mode 100644 cli/onionshare_cli/resources/static/img/web_folder.png create mode 100644 cli/onionshare_cli/resources/static/js/chat.js create mode 100644 cli/onionshare_cli/resources/static/js/jquery-3.5.1.min.js create mode 100644 cli/onionshare_cli/resources/static/js/receive.js create mode 100644 cli/onionshare_cli/resources/static/js/send.js create mode 100644 cli/onionshare_cli/resources/static/js/socket.io.min.js create mode 100644 cli/onionshare_cli/resources/templates/401.html create mode 100644 cli/onionshare_cli/resources/templates/403.html create mode 100644 cli/onionshare_cli/resources/templates/404.html create mode 100644 cli/onionshare_cli/resources/templates/405.html create mode 100644 cli/onionshare_cli/resources/templates/chat.html create mode 100644 cli/onionshare_cli/resources/templates/denied.html create mode 100644 cli/onionshare_cli/resources/templates/listing.html create mode 100644 cli/onionshare_cli/resources/templates/receive.html create mode 100644 cli/onionshare_cli/resources/templates/send.html create mode 100644 cli/onionshare_cli/resources/templates/thankyou.html create mode 100644 cli/onionshare_cli/resources/torrc_template create mode 100644 cli/onionshare_cli/resources/torrc_template-meek_lite_amazon create mode 100644 cli/onionshare_cli/resources/torrc_template-meek_lite_azure create mode 100644 cli/onionshare_cli/resources/torrc_template-obfs4 create mode 100644 cli/onionshare_cli/resources/version.txt create mode 100644 cli/onionshare_cli/resources/wordlist.txt create mode 100644 cli/onionshare_cli/settings.py create mode 100644 cli/onionshare_cli/web/__init__.py create mode 100644 cli/onionshare_cli/web/chat_mode.py create mode 100644 cli/onionshare_cli/web/receive_mode.py create mode 100644 cli/onionshare_cli/web/send_base_mode.py create mode 100644 cli/onionshare_cli/web/share_mode.py create mode 100644 cli/onionshare_cli/web/web.py create mode 100644 cli/onionshare_cli/web/website_mode.py create mode 100644 cli/poetry.lock create mode 100644 cli/pyproject.toml create mode 100644 cli/tests/__init__.py create mode 100644 cli/tests/conftest.py create mode 100644 cli/tests/pytest.ini create mode 100644 cli/tests/test_cli.py create mode 100644 cli/tests/test_cli_common.py create mode 100644 cli/tests/test_cli_settings.py create mode 100644 cli/tests/test_cli_web.py create mode 100644 desktop/BUILD.md create mode 100644 desktop/CHANGELOG.md create mode 100644 desktop/LICENSE create mode 100644 desktop/MANIFEST.in create mode 100644 desktop/apparmor/abstractions/onionshare create mode 100644 desktop/apparmor/local/usr.bin.onionshare create mode 100644 desktop/apparmor/local/usr.bin.onionshare-gui create mode 100644 desktop/apparmor/usr.bin.onionshare create mode 100644 desktop/apparmor/usr.bin.onionshare-gui create mode 100755 desktop/dev_scripts/onionshare create mode 100755 desktop/dev_scripts/onionshare-gui create mode 100644 desktop/docs/Makefile create mode 100644 desktop/docs/README.md create mode 100755 desktop/docs/build.sh create mode 100644 desktop/docs/gettext/.doctrees/advanced.doctree create mode 100644 desktop/docs/gettext/.doctrees/develop.doctree create mode 100644 desktop/docs/gettext/.doctrees/environment.pickle create mode 100644 desktop/docs/gettext/.doctrees/features.doctree create mode 100644 desktop/docs/gettext/.doctrees/help.doctree create mode 100644 desktop/docs/gettext/.doctrees/index.doctree create mode 100644 desktop/docs/gettext/.doctrees/install.doctree create mode 100644 desktop/docs/gettext/.doctrees/security.doctree create mode 100644 desktop/docs/gettext/.doctrees/tor.doctree create mode 100644 desktop/docs/gettext/advanced.pot create mode 100644 desktop/docs/gettext/develop.pot create mode 100644 desktop/docs/gettext/features.pot create mode 100644 desktop/docs/gettext/help.pot create mode 100644 desktop/docs/gettext/index.pot create mode 100644 desktop/docs/gettext/install.pot create mode 100644 desktop/docs/gettext/security.pot create mode 100644 desktop/docs/gettext/sphinx.pot create mode 100644 desktop/docs/gettext/tor.pot create mode 100644 desktop/docs/make.bat create mode 100644 desktop/docs/poetry.lock create mode 100644 desktop/docs/pyproject.toml create mode 100644 desktop/docs/source/_static/apple-logo.png create mode 100644 desktop/docs/source/_static/custom.css create mode 100644 desktop/docs/source/_static/favicon.ico create mode 100644 desktop/docs/source/_static/linux-logo.png create mode 100644 desktop/docs/source/_static/logo.png create mode 100644 desktop/docs/source/_static/screenshots/advanced-save-tabs.png create mode 100644 desktop/docs/source/_static/screenshots/advanced-schedule-start-timer.png create mode 100644 desktop/docs/source/_static/screenshots/advanced-schedule-stop-timer.png create mode 100644 desktop/docs/source/_static/screenshots/chat-sharing.png create mode 100644 desktop/docs/source/_static/screenshots/chat-torbrowser.png create mode 100644 desktop/docs/source/_static/screenshots/chat.png create mode 100644 desktop/docs/source/_static/screenshots/receive-sharing.png create mode 100644 desktop/docs/source/_static/screenshots/receive-torbrowser.png create mode 100644 desktop/docs/source/_static/screenshots/receive.png create mode 100644 desktop/docs/source/_static/screenshots/settings.png create mode 100644 desktop/docs/source/_static/screenshots/share-files.png create mode 100644 desktop/docs/source/_static/screenshots/share-sharing.png create mode 100644 desktop/docs/source/_static/screenshots/share-torbrowser.png create mode 100644 desktop/docs/source/_static/screenshots/share.png create mode 100644 desktop/docs/source/_static/screenshots/tabs.png create mode 100644 desktop/docs/source/_static/screenshots/website-files.png create mode 100644 desktop/docs/source/_static/screenshots/website.png create mode 100644 desktop/docs/source/_static/windows-logo.png create mode 100644 desktop/docs/source/_templates/versions.html create mode 100644 desktop/docs/source/advanced.rst create mode 100644 desktop/docs/source/conf.py create mode 100644 desktop/docs/source/develop.rst create mode 100644 desktop/docs/source/features.rst create mode 100644 desktop/docs/source/help.rst create mode 100644 desktop/docs/source/index.rst create mode 100644 desktop/docs/source/install.rst create mode 100644 desktop/docs/source/locale/ar/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/ar/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/ar/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/ar/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/ar/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/ar/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/ar/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/ar/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/ar/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/ca/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/ca/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/ca/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/ca/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/ca/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/ca/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/ca/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/ca/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/ca/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/da/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/da/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/da/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/da/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/da/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/da/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/da/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/da/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/da/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/de/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/de/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/de/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/de/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/de/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/de/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/de/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/de/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/de/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/el/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/el/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/el/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/el/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/el/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/el/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/el/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/el/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/el/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/en/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/en/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/en/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/en/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/en/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/en/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/en/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/en/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/en/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/es/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/es/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/es/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/es/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/es/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/es/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/es/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/es/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/es/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/fa/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/fa/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/fa/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/fa/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/fa/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/fa/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/fa/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/fa/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/fa/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/fr/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/fr/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/fr/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/fr/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/fr/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/fr/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/fr/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/fr/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/fr/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/ga/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/ga/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/ga/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/ga/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/ga/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/ga/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/ga/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/ga/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/ga/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/is/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/is/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/is/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/is/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/is/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/is/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/is/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/is/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/is/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/it/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/it/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/it/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/it/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/it/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/it/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/it/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/it/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/it/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/ja/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/ja/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/ja/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/ja/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/ja/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/ja/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/ja/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/ja/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/ja/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/nb_NO/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/nb_NO/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/nb_NO/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/nb_NO/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/nb_NO/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/nb_NO/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/nb_NO/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/nb_NO/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/nb_NO/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/nl/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/nl/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/nl/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/nl/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/nl/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/nl/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/nl/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/nl/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/nl/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/pl/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/pl/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/pl/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/pl/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/pl/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/pl/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/pl/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/pl/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/pl/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/pt_BR/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/pt_BR/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/pt_BR/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/pt_BR/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/pt_BR/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/pt_BR/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/pt_BR/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/pt_BR/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/pt_BR/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/pt_PT/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/pt_PT/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/pt_PT/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/pt_PT/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/pt_PT/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/pt_PT/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/pt_PT/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/pt_PT/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/pt_PT/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/ro/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/ro/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/ro/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/ro/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/ro/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/ro/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/ro/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/ro/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/ro/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/ru/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/ru/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/ru/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/ru/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/ru/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/ru/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/ru/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/ru/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/ru/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/sr@latin/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/sr@latin/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/sr@latin/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/sr@latin/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/sr@latin/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/sr@latin/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/sr@latin/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/sr@latin/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/sr@latin/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/sv/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/sv/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/sv/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/sv/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/sv/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/sv/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/sv/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/sv/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/sv/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/te/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/te/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/te/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/te/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/te/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/te/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/te/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/te/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/te/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/tr/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/tr/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/tr/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/tr/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/tr/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/tr/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/tr/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/tr/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/tr/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/uk/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/uk/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/uk/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/uk/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/uk/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/uk/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/uk/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/uk/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/uk/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/zh_CN/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/zh_CN/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/zh_CN/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/zh_CN/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/zh_CN/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/zh_CN/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/zh_CN/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/zh_CN/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/zh_CN/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/locale/zh_TW/LC_MESSAGES/advanced.po create mode 100644 desktop/docs/source/locale/zh_TW/LC_MESSAGES/develop.po create mode 100644 desktop/docs/source/locale/zh_TW/LC_MESSAGES/features.po create mode 100644 desktop/docs/source/locale/zh_TW/LC_MESSAGES/help.po create mode 100644 desktop/docs/source/locale/zh_TW/LC_MESSAGES/index.po create mode 100644 desktop/docs/source/locale/zh_TW/LC_MESSAGES/install.po create mode 100644 desktop/docs/source/locale/zh_TW/LC_MESSAGES/security.po create mode 100644 desktop/docs/source/locale/zh_TW/LC_MESSAGES/sphinx.po create mode 100644 desktop/docs/source/locale/zh_TW/LC_MESSAGES/tor.po create mode 100644 desktop/docs/source/security.rst create mode 100644 desktop/docs/source/tor.rst create mode 100644 desktop/git-hooks/README.md create mode 100755 desktop/git-hooks/pre-push create mode 100755 desktop/install/build_deb.sh create mode 100644 desktop/install/build_exe.bat create mode 100755 desktop/install/build_osx.sh create mode 100755 desktop/install/build_rpm.sh create mode 100755 desktop/install/build_source.sh create mode 100755 desktop/install/check_lacked_trans.py create mode 100644 desktop/install/get-tor-osx.py create mode 100644 desktop/install/get-tor-windows.py create mode 100644 desktop/install/licenses/license-jquery.txt create mode 100644 desktop/install/licenses/license-obfs4.txt create mode 100644 desktop/install/licenses/license-onionshare.txt create mode 100644 desktop/install/licenses/license-tor.txt create mode 100644 desktop/install/licenses/readme.txt create mode 100644 desktop/install/macos_sandbox/child.plist create mode 100644 desktop/install/macos_sandbox/parent.plist create mode 100644 desktop/install/onionshare.icns create mode 100644 desktop/install/onionshare.ico create mode 100644 desktop/install/onionshare.nsi create mode 100644 desktop/install/onionshare80.xpm create mode 100644 desktop/install/org.onionshare.OnionShare.appdata.xml create mode 100644 desktop/install/org.onionshare.OnionShare.desktop create mode 100644 desktop/install/org.onionshare.OnionShare.png create mode 100644 desktop/install/org.onionshare.OnionShare.svg create mode 100755 desktop/install/ppa_release.sh create mode 100644 desktop/install/pyinstaller.spec create mode 100755 desktop/install/scripts/onionshare create mode 100755 desktop/install/scripts/onionshare-gui create mode 100644 desktop/install/scripts/onionshare-nautilus.py create mode 100644 desktop/install/scripts/onionshare-pyinstaller create mode 100644 desktop/onionshare/__init__.py create mode 100644 desktop/onionshare/common.py create mode 100644 desktop/onionshare/mode_settings.py create mode 100644 desktop/onionshare/onion.py create mode 100644 desktop/onionshare/onionshare.py create mode 100644 desktop/onionshare/settings.py create mode 100644 desktop/onionshare/strings.py create mode 100644 desktop/onionshare/web/__init__.py create mode 100644 desktop/onionshare/web/chat_mode.py create mode 100644 desktop/onionshare/web/receive_mode.py create mode 100644 desktop/onionshare/web/send_base_mode.py create mode 100644 desktop/onionshare/web/share_mode.py create mode 100644 desktop/onionshare/web/web.py create mode 100644 desktop/onionshare/web/website_mode.py create mode 100644 desktop/onionshare_gui/__init__.py create mode 100644 desktop/onionshare_gui/gui_common.py create mode 100644 desktop/onionshare_gui/main_window.py create mode 100644 desktop/onionshare_gui/settings_dialog.py create mode 100644 desktop/onionshare_gui/tab/__init__.py create mode 100644 desktop/onionshare_gui/tab/mode/__init__.py create mode 100644 desktop/onionshare_gui/tab/mode/chat_mode/__init__.py create mode 100644 desktop/onionshare_gui/tab/mode/file_selection.py create mode 100644 desktop/onionshare_gui/tab/mode/history.py create mode 100644 desktop/onionshare_gui/tab/mode/mode_settings_widget.py create mode 100644 desktop/onionshare_gui/tab/mode/receive_mode/__init__.py create mode 100644 desktop/onionshare_gui/tab/mode/share_mode/__init__.py create mode 100644 desktop/onionshare_gui/tab/mode/share_mode/threads.py create mode 100644 desktop/onionshare_gui/tab/mode/website_mode/__init__.py create mode 100644 desktop/onionshare_gui/tab/server_status.py create mode 100644 desktop/onionshare_gui/tab/tab.py create mode 100644 desktop/onionshare_gui/tab_widget.py create mode 100644 desktop/onionshare_gui/threads.py create mode 100644 desktop/onionshare_gui/tor_connection_dialog.py create mode 100644 desktop/onionshare_gui/update_checker.py create mode 100644 desktop/onionshare_gui/widgets.py create mode 100644 desktop/pyproject.toml create mode 100644 desktop/screenshots/appdata-onionshare-receive-client.png create mode 100644 desktop/screenshots/appdata-onionshare-receive-server.png create mode 100644 desktop/screenshots/appdata-onionshare-share-client.png create mode 100644 desktop/screenshots/appdata-onionshare-share-server.png create mode 100644 desktop/screenshots/onionshare-receive-client.png create mode 100644 desktop/screenshots/onionshare-receive-server.png create mode 100644 desktop/screenshots/onionshare-share-client.png create mode 100644 desktop/screenshots/onionshare-share-server.png create mode 100644 desktop/screenshots/onionshare-website-server.png create mode 100644 desktop/setup.cfg create mode 100644 desktop/setup.py create mode 100644 desktop/share/images/close_tab.png create mode 100644 desktop/share/images/file_delete.png create mode 100644 desktop/share/images/history_completed.png create mode 100644 desktop/share/images/history_completed_none.png create mode 100644 desktop/share/images/history_in_progress.png create mode 100644 desktop/share/images/history_in_progress_none.png create mode 100644 desktop/share/images/history_requests.png create mode 100644 desktop/share/images/history_requests_none.png create mode 100644 desktop/share/images/info.png create mode 100644 desktop/share/images/logo.png create mode 100644 desktop/share/images/logo_grayscale.png create mode 100644 desktop/share/images/logo_text.png create mode 100644 desktop/share/images/logo_transparent.png create mode 100644 desktop/share/images/mode_chat.png create mode 100644 desktop/share/images/mode_chat.svg create mode 100644 desktop/share/images/mode_new_tab_chat.png create mode 100644 desktop/share/images/mode_new_tab_receive.png create mode 100644 desktop/share/images/mode_new_tab_share.png create mode 100644 desktop/share/images/mode_new_tab_website.png create mode 100644 desktop/share/images/mode_receive.png create mode 100644 desktop/share/images/mode_receive.svg create mode 100644 desktop/share/images/mode_share.png create mode 100644 desktop/share/images/mode_share.svg create mode 100644 desktop/share/images/mode_website.png create mode 100644 desktop/share/images/mode_website.svg create mode 100644 desktop/share/images/open_folder.png create mode 100644 desktop/share/images/persistent_enabled.png create mode 100644 desktop/share/images/receive_icon_toggle.png create mode 100644 desktop/share/images/receive_icon_toggle_selected.png create mode 100644 desktop/share/images/receive_icon_transparent.png create mode 100644 desktop/share/images/server_started.png create mode 100644 desktop/share/images/server_stopped.png create mode 100644 desktop/share/images/server_working.png create mode 100644 desktop/share/images/settings.png create mode 100644 desktop/share/images/share_icon_toggle.png create mode 100644 desktop/share/images/share_icon_toggle_selected.png create mode 100644 desktop/share/images/share_icon_transparent.png create mode 100644 desktop/share/locale/af.json create mode 100644 desktop/share/locale/am.json create mode 100644 desktop/share/locale/ar.json create mode 100644 desktop/share/locale/bg.json create mode 100644 desktop/share/locale/bn.json create mode 100644 desktop/share/locale/ca.json create mode 100644 desktop/share/locale/cs.json create mode 100644 desktop/share/locale/da.json create mode 100644 desktop/share/locale/de.json create mode 100644 desktop/share/locale/el.json create mode 100644 desktop/share/locale/en.json create mode 100644 desktop/share/locale/eo.json create mode 100644 desktop/share/locale/es.json create mode 100644 desktop/share/locale/fa.json create mode 100644 desktop/share/locale/fi.json create mode 100644 desktop/share/locale/fr.json create mode 100644 desktop/share/locale/ga.json create mode 100644 desktop/share/locale/gu.json create mode 100644 desktop/share/locale/he.json create mode 100644 desktop/share/locale/hi.json create mode 100644 desktop/share/locale/hr.json create mode 100644 desktop/share/locale/hu.json create mode 100644 desktop/share/locale/id.json create mode 100644 desktop/share/locale/is.json create mode 100644 desktop/share/locale/it.json create mode 100644 desktop/share/locale/ja.json create mode 100644 desktop/share/locale/ka.json create mode 100644 desktop/share/locale/km.json create mode 100644 desktop/share/locale/ko.json create mode 100644 desktop/share/locale/lg.json create mode 100644 desktop/share/locale/lt.json create mode 100644 desktop/share/locale/mk.json create mode 100644 desktop/share/locale/ms.json create mode 100644 desktop/share/locale/nb_NO.json create mode 100644 desktop/share/locale/nl.json create mode 100644 desktop/share/locale/pa.json create mode 100644 desktop/share/locale/pl.json create mode 100644 desktop/share/locale/pt_BR.json create mode 100644 desktop/share/locale/pt_PT.json create mode 100644 desktop/share/locale/ro.json create mode 100644 desktop/share/locale/ru.json create mode 100644 desktop/share/locale/sl.json create mode 100644 desktop/share/locale/sn.json create mode 100644 desktop/share/locale/sr_Latn.json create mode 100644 desktop/share/locale/sv.json create mode 100644 desktop/share/locale/sw.json create mode 100644 desktop/share/locale/te.json create mode 100644 desktop/share/locale/tr.json create mode 100644 desktop/share/locale/uk.json create mode 100644 desktop/share/locale/wo.json create mode 100644 desktop/share/locale/yo.json create mode 100644 desktop/share/locale/zh_Hans.json create mode 100644 desktop/share/locale/zh_Hant.json create mode 100644 desktop/share/static/css/style.css create mode 100644 desktop/share/static/img/ajax.gif create mode 100644 desktop/share/static/img/favicon.ico create mode 100644 desktop/share/static/img/logo.png create mode 100644 desktop/share/static/img/logo_large.png create mode 100644 desktop/share/static/img/web_file.png create mode 100644 desktop/share/static/img/web_folder.png create mode 100644 desktop/share/static/js/chat.js create mode 100644 desktop/share/static/js/jquery-3.5.1.min.js create mode 100644 desktop/share/static/js/receive.js create mode 100644 desktop/share/static/js/send.js create mode 100644 desktop/share/static/js/socket.io.min.js create mode 100644 desktop/share/templates/401.html create mode 100644 desktop/share/templates/403.html create mode 100644 desktop/share/templates/404.html create mode 100644 desktop/share/templates/405.html create mode 100644 desktop/share/templates/chat.html create mode 100644 desktop/share/templates/denied.html create mode 100644 desktop/share/templates/listing.html create mode 100644 desktop/share/templates/receive.html create mode 100644 desktop/share/templates/send.html create mode 100644 desktop/share/templates/thankyou.html create mode 100644 desktop/share/torrc_template create mode 100644 desktop/share/torrc_template-meek_lite_amazon create mode 100644 desktop/share/torrc_template-meek_lite_azure create mode 100644 desktop/share/torrc_template-obfs4 create mode 100644 desktop/share/version.txt create mode 100644 desktop/share/wordlist.txt create mode 100644 desktop/src/onionshare/__init__.py create mode 100644 desktop/src/onionshare/resources/__init__.py create mode 100644 desktop/src/onionshare/resources/onionshare.icns create mode 100644 desktop/src/onionshare/resources/onionshare.ico create mode 100644 desktop/src/onionshare/resources/onionshare.png create mode 100644 desktop/stdeb.cfg create mode 100644 desktop/tests/__init__.py create mode 100644 desktop/tests/conftest.py create mode 100644 desktop/tests/gui_base_test.py create mode 100644 desktop/tests/pytest.ini create mode 100644 desktop/tests/run.bat create mode 100755 desktop/tests/run.sh create mode 100644 desktop/tests/test_cli.py create mode 100644 desktop/tests/test_cli_common.py create mode 100644 desktop/tests/test_cli_settings.py create mode 100644 desktop/tests/test_cli_strings.py create mode 100644 desktop/tests/test_cli_web.py create mode 100644 desktop/tests/test_gui_receive.py create mode 100644 desktop/tests/test_gui_share.py create mode 100644 desktop/tests/test_gui_tabs.py create mode 100644 desktop/tests/test_gui_website.py delete mode 100755 dev_scripts/onionshare delete mode 100755 dev_scripts/onionshare-gui delete mode 100644 docs/Makefile delete mode 100644 docs/README.md delete mode 100755 docs/build.sh delete mode 100644 docs/gettext/.doctrees/advanced.doctree delete mode 100644 docs/gettext/.doctrees/develop.doctree delete mode 100644 docs/gettext/.doctrees/environment.pickle delete mode 100644 docs/gettext/.doctrees/features.doctree delete mode 100644 docs/gettext/.doctrees/help.doctree delete mode 100644 docs/gettext/.doctrees/index.doctree delete mode 100644 docs/gettext/.doctrees/install.doctree delete mode 100644 docs/gettext/.doctrees/security.doctree delete mode 100644 docs/gettext/.doctrees/tor.doctree delete mode 100644 docs/gettext/advanced.pot delete mode 100644 docs/gettext/develop.pot delete mode 100644 docs/gettext/features.pot delete mode 100644 docs/gettext/help.pot delete mode 100644 docs/gettext/index.pot delete mode 100644 docs/gettext/install.pot delete mode 100644 docs/gettext/security.pot delete mode 100644 docs/gettext/sphinx.pot delete mode 100644 docs/gettext/tor.pot delete mode 100644 docs/make.bat delete mode 100644 docs/poetry.lock delete mode 100644 docs/pyproject.toml delete mode 100644 docs/source/_static/apple-logo.png delete mode 100644 docs/source/_static/custom.css delete mode 100644 docs/source/_static/favicon.ico delete mode 100644 docs/source/_static/linux-logo.png delete mode 100644 docs/source/_static/logo.png delete mode 100644 docs/source/_static/screenshots/advanced-save-tabs.png delete mode 100644 docs/source/_static/screenshots/advanced-schedule-start-timer.png delete mode 100644 docs/source/_static/screenshots/advanced-schedule-stop-timer.png delete mode 100644 docs/source/_static/screenshots/chat-sharing.png delete mode 100644 docs/source/_static/screenshots/chat-torbrowser.png delete mode 100644 docs/source/_static/screenshots/chat.png delete mode 100644 docs/source/_static/screenshots/receive-sharing.png delete mode 100644 docs/source/_static/screenshots/receive-torbrowser.png delete mode 100644 docs/source/_static/screenshots/receive.png delete mode 100644 docs/source/_static/screenshots/settings.png delete mode 100644 docs/source/_static/screenshots/share-files.png delete mode 100644 docs/source/_static/screenshots/share-sharing.png delete mode 100644 docs/source/_static/screenshots/share-torbrowser.png delete mode 100644 docs/source/_static/screenshots/share.png delete mode 100644 docs/source/_static/screenshots/tabs.png delete mode 100644 docs/source/_static/screenshots/website-files.png delete mode 100644 docs/source/_static/screenshots/website.png delete mode 100644 docs/source/_static/windows-logo.png delete mode 100644 docs/source/_templates/versions.html delete mode 100644 docs/source/advanced.rst delete mode 100644 docs/source/conf.py delete mode 100644 docs/source/develop.rst delete mode 100644 docs/source/features.rst delete mode 100644 docs/source/help.rst delete mode 100644 docs/source/index.rst delete mode 100644 docs/source/install.rst delete mode 100644 docs/source/locale/ar/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/ar/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/ar/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/ar/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/ar/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/ar/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/ar/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/ar/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/ar/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/ca/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/ca/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/ca/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/ca/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/ca/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/ca/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/ca/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/ca/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/ca/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/da/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/da/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/da/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/da/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/da/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/da/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/da/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/da/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/da/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/de/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/de/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/de/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/de/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/de/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/de/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/de/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/de/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/de/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/el/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/el/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/el/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/el/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/el/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/el/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/el/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/el/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/el/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/en/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/en/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/en/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/en/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/en/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/en/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/en/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/en/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/en/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/es/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/es/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/es/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/es/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/es/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/es/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/es/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/es/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/es/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/fa/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/fa/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/fa/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/fa/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/fa/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/fa/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/fa/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/fa/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/fa/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/fr/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/fr/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/fr/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/fr/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/fr/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/fr/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/fr/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/fr/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/fr/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/ga/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/ga/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/ga/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/ga/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/ga/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/ga/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/ga/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/ga/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/ga/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/is/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/is/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/is/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/is/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/is/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/is/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/is/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/is/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/is/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/it/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/it/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/it/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/it/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/it/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/it/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/it/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/it/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/it/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/ja/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/ja/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/ja/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/ja/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/ja/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/ja/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/ja/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/ja/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/ja/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/nb_NO/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/nb_NO/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/nb_NO/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/nb_NO/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/nb_NO/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/nb_NO/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/nb_NO/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/nb_NO/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/nb_NO/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/nl/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/nl/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/nl/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/nl/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/nl/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/nl/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/nl/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/nl/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/nl/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/pl/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/pl/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/pl/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/pl/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/pl/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/pl/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/pl/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/pl/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/pl/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/pt_BR/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/pt_BR/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/pt_BR/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/pt_BR/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/pt_BR/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/pt_BR/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/pt_BR/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/pt_BR/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/pt_BR/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/pt_PT/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/pt_PT/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/pt_PT/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/pt_PT/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/pt_PT/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/pt_PT/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/pt_PT/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/pt_PT/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/pt_PT/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/ro/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/ro/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/ro/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/ro/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/ro/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/ro/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/ro/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/ro/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/ro/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/ru/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/ru/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/ru/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/ru/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/ru/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/ru/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/ru/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/ru/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/ru/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/sr@latin/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/sr@latin/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/sr@latin/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/sr@latin/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/sr@latin/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/sr@latin/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/sr@latin/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/sr@latin/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/sr@latin/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/sv/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/sv/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/sv/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/sv/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/sv/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/sv/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/sv/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/sv/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/sv/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/te/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/te/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/te/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/te/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/te/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/te/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/te/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/te/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/te/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/tr/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/tr/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/tr/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/tr/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/tr/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/tr/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/tr/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/tr/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/tr/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/uk/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/uk/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/uk/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/uk/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/uk/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/uk/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/uk/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/uk/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/uk/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/zh_CN/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/zh_CN/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/zh_CN/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/zh_CN/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/zh_CN/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/zh_CN/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/zh_CN/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/zh_CN/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/zh_CN/LC_MESSAGES/tor.po delete mode 100644 docs/source/locale/zh_TW/LC_MESSAGES/advanced.po delete mode 100644 docs/source/locale/zh_TW/LC_MESSAGES/develop.po delete mode 100644 docs/source/locale/zh_TW/LC_MESSAGES/features.po delete mode 100644 docs/source/locale/zh_TW/LC_MESSAGES/help.po delete mode 100644 docs/source/locale/zh_TW/LC_MESSAGES/index.po delete mode 100644 docs/source/locale/zh_TW/LC_MESSAGES/install.po delete mode 100644 docs/source/locale/zh_TW/LC_MESSAGES/security.po delete mode 100644 docs/source/locale/zh_TW/LC_MESSAGES/sphinx.po delete mode 100644 docs/source/locale/zh_TW/LC_MESSAGES/tor.po delete mode 100644 docs/source/security.rst delete mode 100644 docs/source/tor.rst delete mode 100644 git-hooks/README.md delete mode 100755 git-hooks/pre-push delete mode 100755 install/build_deb.sh delete mode 100644 install/build_exe.bat delete mode 100755 install/build_osx.sh delete mode 100755 install/build_rpm.sh delete mode 100755 install/build_source.sh delete mode 100755 install/check_lacked_trans.py delete mode 100644 install/get-tor-osx.py delete mode 100644 install/get-tor-windows.py delete mode 100644 install/licenses/license-jquery.txt delete mode 100644 install/licenses/license-obfs4.txt delete mode 100644 install/licenses/license-onionshare.txt delete mode 100644 install/licenses/license-tor.txt delete mode 100644 install/licenses/readme.txt delete mode 100644 install/macos_sandbox/child.plist delete mode 100644 install/macos_sandbox/parent.plist delete mode 100644 install/onionshare.icns delete mode 100644 install/onionshare.ico delete mode 100644 install/onionshare.nsi delete mode 100644 install/onionshare80.xpm delete mode 100644 install/org.onionshare.OnionShare.appdata.xml delete mode 100644 install/org.onionshare.OnionShare.desktop delete mode 100644 install/org.onionshare.OnionShare.png delete mode 100644 install/org.onionshare.OnionShare.svg delete mode 100755 install/ppa_release.sh delete mode 100644 install/pyinstaller.spec delete mode 100755 install/scripts/onionshare delete mode 100755 install/scripts/onionshare-gui delete mode 100644 install/scripts/onionshare-nautilus.py delete mode 100644 install/scripts/onionshare-pyinstaller delete mode 100644 onionshare/__init__.py delete mode 100644 onionshare/common.py delete mode 100644 onionshare/mode_settings.py delete mode 100644 onionshare/onion.py delete mode 100644 onionshare/onionshare.py delete mode 100644 onionshare/settings.py delete mode 100644 onionshare/strings.py delete mode 100644 onionshare/web/__init__.py delete mode 100644 onionshare/web/chat_mode.py delete mode 100644 onionshare/web/receive_mode.py delete mode 100644 onionshare/web/send_base_mode.py delete mode 100644 onionshare/web/share_mode.py delete mode 100644 onionshare/web/web.py delete mode 100644 onionshare/web/website_mode.py delete mode 100644 onionshare_gui/__init__.py delete mode 100644 onionshare_gui/gui_common.py delete mode 100644 onionshare_gui/main_window.py delete mode 100644 onionshare_gui/settings_dialog.py delete mode 100644 onionshare_gui/tab/__init__.py delete mode 100644 onionshare_gui/tab/mode/__init__.py delete mode 100644 onionshare_gui/tab/mode/chat_mode/__init__.py delete mode 100644 onionshare_gui/tab/mode/file_selection.py delete mode 100644 onionshare_gui/tab/mode/history.py delete mode 100644 onionshare_gui/tab/mode/mode_settings_widget.py delete mode 100644 onionshare_gui/tab/mode/receive_mode/__init__.py delete mode 100644 onionshare_gui/tab/mode/share_mode/__init__.py delete mode 100644 onionshare_gui/tab/mode/share_mode/threads.py delete mode 100644 onionshare_gui/tab/mode/website_mode/__init__.py delete mode 100644 onionshare_gui/tab/server_status.py delete mode 100644 onionshare_gui/tab/tab.py delete mode 100644 onionshare_gui/tab_widget.py delete mode 100644 onionshare_gui/threads.py delete mode 100644 onionshare_gui/tor_connection_dialog.py delete mode 100644 onionshare_gui/update_checker.py delete mode 100644 onionshare_gui/widgets.py delete mode 100644 poetry.lock delete mode 100644 pyproject.toml delete mode 100644 screenshots/appdata-onionshare-receive-client.png delete mode 100644 screenshots/appdata-onionshare-receive-server.png delete mode 100644 screenshots/appdata-onionshare-share-client.png delete mode 100644 screenshots/appdata-onionshare-share-server.png delete mode 100644 screenshots/onionshare-receive-client.png delete mode 100644 screenshots/onionshare-receive-server.png delete mode 100644 screenshots/onionshare-share-client.png delete mode 100644 screenshots/onionshare-share-server.png delete mode 100644 screenshots/onionshare-website-server.png delete mode 100644 setup.cfg delete mode 100644 setup.py delete mode 100644 share/images/close_tab.png delete mode 100644 share/images/file_delete.png delete mode 100644 share/images/history_completed.png delete mode 100644 share/images/history_completed_none.png delete mode 100644 share/images/history_in_progress.png delete mode 100644 share/images/history_in_progress_none.png delete mode 100644 share/images/history_requests.png delete mode 100644 share/images/history_requests_none.png delete mode 100644 share/images/info.png delete mode 100644 share/images/logo.png delete mode 100644 share/images/logo_grayscale.png delete mode 100644 share/images/logo_text.png delete mode 100644 share/images/logo_transparent.png delete mode 100644 share/images/mode_chat.png delete mode 100644 share/images/mode_chat.svg delete mode 100644 share/images/mode_new_tab_chat.png delete mode 100644 share/images/mode_new_tab_receive.png delete mode 100644 share/images/mode_new_tab_share.png delete mode 100644 share/images/mode_new_tab_website.png delete mode 100644 share/images/mode_receive.png delete mode 100644 share/images/mode_receive.svg delete mode 100644 share/images/mode_share.png delete mode 100644 share/images/mode_share.svg delete mode 100644 share/images/mode_website.png delete mode 100644 share/images/mode_website.svg delete mode 100644 share/images/open_folder.png delete mode 100644 share/images/persistent_enabled.png delete mode 100644 share/images/receive_icon_toggle.png delete mode 100644 share/images/receive_icon_toggle_selected.png delete mode 100644 share/images/receive_icon_transparent.png delete mode 100644 share/images/server_started.png delete mode 100644 share/images/server_stopped.png delete mode 100644 share/images/server_working.png delete mode 100644 share/images/settings.png delete mode 100644 share/images/share_icon_toggle.png delete mode 100644 share/images/share_icon_toggle_selected.png delete mode 100644 share/images/share_icon_transparent.png delete mode 100644 share/locale/af.json delete mode 100644 share/locale/am.json delete mode 100644 share/locale/ar.json delete mode 100644 share/locale/bg.json delete mode 100644 share/locale/bn.json delete mode 100644 share/locale/ca.json delete mode 100644 share/locale/cs.json delete mode 100644 share/locale/da.json delete mode 100644 share/locale/de.json delete mode 100644 share/locale/el.json delete mode 100644 share/locale/en.json delete mode 100644 share/locale/eo.json delete mode 100644 share/locale/es.json delete mode 100644 share/locale/fa.json delete mode 100644 share/locale/fi.json delete mode 100644 share/locale/fr.json delete mode 100644 share/locale/ga.json delete mode 100644 share/locale/gu.json delete mode 100644 share/locale/he.json delete mode 100644 share/locale/hi.json delete mode 100644 share/locale/hr.json delete mode 100644 share/locale/hu.json delete mode 100644 share/locale/id.json delete mode 100644 share/locale/is.json delete mode 100644 share/locale/it.json delete mode 100644 share/locale/ja.json delete mode 100644 share/locale/ka.json delete mode 100644 share/locale/km.json delete mode 100644 share/locale/ko.json delete mode 100644 share/locale/lg.json delete mode 100644 share/locale/lt.json delete mode 100644 share/locale/mk.json delete mode 100644 share/locale/ms.json delete mode 100644 share/locale/nb_NO.json delete mode 100644 share/locale/nl.json delete mode 100644 share/locale/pa.json delete mode 100644 share/locale/pl.json delete mode 100644 share/locale/pt_BR.json delete mode 100644 share/locale/pt_PT.json delete mode 100644 share/locale/ro.json delete mode 100644 share/locale/ru.json delete mode 100644 share/locale/sl.json delete mode 100644 share/locale/sn.json delete mode 100644 share/locale/sr_Latn.json delete mode 100644 share/locale/sv.json delete mode 100644 share/locale/sw.json delete mode 100644 share/locale/te.json delete mode 100644 share/locale/tr.json delete mode 100644 share/locale/uk.json delete mode 100644 share/locale/wo.json delete mode 100644 share/locale/yo.json delete mode 100644 share/locale/zh_Hans.json delete mode 100644 share/locale/zh_Hant.json delete mode 100644 share/static/css/style.css delete mode 100644 share/static/img/ajax.gif delete mode 100644 share/static/img/favicon.ico delete mode 100644 share/static/img/logo.png delete mode 100644 share/static/img/logo_large.png delete mode 100644 share/static/img/web_file.png delete mode 100644 share/static/img/web_folder.png delete mode 100644 share/static/js/chat.js delete mode 100644 share/static/js/jquery-3.5.1.min.js delete mode 100644 share/static/js/receive.js delete mode 100644 share/static/js/send.js delete mode 100644 share/static/js/socket.io.min.js delete mode 100644 share/templates/401.html delete mode 100644 share/templates/403.html delete mode 100644 share/templates/404.html delete mode 100644 share/templates/405.html delete mode 100644 share/templates/chat.html delete mode 100644 share/templates/denied.html delete mode 100644 share/templates/listing.html delete mode 100644 share/templates/receive.html delete mode 100644 share/templates/send.html delete mode 100644 share/templates/thankyou.html delete mode 100644 share/torrc_template delete mode 100644 share/torrc_template-meek_lite_amazon delete mode 100644 share/torrc_template-meek_lite_azure delete mode 100644 share/torrc_template-obfs4 delete mode 100644 share/version.txt delete mode 100644 share/wordlist.txt delete mode 100644 stdeb.cfg delete mode 100644 tests/__init__.py delete mode 100644 tests/conftest.py delete mode 100644 tests/gui_base_test.py delete mode 100644 tests/pytest.ini delete mode 100644 tests/run.bat delete mode 100755 tests/run.sh delete mode 100644 tests/test_cli.py delete mode 100644 tests/test_cli_common.py delete mode 100644 tests/test_cli_settings.py delete mode 100644 tests/test_cli_strings.py delete mode 100644 tests/test_cli_web.py delete mode 100644 tests/test_gui_receive.py delete mode 100644 tests/test_gui_share.py delete mode 100644 tests/test_gui_tabs.py delete mode 100644 tests/test_gui_website.py diff --git a/BUILD.md b/BUILD.md deleted file mode 100644 index 3baf200e..00000000 --- a/BUILD.md +++ /dev/null @@ -1,418 +0,0 @@ -# Index -* [Building OnionShare](#building-onionshare) - * [Linux](#linux) - * [Use newest software](#use-newest-software) - * [Use package managers](#use-package-managers) - * [macOS](#macos) - * [Windows](#windows) - * [Setting up your dev environment](#setting-up-your-dev-environment) - * [To make a .exe](#to-make-a-exe) - * [To build the installer](#to-build-the-installer) -* [Running tests](#running-tests) -* [Documentation] -* [Making releases](#making-releases) - * [Changelog, version, and signed git tag](#changelog-version-and-signed-git-tag) - * [Linux release](#linux-release) - * [macOS release](#macos-release) - * [Windows release](#windows-release) - * [Source package](#source-package) - * [Publishing the release](#publishing-the-release) - -# Building OnionShare - -Start by getting the source code: - -```sh -git clone https://github.com/micahflee/onionshare.git -cd onionshare -``` - -## Linux - -### Use newest software - -The recommended way to develop OnionShare is to use the latest versions of all dependencies. - -First, install `tor` and `obfs4proxy` from either the [official Debian repository](https://support.torproject.org/apt/tor-deb-repo/), or from your package manager. - -Then download Qt 5.14.0 for Linux: - -```sh -cd ~/Downloads -wget https://download.qt.io/official_releases/qt/5.14/5.14.0/qt-opensource-linux-x64-5.14.0.run -``` - -If you'd like to check to make sure you have the exact installer I have, here is the sha256 checksum: - -```sh -sha256sum qt-opensource-linux-x64-5.14.0.run -4379f147c6793ec7e7349d2f9ee7d53b8ab6ea4e4edf8ee0574a75586a6a6e0e qt-opensource-linux-x64-5.14.0.run -``` - -Then make it executable and install Qt: - -```sh -chmod +x qt-opensource-linux-x64-5.14.0.run -./qt-opensource-linux-x64-5.14.0.run -``` - -You have to create a Qt account and login to install Qt. Choose the default installation folder in your home directory. The only component you need is `Qt 5.14.0` > `Desktop gcc 64-bit`. - -Install [poetry](https://python-poetry.org/docs/) from your package manager, or by doing `pip install --user poetry`. Then install dependencies: - -```sh -poetry install -``` - -You can run the CLI and the GUI versions of OnionShare like this: - -```sh -poetry run ./dev_scripts/onionshare -poetry run ./dev_scripts/onionshare-gui -``` - -### Use package managers - -Alternatively, you can install dependencies from package managers. - -Install the needed dependencies: - -**For Debian-like distros:** - -``` -apt install -y python3-flask python3-stem python3-pyqt5 python3-crypto python3-socks python3-nautilus tor obfs4proxy python3-pytest python3-pytestqt build-essential fakeroot python3-all python3-stdeb dh-python python3-flask-httpauth python3-distutils python3-psutil python3-socketio python3-flask-socketio python3-qrcode -``` - -**For Fedora-like distros:** - -``` -dnf install -y python3-flask python3-flask-httpauth python3-stem python3-qt5 python3-crypto python3-pysocks nautilus-python tor obfs4 python3-pytest rpm-build python3-psutil python3-socketio python3-flask-socketio python3-qrcode -``` - -After that you can try both the CLI and the GUI version of OnionShare: - -```sh -./dev_scripts/onionshare -./dev_scripts/onionshare-gui -``` - -You can also build OnionShare packages to install: - -Create a .deb on Debian-like distros: `./install/build_deb.sh` - -Create a .rpm on Fedora-like distros: `./install/build_rpm.sh` - -For openSUSE: There are instructions for building [in the wiki](https://github.com/micahflee/onionshare/wiki/Linux-Distribution-Support#opensuse-leap-150). - -For ArchLinux: There is a PKBUILD available [here](https://www.archlinux.org/packages/community/any/onionshare/) that can be used to install OnionShare. - -If you find that these instructions don't work for your Linux distribution or version, consult the [Linux Distribution Support wiki guide](https://github.com/micahflee/onionshare/wiki/Linux-Distribution-Support), which might contain extra instructions. - -## macOS - -Install Xcode from the Mac App Store. Once it's installed, run it for the first time to set it up. Also, run this to make sure command line tools are installed: `xcode-select --install`. And finally, open Xcode, go to Preferences > Locations, and make sure under Command Line Tools you select an installed version from the dropdown. (This is required for installing Qt5.) - -Download and install Python 3.7.4 from https://www.python.org/downloads/release/python-374/. I downloaded `python-3.7.4-macosx10.9.pkg`. - -You may also need to run the command `/Applications/Python\ 3.7/Install\ Certificates.command` to update Python 3.6's internal certificate store. Otherwise, you may find that fetching the Tor Browser .dmg file fails later due to a certificate validation error. - -Install Qt 5.14.0 for macOS from https://www.qt.io/offline-installers. I downloaded `qt-opensource-mac-x64-5.14.0.dmg`. In the installer, you can skip making an account, and all you need is `Qt` > `Qt 5.14.0` > `macOS`. - -If you don't have it already, install poetry (`pip3 install --user poetry`). Then install dependencies: - -```sh -poetry install -``` - -#### You can run both the CLI and GUI versions of OnionShare without building an bundle - -```sh -poetry run ./dev_scripts/onionshare -poetry run ./dev_scripts/onionshare-gui -``` - -#### To build the app bundle - -```sh -install/build_osx.sh -``` - -Now you should have `dist/OnionShare.app`. - -#### To codesign and build a DMG for distribution - -If you want to build for distribution, you'll need a codesigning certificate, and you'll also need to have [create-dmg](https://github.com/sindresorhus/create-dmg) installed: - -```sh -npm install --global create-dmg -brew install graphicsmagick imagemagick -``` - -And then run: - -```sh -install/build_osx.sh --release -``` - -Now you should have `dist/OnionShare $VERSION.dmg`. - -## Windows - -### Setting up your dev environment - -These instructions include adding folders to the path in Windows. To do this, go to Start and type "advanced system settings", and open "View advanced system settings" in the Control Panel. Click Environment Variables. Under "System variables" double-click on Path. From there you can add and remove folders that are available in the PATH. - -Download Python 3.7.4, 32-bit (x86) from https://www.python.org/downloads/release/python-374/. I downloaded `python-3.7.4.exe`. When installing it, make sure to check the "Add Python 3.7 to PATH" checkbox on the first page of the installer. - -Install the Qt 5.14.0 from https://www.qt.io/offline-installers. I downloaded `qt-opensource-windows-x86-5.14.0.exe`. In the installer, you can skip making an account, and all you need `Qt` > `Qt 5.14.0` > `MSVC 2017 32-bit`. - -Install [poetry](https://python-poetry.org/). Open PowerShell, and run: - -``` -(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python -``` - -Then open a Command Prompt and cd to the `onionshare` folder, and install the poetry dependencies: - -``` -poetry install -``` - -After that you can try both the CLI and the GUI version of OnionShare: - -``` -poetry run python dev_scripts\onionshare -poetry run python dev_scripts\onionshare-gui -``` - -#### If you want to build a .exe - -Download and install 7-Zip from http://www.7-zip.org/download.html. I downloaded `7z1900.exe`. - -Download and install the standalone [Windows 10 SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk). Note that you may not need this if you already have Visual Studio. - -Add the following directories (you might want to make sure these are exact on your computer) to the path: - -* `C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x86` -* `C:\Program Files (x86)\Windows Kits\10\Redist\10.0.18362.0\ucrt\DLLs\x86` -* `C:\Program Files (x86)\7-Zip` - -And also for PyQt5, but replace `onionshare-i_zmdpLh-py3.7` with the name of your poetry virtual environment. You can find that by running `poetry env list`. - -* `C:\Users\user\AppData\Local\pypoetry\Cache\virtualenvs\onionshare-i_zmdpLh-py3.7\Lib\site-packages\PyQt5\Qt\bin` - -#### If you want the .exe to not get falsely flagged as malicious by anti-virus software - -OnionShare uses PyInstaller to turn the python source code into Windows executable `.exe` file. Apparently, malware developers also use PyInstaller, and some anti-virus vendors have included snippets of PyInstaller code in their virus definitions. To avoid this, you have to compile the Windows PyInstaller bootloader yourself instead of using the pre-compiled one that comes with PyInstaller. - -(If you don't care about this, you can install PyInstaller with `pip install PyInstaller==4.0`.) - -Here's how to compile the PyInstaller bootloader: - -Download and install [Microsoft Build Tools for Visual Studio 2019](https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2019). I downloaded `vs_buildtools__1285639570.1568593053.exe`. In the installer, check the box next to "Visual C++ build tools". Click "Individual components", and under "Compilers, build tools and runtimes", check "Windows Universal CRT SDK". Then click install. When installation is done, you may have to reboot your computer. - -Then, enable the 32-bit Visual C++ Toolset on the Command Line like this: - -``` -cd "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build" -vcvars32.bat -``` - -Change to a folder where you keep source code, and clone the PyInstaller git repo and checkout the `v4.0` tag: - -``` -git clone https://github.com/pyinstaller/pyinstaller.git -cd pyinstaller -git checkout v4.0 -``` - -The next step is to compile the bootloader. We should do this all in dangerzone's poetry shell: - -``` -cd onionshare -poetry shell -cd ..\pyinstaller -``` - -And compile the bootloader, following [these instructions](https://pythonhosted.org/PyInstaller/bootloader-building.html). To compile, run this: - -``` -cd bootloader -python waf distclean all --target-arch=32bit --msvc_targets=x86 -``` - -Finally, install the PyInstaller module into your poetry environment: - -``` -cd .. -python setup.py install -exit -``` - -Now the next time you use PyInstaller to build OnionShare, the `.exe` file should not be flagged as malicious by anti-virus. - -#### If you want to build the installer - -* Go to http://nsis.sourceforge.net/Download and download the latest NSIS. I downloaded `nsis-3.06.1-setup.exe`. -* Add `C:\Program Files (x86)\NSIS` to the path. - -#### If you want to sign binaries with Authenticode - -* You'll need a code signing certificate. I got an open source code signing certificate from [Certum](https://www.certum.eu/certum/cert,offer_en_open_source_cs.xml). -* Once you get a code signing key and certificate and covert it to a pfx file, import it into your certificate store. - -### To make a .exe: - -* Open a command prompt, cd into the onionshare directory, and type: `pyinstaller install\pyinstaller.spec`. `onionshare-gui.exe` and all of their supporting files will get created inside the `dist` folder. - -### To build the installer: - -Note that you must have a codesigning certificate installed in order to use the `install\build_exe.bat` script, because it codesigns `onionshare-gui.exe`, `uninstall.exe`, and `onionshare-setup.exe`. - -Open a command prompt, cd to the onionshare directory, and type: `install\build_exe.bat` - -This will prompt you to codesign three binaries and execute one unsigned binary. When you're done clicking through everything you will have `dist\onionshare-setup.exe`. - -# Running tests - -## Tests in macOS and Linux - -OnionShare includes PyTest unit tests. To run tests, you can run `pytest` against the `tests/` directory. - -```sh -poetry run ./tests/run.sh -``` - -You can run GUI tests like this: - -```sh -poetry run ./tests/run.sh --rungui -``` - -If you're using Linux, you can also choose to wrap the tests in `xvfb-run` so that a ton of OnionShare windows don't pop up on your desktop (you may need to install the `xorg-x11-server-Xvfb` package), like this: - -```sh -xvfb-run poetry run ./tests/run.sh --rungui -``` - -## Tests in Windows - -You can run this Windows batch script to run all of the CLI and GUI tests. - -``` -poetry run tests\run.bat -``` - -# Documentation - -To edit and build the documentation, see the [docs readme](/docs/README.md). - -# Making releases - -This section documents the release process. Unless you're a core OnionShare developer making a release, you'll probably never need to follow it. - -## Changelog, version, docs, and signed git tag - -Before making a release, you must update the version in these places: - -* `share/version.txt` should have the correct version -* `pyproject.toml` should have the correct version -* `docs/source/conf.py` should have the correct version -* `install/org.onionshare.OnionShare.appdata.xml` should have the correct version -* `install/onionshare.nsi` should have the correct version, for the Windows installer - -In addition to that, you must: - -* `install/org.onionshare.OnionShare.appdata.xml` should have the correct release date, and links to correct screenshots -* `CHANGELOG.md` should be updated to include a list of all major changes since the last release -* Update all of the documentation to cover new features, including taking new screenshots if necessary -* There must be a PGP-signed git tag for the version, e.g. for OnionShare 2.1, the tag must be `v2.1` - -The first step for the Linux, macOS, and Windows releases is the same: - -Verify the release git tag: - -``` -git fetch -git tag -v v$VERSION -``` - -If the tag verifies successfully, check it out: - -``` -git checkout v$VERSION -``` - -## Linux release - -TODO: Write Flatpak instructions (see [this issue](https://github.com/micahflee/onionshare/issues/910)). - -To make a PPA release: - -- Go to Ubuntu build machine, which must have `~/.dput.cf` with the correct PPA info in it, and with the correct PGP signing key -- Verify and checkout the git tag for this release -- Run `./install/ppa_release.sh`, which builds a source package and uploads to the PPA build server -- Login to Launchpad to monitor the build and make sure it is successful; if not, make minor patches and try the release again -- After build is successful, from Launchpad, copy the binary from `cosmic` into other suites - -## macOS release - -- Build machine should be running macOS 10.13.6, and must have the Apple-trusted `Developer ID Application: Micah Lee` and `Developer ID Installer: Micah Lee` code-signing certificates installed -- Verify and checkout the git tag for this release -- Run `poetry install && poetry run ./install/build_osx.sh --release`; this will make a codesigned installer package called `dist/OnionShare $VERSION.dmg` -- Notarize it: `xcrun altool --notarize-app --primary-bundle-id "com.micahflee.onionshare" -u "micah@micahflee.com" -p "$APPLEIDPW" --file "OnionShare $VERSION.dmg"` -- Wait for it to get approved, check status with: `xcrun altool --notarization-history 0 -u "micah@micahflee.com" -p "$APPLEIDPW"` -- After it's approved, staple the ticket: `xcrun stapler staple "OnionShare $VERSION.dmg"` -- PGP-sign the final, notarized and stapled, `gpg -a --detach-sign "OnionShare $VERSION.dmg"` - -This process ends up with two final files: - -``` -OnionShare $VERSION.dmg -OnionShare $VERSION.dmg.asc -``` - -## Windows release - -To make a Windows release, go to Windows build machine: - -- Build machine should be running Windows 10, and have the Windows codesigning certificate installed -- Verify and checkout the git tag for this release -- Run `install\build_exe.bat`; this will make a codesigned installer package called `dist\onionshare-$VERSION-setup.exe` -- Copy `onionshare-$VERSION-setup.exe` to developer machine - -Then move back to the developer machine: - -- PGP-sign the Windows installer, `gpg -a --detach-sign onionshare-$VERSION-setup.exe` - -This process ends up with two final files: - -``` -onionshare-$VERSION-setup.exe -onionshare-$VERSION-setup.exe.asc -``` - -## Source package - -To make a source package, run `./install/build_source.sh $TAG`, where `$TAG` is the the name of the signed git tag, e.g. `v2.1`. - -This process ends up with two final files in `dist`: - -``` -onionshare-$VERSION.tar.gz -onionshare-$VERSION.tar.gz.asc -``` - -## Publishing the release - -To publish the release: - -- Create a new release on GitHub, put the changelog in the description of the release, and upload all six files (the macOS installer, the Windows installer, the source package, and their signatures) -- Upload the six release files to https://onionshare.org/dist/$VERSION/ -- Copy the six release files into the OnionShare team Keybase filesystem -- Update the [onionshare-website](https://github.com/micahflee/onionshare-website) repo: - - Edit `latest-version.txt` to match the latest version - - Update the version number and download links - - Deploy to https://onionshare.org/ -- Email the [onionshare-dev](https://lists.riseup.net/www/subscribe/onionshare-dev) mailing list announcing the release -- Make a PR to [homebrew-cask](https://github.com/homebrew/homebrew-cask) to update the macOS version diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 272f8efc..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,233 +0,0 @@ -# OnionShare Changelog - -## 2.3 - -* Major new feature: Multiple tabs, including better support for persistent services, faster Tor connections -* New feature: Chat anonymously mode -* New feature: All new design -* New feature: Ability to display QR codes of OnionShare addresses -* New feature: Web apps have responsive design and look better on mobile -* New feature: Flatpak packaging for Linux -* Several bug fixes - -## 2.2 - -* New feature: Website mode, which allows publishing a static HTML website as an onion service -* Allow individual files to be viewed or downloaded in Share mode, including the ability to browse into subdirectories and use breadcrumbs to navigate back -* Show a counter when individual files or pages are viewed -* Better History items including colors and status codes to differentiate between successful and failed requests -* Swap out the random /slug suffix for HTTP basic authentication (when in non-public mode) -* Hide the Tor connection settings if the ONIONSHARE_HIDE_TOR_SETTINGS environment variable is set (Tails compatibility) -* Remove the NoScript XSS warning in Receive Mode now that the NoScript/Tor Browser bug is fixed. The ajax upload method still exists when javascript is enabled. -* Better support for DragonFly BSD -* Updated various dependencies, including Flask, Werkzeug, urllib3, requests, and PyQt5 -* Updated Tor to 0.4.1.5 -* Other minor bug fixes -* New translations: - * Arabic (العربية) - * Dutch (Nederlands) - * Persian (فارسی) - * Romanian (Română) - * Serbian latin (Srpska (latinica)) -* Removed translations with fewer than 90% of strings translated: - * Finnish (Suomi) - -## 2.1 - -* New feature: Auto-start timer, which allows scheduling when the server starts -* Renamed CLI argument --debug to --verbose -* Make Tor connection timeout configurable as a CLI argument -* Updated various dependencies, including fixing third-party security issues in urllib3, Jinja2, and jQuery -* Updated Tor to 0.3.5.8 -* New translations: - * Traditional Chinese (正體中文 (繁體)), - * Simplified Chinese (中文 (简体)) - * Finnish (Suomi) - * German (Deutsch) - * Icelandic (Íslenska) - * Irish (Gaeilge) - * Norwegian Bokmål (Norsk bokmål) - * Polish (Polski) - * Portuguese Portugal (Português (Portugal)) - * Telugu (తెలుగు) - * Turkish (Türkçe) - * Ukrainian (Українська) -* Removed translations with fewer than 90% of strings translated: - * Bengali (বাংলা) - * Persian (فارسی) - -## 2.0 - -* New feature: Receiver mode allows you to receive files with OnionShare, instead of only sending files -* New feature: Support for next generation onion services -* New feature: macOS sandbox is enabled -* New feature: Public mode feature, for public uses of OnionShare, which when enabled turns off slugs in the URL and removes the limit on how many 404 requests can be made -* New feature: If you're sharing a single file, don't zip it up -* New feature: Full support for meek_lite (Azure) bridges -* New feature: Allow selecting your language from a dropdown -* New translations: Bengali (বাংলা), Catalan (Català), Danish (Dansk), French (Français), Greek (Ελληνικά), Italian (Italiano), Japanese (日本語), Persian (فارسی), Portuguese Brazil (Português Brasil), Russian (Русский), Spanish (Español), Swedish (Svenska) -* Several bugfixes -* Invisible to users, this version includes some major refactoring of the codebase, and a robust set of unit tests which makes OnionShare easier to maintain going forward - -## 1.3.2 - -* Bugfix: In debug mode, stop saving flask debug log in /tmp, where all users can access it - -## 1.3.1 - -* Updated Tor to 0.2.3.10 -* Windows and Mac binaries are now distributed with licenses for Tor and obfs4 - -## 1.3 - -* Major UI redesign, introducing many UX improvements -* Client-side web interfact redesigned -* New feature: Support for meek_lite pluggable transports (Amazon and Azure) - not yet ready for Windows or macOS, sorry -* New feature: Support for custom obfs4 and meek_lite bridges (again, meek_lite not available on Windows/macOS yet) -* New feature: Ability to cancel share before it starts -* Bugfix: The UpdateChecker no longer blocks the UI when checking -* Bugfix: Simultaneous downloads (broken in 1.2) -* Updated Tor to 0.2.3.9 -* Improved support for BSD -* Updated French and Danish translations -* Minor build script and build documentation fixes -* Flake8 tests added - -## 1.2 - -* New feature: Support for Tor bridges, including obfs4proxy -* New feature: Ability to use a persistent URL -* New feature: Auto-stop timer, to stop OnionShare at a specified time -* New feature: Get notification when Tor connection dies -* Updated versions of Python, Qt, Tor, and other dependencies that are bundled -* Added ability to supply a custom settings file as a command line arg -* Added support for FreeBSD -* Fixed small user interface issues -* Fixed minor bugs -* New Dutch translations - -## 1.1 - -* OnionShare connects to Tor itself now, so opening Tor Browser in the background isn't required -* In Windows and macOS, OnionShare alerts users about updates -* Removed the menu bar, and adding a "Settings" button -* Added desktop notifications, and a system tray icon -* Ability to add multiple files and folders with a single "Add" button -* Ability to delete multiple files and folders at once with the "Delete" button -* Hardened some response headers sent from the web server -* Minor clarity improvements to the contents of the share's web page -* Alert the user rather than share an empty archive if a file was unreadable -* Prettier progress bars - -## 1.0 - -* Fixed long-standing macOS X bug that caused OnionShare to crash on older Macs (!) -* Added settings dialog to configure connecting to Tor, including support for system Tor -* Added support for stealth onion services (advanced option) -* Added support for Whonix -* Improved AppArmor profiles -* Added progress bar for zipping up files -* Improved the look of download progress bars -* Allows developers to launch OnionShare from source tree, without building a package -* Deleted legacy code, and made OnionShare purely use ephemeral Tor onion services -* Switched to EFF's diceware wordlist for slugs - -## 0.9.2 (Linux only) - -* Looks for `TOR_CONTROL_PORT` environment variable, to help Tails integration -* Change how OnionShare checks to see if it's installed system-wide, to help Subgraph OS integration - -## 0.9.1 - -* Added Nautilus extension, so you can right-click on a file and choose "Share via OnionShare", thanks to Subgraph developers -* Switch to using the term "onion service" rather than "hidden service" -* Fix CVE-2016-5026, minor security issue related to use of /tmp directory -* Switch from PyInstaller to cx_Freeze for Windows and OSX packaging -* Support CLI in Windows and OSX - -## 0.9 - -* Slugs are now shorter and human-readable, with rate limiting to prevent URL guessing -* Uses a new slug each time the server restarts -* "Stop sharing automatically" enforces only one download -* Users get asked if they're sure they want to close OnionShare while server is running -* Added estimated time remaining progress indicator -* Fixed frozen window while waiting for hidden service to start -* Displays version number in both GUI and CLI -* Closing window causes downloads to stop immediately -* Web server listens in ports 17600-17650, for future Tails support -* Updated translations -* Ported from Python 2 to Python 3 and from Qt4 to Qt5 -* Ported from py2app and py2exe to PyInstaller - -## 0.8.1 - -* Fixed crash in Windows 7 -* Fixed crash related to non-ephemeral hidden services in Linux -* Fixed minor bugs - -## 0.8 - -* Add support for ephemeral hidden services -* Stopped leaking sender's locale on download page -* Add support for Tor Messenger as provider of Tor service -* Minor bugfixes, code cleanup, and refactoring - -## 0.7.1 - -* Fixed critical bug in OS X binaries that caused crashes on some computers -* Added Security Design document -* Minor bugfix with Windows code signing timestamp server -* Linux version uses HS dir that is allowed by Tor Browser Launcher's AppArmor profiles - -## 0.7 - -* Added code signing for Mac OS X -* Does not disable existing hidden services -* Uses allowZip64 to allow compressing files >5gb -* Sets HS dir to be in /var/lib/tor in Tails, to obey AppArmor rules -* Misc. minor code cleanup - -## 0.6 - -* Brand new drag-and-drop GUI with ability to start and stop server -* Much cleaner code split into several files -* Support for sharing multiple files and folders at once, and automatically compresses files before sharing -* Redesigned receiver HTML interface -* Waits for hidden service to be available before displaying URL -* Cleans up hidden service directory on exit -* Continuous integration with Travis -* Support for multiple downloads at once -* Fixed unicode-related filename and display bugs -* Warns that large files could take hours to send -* New translations -* Several misc. bugfixes -* Added code signing for Windows with Authenticode - -## 0.5 - -* Removed webkit GUI altogether, and refactored GUI with native Qt widget -* In Tails, launches separate process as root for Tor control port and firewall stuff, everything else runs as amnesia -* Fixed itsdangerous dependency bug in Debian Wheezy and Tails -* Guesses content type of file, responds in HTTP header - -## 0.4 - -* Fixed critical XSS bug that could deanonymize user: https://micahflee.com/2014/07/security-advisory-upgrade-to-onionshare-0-4-immediately/ -* Added CSP headers in GUI to prevent any future XSS bugs from working -* Hash urandom data before using it, to avoid leaking state of entropy -* Constant time compare the slug to avoid timing attacks -* Cleaned up Tails firewall code - -## 0.3 - -* Built a simple, featureful cross-platform GUI -* Graphical installers for Windows and OSX -* Packaged for Linux in .deb, .rpm, with desktop launcher -* Installable in Tails 1.1+, with simple "install" script -* Automatically copies URL to clipboard -* Automatically closes when download is done by default -* Shows download progress -* Limited suite of tests -* If a localized string doesn't exist, falls back to English -* New translations: Dutch, Portuguese, German, Russian, and updated translations: Norwegian Bokmål, Spanish, French, Italian diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 5a3a9871..00000000 --- a/LICENSE +++ /dev/null @@ -1,679 +0,0 @@ -(Note: Third-party licenses can be found under install/licenses/.) - -OnionShare -Copyright (C) 2014-2020 Micah Lee, et al. - - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 7dd8a881..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,13 +0,0 @@ -include LICENSE -include README.md -include BUILD.md -include share/* -include share/images/* -include share/locale/* -include share/templates/* -include share/static/* -include install/org.onionshare.OnionShare.desktop -include install/org.onionshare.OnionShare.appdata.xml -include install/org.onionshare.OnionShare.svg -include install/scripts/onionshare-nautilus.py -include tests/*.py diff --git a/README.md b/README.md index 57a835be..274d6d93 100644 --- a/README.md +++ b/README.md @@ -22,4 +22,4 @@ To learn how OnionShare works, what its security properties are, how to use it, --- -Test status: [![CircleCI](https://circleci.com/gh/micahflee/onionshare.svg?style=svg)](https://circleci.com/gh/micahflee/onionshare) +Test status: [![CircleCI](https://circleci.com/gh/micahflee/onionshare.svg?style=svg)](https://circleci.com/gh/micahflee/onionshare) \ No newline at end of file diff --git a/apparmor/abstractions/onionshare b/apparmor/abstractions/onionshare deleted file mode 100644 index fa94e68d..00000000 --- a/apparmor/abstractions/onionshare +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include -#include -#include - -# Why are these not in abstractions/python? -/usr/lib{,32,64}/python{2,3}.[0-9]/__pycache__/ rw, -/usr/lib{,32,64}/python{2,3}.[0-9]/__pycache__/* rw, -/usr/lib{,32,64}/python{2,3}.[0-9]/**/__pycache__/ rw, -/usr/lib{,32,64}/python{2,3}.[0-9]/**/__pycache__/* rw, -/usr/lib{,32,64}/python{2,3}/**/__pycache__/ rw, -/usr/lib{,32,64}/python{2,3}/**/__pycache__/* rw, - -/bin/dash rix, -/proc/*/mounts r, -/proc/*/fd/ r, -/sbin/ldconfig rix, -/sbin/ldconfig.real rix, -/bin/uname rix, -/etc/mime.types r, -/usr/share/onionshare/ r, -/usr/share/onionshare/** r, -/tmp/ rw, -/tmp/** rw, - -# Allow read on almost anything in @{HOME}. Lenient, but -# private-files-strict is in effect. -owner @{HOME}/ r, -owner @{HOME}/[^.]** r, diff --git a/apparmor/local/usr.bin.onionshare b/apparmor/local/usr.bin.onionshare deleted file mode 100644 index 6453771d..00000000 --- a/apparmor/local/usr.bin.onionshare +++ /dev/null @@ -1,2 +0,0 @@ -# Site-specific additions and overrides for usr.bin.onionshare. -# For more details, please see /etc/apparmor.d/local/README. diff --git a/apparmor/local/usr.bin.onionshare-gui b/apparmor/local/usr.bin.onionshare-gui deleted file mode 100644 index fa5ba3f0..00000000 --- a/apparmor/local/usr.bin.onionshare-gui +++ /dev/null @@ -1,2 +0,0 @@ -# Site-specific additions and overrides for usr.bin.onionshare-gui. -# For more details, please see /etc/apparmor.d/local/README. diff --git a/apparmor/usr.bin.onionshare b/apparmor/usr.bin.onionshare deleted file mode 100644 index 1c14ccc1..00000000 --- a/apparmor/usr.bin.onionshare +++ /dev/null @@ -1,10 +0,0 @@ -#include - -/usr/bin/onionshare { - #include - - /usr/bin/ r, - /usr/bin/onionshare r, - - #include -} diff --git a/apparmor/usr.bin.onionshare-gui b/apparmor/usr.bin.onionshare-gui deleted file mode 100644 index 746dadc1..00000000 --- a/apparmor/usr.bin.onionshare-gui +++ /dev/null @@ -1,28 +0,0 @@ -#include - -/usr/bin/onionshare-gui { - #include - #include - #include - - /usr/bin/ r, - /usr/bin/onionshare-gui r, - /proc/*/cmdline r, - - # The freedesktop.org abstraction doesn't allow `k` - /usr/share/icons/*/index.theme k, - - # Why do these still emit audit journal entries? - owner @{HOME}/.config/ibus/bus/ rw, - owner @{HOME}/.config/ibus/bus/* rw, - deny @{HOME}/.ICEauthority r, - - deny /etc/machine-id r, - deny /var/lib/dbus/machine-id.* rw, - - # Accessibility support - owner /{,var/}run/user/*/at-spi2-*/ rw, - owner /{,var/}run/user/*/at-spi2-*/** rw, - - #include -} diff --git a/cli/.circleci/config.yml b/cli/.circleci/config.yml new file mode 100644 index 00000000..70d16fea --- /dev/null +++ b/cli/.circleci/config.yml @@ -0,0 +1,38 @@ +version: 2 +workflows: + version: 2 + test: + jobs: + - test-3.6 + - test-3.7 + - test-3.8 + +jobs: + test-3.6: &test-template + docker: + - image: circleci/python:3.6-buster + + working_directory: ~/repo + + steps: + - checkout + + - run: + name: Install dependencies + command: | + poetry install + + - run: + name: Run unit tests + command: | + poetry run pytest -vvv ./tests + + test-3.7: + <<: *test-template + docker: + - image: circleci/python:3.7-buster + + test-3.8: + <<: *test-template + docker: + - image: circleci/python:3.8-buster diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md new file mode 100644 index 00000000..cfb959c9 --- /dev/null +++ b/cli/CHANGELOG.md @@ -0,0 +1,3 @@ +# OnionShare CLI Changelog + +Coming soon. \ No newline at end of file diff --git a/cli/LICENSE b/cli/LICENSE new file mode 100644 index 00000000..5a3a9871 --- /dev/null +++ b/cli/LICENSE @@ -0,0 +1,679 @@ +(Note: Third-party licenses can be found under install/licenses/.) + +OnionShare +Copyright (C) 2014-2020 Micah Lee, et al. + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/cli/README.md b/cli/README.md new file mode 100644 index 00000000..cd3cf80b --- /dev/null +++ b/cli/README.md @@ -0,0 +1,87 @@ +``` + @@@@@@@@@ + @@@@@@@@@@@@@@@@@@@ + @@@@@@@@@@@@@@@@@@@@@@@@@ + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ___ _ + @@@@@@ @@@@@@@@@@@@@ / _ \ (_) + @@@@ @ @@@@@@@@@@@ | | | |_ __ _ ___ _ __ + @@@@@@@@ @@@@@@@@@@ | | | | '_ \| |/ _ \| '_ \ + @@@@@@@@@@@@ @@@@@@@@@@ \ \_/ / | | | | (_) | | | | + @@@@@@@@@@@@@@@@ @@@@@@@@@ \___/|_| |_|_|\___/|_| |_| + @@@@@@@@@ @@@@@@@@@@@@@@@@ _____ _ + @@@@@@@@@@ @@@@@@@@@@@@ / ___| | + @@@@@@@@@@ @@@@@@@@ \ `--.| |__ __ _ _ __ ___ + @@@@@@@@@@@ @ @@@@ `--. \ '_ \ / _` | '__/ _ \ + @@@@@@@@@@@@@ @@@@@@ /\__/ / | | | (_| | | | __/ + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@ \____/|_| |_|\__,_|_| \___| + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + @@@@@@@@@@@@@@@@@@@@@@@@@ + @@@@@@@@@@@@@@@@@@@ + @@@@@@@@@ +``` + +# OnionShare CLI + +_This project is under development and not ready for use._ + +OnionShare is an open source tool that lets you securely and anonymously share files, host websites, and chat with friends using the Tor network. + +This is the command line version of OnionShare. [Click here](https://github.com/micahflee/onionshare) for the graphical version. + +## Installing OnionShare CLI + +First, make sure you have `tor` installed. In Linux, install it through your package manager. In macOS, install it with [Homebrew](https://brew.sh): `brew install tor`. + +Then install OnionShare CLI: + +``` +pip install onionshare-cli +``` + +Then run it with: + +``` +onionshare-cli --help +``` + +## Developing OnionShare CLI + +You must have python3 and [poetry](https://python-poetry.org/) installed. + +Install dependencies with poetry: + +``` +poetry install +``` + +To run from the source tree: + +``` +poetry run onionshare-cli +``` + +To run tests: + +``` +poetry run pytest -vvv ./tests +``` + +### Making a release + +Before making a release, make update the version in these places: + +- `pyproject.toml` +- `onionshare_cli/resources/version.txt` + +And edit `CHANGELOG.md` to include a list of all major changes since the last release. + +Create a PGP-signed git tag. For example for OnionShare CLI 0.1.0, the tag must be `v0.1.0`. + +Build and publish to PyPi: + +``` +poetry publish --build +``` + +Test status: [![CircleCI](https://circleci.com/gh/micahflee/onionshare-cli.svg?style=svg)](https://circleci.com/gh/micahflee/onionshare-cli) \ No newline at end of file diff --git a/cli/onionshare_cli/__init__.py b/cli/onionshare_cli/__init__.py new file mode 100644 index 00000000..c1367b1e --- /dev/null +++ b/cli/onionshare_cli/__init__.py @@ -0,0 +1,514 @@ +# -*- coding: utf-8 -*- +""" +OnionShare | https://onionshare.org/ + +Copyright (C) 2014-2020 Micah Lee, et al. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +""" + +import os, sys, time, argparse, threading +from datetime import datetime +from datetime import timedelta + +from .common import Common +from .web import Web +from .onion import * +from .onionshare import OnionShare +from .mode_settings import ModeSettings + + +def build_url(mode_settings, app, web): + # Build the URL + if mode_settings.get("general", "public"): + return f"http://{app.onion_host}" + else: + return f"http://onionshare:{web.password}@{app.onion_host}" + + +def main(cwd=None): + """ + The main() function implements all of the logic that the command-line version of + onionshare uses. + """ + common = Common() + + # Display OnionShare banner + print(f"OnionShare {common.version} | https://onionshare.org/") + reset = "\033[0m" + purple = "\33[95m" + print(purple) + print(" @@@@@@@@@ ") + print(" @@@@@@@@@@@@@@@@@@@ ") + print(" @@@@@@@@@@@@@@@@@@@@@@@@@ ") + print(" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ") + print( + " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ___ _ " + ) + print( + " @@@@@@ @@@@@@@@@@@@@ / _ \ (_) " + ) + print( + " @@@@ @ @@@@@@@@@@@ | | | |_ __ _ ___ _ __ " + ) + print( + " @@@@@@@@ @@@@@@@@@@ | | | | '_ \| |/ _ \| '_ \ " + ) + print( + " @@@@@@@@@@@@ @@@@@@@@@@ \ \_/ / | | | | (_) | | | | " + ) + print( + " @@@@@@@@@@@@@@@@ @@@@@@@@@ \___/|_| |_|_|\___/|_| |_| " + ) + print( + " @@@@@@@@@ @@@@@@@@@@@@@@@@ _____ _ " + ) + print( + " @@@@@@@@@@ @@@@@@@@@@@@ / ___| | " + ) + print( + " @@@@@@@@@@ @@@@@@@@ \ `--.| |__ __ _ _ __ ___ " + ) + print( + " @@@@@@@@@@@ @ @@@@ `--. \ '_ \ / _` | '__/ _ \\" + ) + print( + " @@@@@@@@@@@@@ @@@@@@ /\__/ / | | | (_| | | | __/" + ) + print( + " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@ \____/|_| |_|\__,_|_| \___|" + ) + print(" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ") + print(" @@@@@@@@@@@@@@@@@@@@@@@@@ ") + print(" @@@@@@@@@@@@@@@@@@@ ") + print(" @@@@@@@@@ ") + print(reset) + + # OnionShare CLI in OSX needs to change current working directory (#132) + if common.platform == "Darwin": + if cwd: + os.chdir(cwd) + + # Parse arguments + parser = argparse.ArgumentParser( + formatter_class=lambda prog: argparse.HelpFormatter(prog, max_help_position=28) + ) + # Select modes + parser.add_argument( + "--receive", action="store_true", dest="receive", help="Receive files" + ) + parser.add_argument( + "--website", action="store_true", dest="website", help="Publish website" + ) + parser.add_argument( + "--chat", action="store_true", dest="chat", help="Start chat server" + ) + # Tor connection-related args + parser.add_argument( + "--local-only", + action="store_true", + dest="local_only", + default=False, + help="Don't use Tor (only for development)", + ) + parser.add_argument( + "--connect-timeout", + metavar="SECONDS", + dest="connect_timeout", + default=120, + help="Give up connecting to Tor after a given amount of seconds (default: 120)", + ) + parser.add_argument( + "--config", + metavar="FILENAME", + default=None, + help="Filename of custom global settings", + ) + # Persistent file + parser.add_argument( + "--persistent", + metavar="FILENAME", + default=None, + help="Filename of persistent session", + ) + # General args + parser.add_argument( + "--public", + action="store_true", + dest="public", + default=False, + help="Don't use a password", + ) + parser.add_argument( + "--auto-start-timer", + metavar="SECONDS", + dest="autostart_timer", + default=0, + help="Start onion service at scheduled time (N seconds from now)", + ) + parser.add_argument( + "--auto-stop-timer", + metavar="SECONDS", + dest="autostop_timer", + default=0, + help="Stop onion service at schedule time (N seconds from now)", + ) + parser.add_argument( + "--legacy", + action="store_true", + dest="legacy", + default=False, + help="Use legacy address (v2 onion service, not recommended)", + ) + parser.add_argument( + "--client-auth", + action="store_true", + dest="client_auth", + default=False, + help="Use client authorization (requires --legacy)", + ) + # Share args + parser.add_argument( + "--autostop-sharing", + action="store_true", + dest="autostop_sharing", + default=True, + help="Share files: Stop sharing after files have been sent", + ) + # Receive args + parser.add_argument( + "--data-dir", + metavar="data_dir", + default=None, + help="Receive files: Save files received to this directory", + ) + # Website args + parser.add_argument( + "--disable_csp", + action="store_true", + dest="disable_csp", + default=False, + help="Publish website: Disable Content Security Policy header (allows your website to use third-party resources)", + ) + # Other + parser.add_argument( + "-v", + "--verbose", + action="store_true", + dest="verbose", + help="Log OnionShare errors to stdout, and web errors to disk", + ) + parser.add_argument( + "filename", + metavar="filename", + nargs="*", + help="List of files or folders to share", + ) + args = parser.parse_args() + + filenames = args.filename + for i in range(len(filenames)): + filenames[i] = os.path.abspath(filenames[i]) + + receive = bool(args.receive) + website = bool(args.website) + chat = bool(args.chat) + local_only = bool(args.local_only) + connect_timeout = int(args.connect_timeout) + config_filename = args.config + persistent_filename = args.persistent + public = bool(args.public) + autostart_timer = int(args.autostart_timer) + autostop_timer = int(args.autostop_timer) + legacy = bool(args.legacy) + client_auth = bool(args.client_auth) + autostop_sharing = bool(args.autostop_sharing) + data_dir = args.data_dir + disable_csp = bool(args.disable_csp) + verbose = bool(args.verbose) + + if receive: + mode = "receive" + elif website: + mode = "website" + elif chat: + mode = "chat" + else: + mode = "share" + + # Verbose mode? + common.verbose = verbose + + # client_auth can only be set if legacy is also set + if client_auth and not legacy: + print( + "Client authentication (--client-auth) is only supported with with legacy onion services (--legacy)" + ) + sys.exit() + + # Re-load settings, if a custom config was passed in + if config_filename: + common.load_settings(config_filename) + else: + common.load_settings() + + # Mode settings + if persistent_filename: + mode_settings = ModeSettings(common, persistent_filename) + mode_settings.set("persistent", "enabled", True) + else: + mode_settings = ModeSettings(common) + + if mode_settings.just_created: + # This means the mode settings were just created, not loaded from disk + mode_settings.set("general", "public", public) + mode_settings.set("general", "autostart_timer", autostart_timer) + mode_settings.set("general", "autostop_timer", autostop_timer) + mode_settings.set("general", "legacy", legacy) + mode_settings.set("general", "client_auth", client_auth) + if mode == "share": + mode_settings.set("share", "autostop_sharing", autostop_sharing) + if mode == "receive": + if data_dir: + mode_settings.set("receive", "data_dir", data_dir) + if mode == "website": + mode_settings.set("website", "disable_csp", disable_csp) + else: + # See what the persistent mode was + mode = mode_settings.get("persistent", "mode") + + # In share and website mode, you must supply a list of filenames + if mode == "share" or mode == "website": + # Unless you passed in a persistent filename, in which case get the filenames from + # the mode settings + if persistent_filename and not mode_settings.just_created: + filenames = mode_settings.get(mode, "filenames") + + else: + # Make sure filenames given if not using receiver mode + if len(filenames) == 0: + if persistent_filename: + mode_settings.delete() + + parser.print_help() + sys.exit() + + # Validate filenames + valid = True + for filename in filenames: + if not os.path.isfile(filename) and not os.path.isdir(filename): + print(f"{filename} is not a valid file.") + valid = False + if not os.access(filename, os.R_OK): + print(f"{filename} is not a readable file.") + valid = False + if not valid: + sys.exit() + + # Create the Web object + web = Web(common, False, mode_settings, mode) + + # Start the Onion object + onion = Onion(common, use_tmp_dir=True) + try: + onion.connect( + custom_settings=False, + config=config_filename, + connect_timeout=connect_timeout, + local_only=local_only, + ) + except KeyboardInterrupt: + print("") + sys.exit() + except Exception as e: + sys.exit(e.args[0]) + + # Start the onionshare app + try: + common.settings.load() + if not mode_settings.get("general", "public"): + web.generate_password(mode_settings.get("onion", "password")) + else: + web.password = None + app = OnionShare(common, onion, local_only, autostop_timer) + app.choose_port() + + # Delay the startup if a startup timer was set + if autostart_timer > 0: + # Can't set a schedule that is later than the auto-stop timer + if autostop_timer > 0 and autostop_timer < autostart_timer: + print( + "The auto-stop time can't be the same or earlier than the auto-start time. Please update it to start sharing." + ) + sys.exit() + + app.start_onion_service(mode_settings, False, True) + url = build_url(mode_settings, app, web) + schedule = datetime.now() + timedelta(seconds=autostart_timer) + if mode == "receive": + print( + f"Files sent to you appear in this folder: {mode_settings.get('receive', 'data_dir')}" + ) + print("") + print( + "Warning: Receive mode lets people upload files to your computer. 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." + ) + print("") + if mode_settings.get("general", "client_auth"): + print( + f"Give this address and HidServAuth lineto your sender, and tell them it won't be accessible until: {schedule.strftime('%I:%M:%S%p, %b %d, %y')}" + ) + print(app.auth_string) + else: + print( + f"Give this address to your sender, and tell them it won't be accessible until: {schedule.strftime('%I:%M:%S%p, %b %d, %y')}" + ) + else: + if mode_settings.get("general", "client_auth"): + print( + f"Give this address and HidServAuth line to your recipient, and tell them it won't be accessible until: {schedule.strftime('%I:%M:%S%p, %b %d, %y')}" + ) + print(app.auth_string) + else: + print( + f"Give this address to your recipient, and tell them it won't be accessible until: {schedule.strftime('%I:%M:%S%p, %b %d, %y')}" + ) + print(url) + print("") + print("Waiting for the scheduled time before starting...") + app.onion.cleanup(False) + time.sleep(autostart_timer) + app.start_onion_service(mode_settings) + else: + app.start_onion_service(mode_settings) + except KeyboardInterrupt: + print("") + sys.exit() + except (TorTooOld, TorErrorProtocolError) as e: + print("") + print(e.args[0]) + sys.exit() + + if mode == "website": + # Prepare files to share + try: + web.website_mode.set_file_info(filenames) + except OSError as e: + print(e.strerror) + sys.exit(1) + + if mode == "share": + # Prepare files to share + print("Compressing files.") + try: + web.share_mode.set_file_info(filenames) + app.cleanup_filenames += web.share_mode.cleanup_filenames + except OSError as e: + print(e.strerror) + sys.exit(1) + + # Warn about sending large files over Tor + if web.share_mode.download_filesize >= 157286400: # 150mb + print("") + print("Warning: Sending a large share could take hours") + print("") + + # Start OnionShare http service in new thread + t = threading.Thread(target=web.start, args=(app.port,)) + t.daemon = True + t.start() + + try: # Trap Ctrl-C + # Wait for web.generate_password() to finish running + time.sleep(0.2) + + # start auto-stop timer thread + if app.autostop_timer > 0: + app.autostop_timer_thread.start() + + # Save the web password if we are using a persistent private key + if mode_settings.get("persistent", "enabled"): + if not mode_settings.get("onion", "password"): + mode_settings.set("onion", "password", web.password) + # mode_settings.save() + + # Build the URL + url = build_url(mode_settings, app, web) + + print("") + if autostart_timer > 0: + print("Server started") + else: + if mode == "receive": + print( + f"Files sent to you appear in this folder: {mode_settings.get('receive', 'data_dir')}" + ) + print("") + print( + "Warning: Receive mode lets people upload files to your computer. 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." + ) + print("") + + if mode_settings.get("general", "client_auth"): + print("Give this address and HidServAuth to the sender:") + print(url) + print(app.auth_string) + else: + print("Give this address to the sender:") + print(url) + else: + if mode_settings.get("general", "client_auth"): + print("Give this address and HidServAuth line to the recipient:") + print(url) + print(app.auth_string) + else: + print("Give this address to the recipient:") + print(url) + print("") + print("Press Ctrl+C to stop the server") + + # Wait for app to close + while t.is_alive(): + if app.autostop_timer > 0: + # if the auto-stop timer was set and has run out, stop the server + if not app.autostop_timer_thread.is_alive(): + if mode == "share" or (mode == "website"): + # If there were no attempts to download the share, or all downloads are done, we can stop + if web.share_mode.cur_history_id == 0 or web.done: + print("Stopped because auto-stop timer ran out") + web.stop(app.port) + break + if mode == "receive": + if ( + web.receive_mode.cur_history_id == 0 + or not web.receive_mode.uploads_in_progress + ): + print("Stopped because auto-stop timer ran out") + web.stop(app.port) + break + else: + web.receive_mode.can_upload = False + # Allow KeyboardInterrupt exception to be handled with threads + # https://stackoverflow.com/questions/3788208/python-threading-ignores-keyboardinterrupt-exception + time.sleep(0.2) + except KeyboardInterrupt: + web.stop(app.port) + finally: + # Shutdown + app.cleanup() + onion.cleanup() + + +if __name__ == "__main__": + main() diff --git a/cli/onionshare_cli/common.py b/cli/onionshare_cli/common.py new file mode 100644 index 00000000..19a6f11a --- /dev/null +++ b/cli/onionshare_cli/common.py @@ -0,0 +1,300 @@ +# -*- coding: utf-8 -*- +""" +OnionShare | https://onionshare.org/ + +Copyright (C) 2014-2020 Micah Lee, et al. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +""" +import base64 +import hashlib +import inspect +import os +import platform +import random +import socket +import sys +import tempfile +import threading +import time +import shutil + +from .settings import Settings + + +class Common: + """ + The Common object is shared amongst all parts of OnionShare. + """ + + def __init__(self, verbose=False): + self.verbose = verbose + + # The platform OnionShare is running on + self.platform = platform.system() + if self.platform.endswith("BSD") or self.platform == "DragonFly": + self.platform = "BSD" + + # The current version of OnionShare + with open(self.get_resource_path("version.txt")) as f: + self.version = f.read().strip() + + def load_settings(self, config=None): + """ + Loading settings, optionally from a custom config json file. + """ + self.settings = Settings(self, config) + self.settings.load() + + def log(self, module, func, msg=None): + """ + If verbose mode is on, log error messages to stdout + """ + if self.verbose: + timestamp = time.strftime("%b %d %Y %X") + + final_msg = f"[{timestamp}] {module}.{func}" + if msg: + final_msg = f"{final_msg}: {msg}" + print(final_msg) + + def get_resource_path(self, filename): + """ + Returns the absolute path of a resource + """ + resources_path = os.path.join( + os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))), + "resources", + ) + return os.path.join(resources_path, filename) + + def get_tor_paths(self): + if self.platform == "Linux": + tor_path = shutil.which("tor") + obfs4proxy_file_path = shutil.which("obfs4proxy") + prefix = os.path.dirname(os.path.dirname(tor_path)) + tor_geo_ip_file_path = os.path.join(prefix, "share/tor/geoip") + tor_geo_ipv6_file_path = os.path.join(prefix, "share/tor/geoip6") + elif self.platform == "Windows": + base_path = os.path.join( + os.path.dirname(os.path.dirname(self.get_resource_path(""))), "tor" + ) + tor_path = os.path.join(os.path.join(base_path, "Tor"), "tor.exe") + obfs4proxy_file_path = os.path.join( + os.path.join(base_path, "Tor"), "obfs4proxy.exe" + ) + tor_geo_ip_file_path = os.path.join( + os.path.join(os.path.join(base_path, "Data"), "Tor"), "geoip" + ) + tor_geo_ipv6_file_path = os.path.join( + os.path.join(os.path.join(base_path, "Data"), "Tor"), "geoip6" + ) + elif self.platform == "Darwin": + base_path = os.path.dirname( + os.path.dirname(os.path.dirname(self.get_resource_path(""))) + ) + tor_path = os.path.join(base_path, "Resources", "Tor", "tor") + tor_geo_ip_file_path = os.path.join(base_path, "Resources", "Tor", "geoip") + tor_geo_ipv6_file_path = os.path.join( + base_path, "Resources", "Tor", "geoip6" + ) + obfs4proxy_file_path = os.path.join( + base_path, "Resources", "Tor", "obfs4proxy" + ) + elif self.platform == "BSD": + tor_path = "/usr/local/bin/tor" + tor_geo_ip_file_path = "/usr/local/share/tor/geoip" + tor_geo_ipv6_file_path = "/usr/local/share/tor/geoip6" + obfs4proxy_file_path = "/usr/local/bin/obfs4proxy" + + return ( + tor_path, + tor_geo_ip_file_path, + tor_geo_ipv6_file_path, + obfs4proxy_file_path, + ) + + def build_data_dir(self): + """ + Returns the path of the OnionShare data directory. + """ + if self.platform == "Windows": + try: + appdata = os.environ["APPDATA"] + onionshare_data_dir = f"{appdata}\\OnionShare" + except: + # If for some reason we don't have the 'APPDATA' environment variable + # (like running tests in Linux while pretending to be in Windows) + onionshare_data_dir = os.path.expanduser("~/.config/onionshare") + elif self.platform == "Darwin": + onionshare_data_dir = os.path.expanduser( + "~/Library/Application Support/OnionShare" + ) + else: + onionshare_data_dir = os.path.expanduser("~/.config/onionshare") + + # Modify the data dir if running tests + if getattr(sys, "onionshare_test_mode", False): + onionshare_data_dir += "-testdata" + + os.makedirs(onionshare_data_dir, 0o700, True) + return onionshare_data_dir + + def build_tmp_dir(self): + """ + Returns path to a folder that can hold temporary files + """ + tmp_dir = os.path.join(self.build_data_dir(), "tmp") + os.makedirs(tmp_dir, 0o700, True) + return tmp_dir + + def build_persistent_dir(self): + """ + Returns the path to the folder that holds persistent files + """ + persistent_dir = os.path.join(self.build_data_dir(), "persistent") + os.makedirs(persistent_dir, 0o700, True) + return persistent_dir + + def build_tor_dir(self): + """ + Returns path to the tor data directory + """ + tor_dir = os.path.join(self.build_data_dir(), "tor_data") + os.makedirs(tor_dir, 0o700, True) + return tor_dir + + def build_password(self, word_count=2): + """ + Returns a random string made of words from the wordlist, such as "deter-trig". + """ + with open(self.get_resource_path("wordlist.txt")) as f: + wordlist = f.read().split() + + r = random.SystemRandom() + return "-".join(r.choice(wordlist) for _ in range(word_count)) + + def build_username(self, word_count=2): + """ + Returns a random string made of words from the wordlist, such as "deter-trig". + """ + with open(self.get_resource_path("wordlist.txt")) as f: + wordlist = f.read().split() + + r = random.SystemRandom() + return "-".join(r.choice(wordlist) for _ in range(word_count)) + + @staticmethod + def random_string(num_bytes, output_len=None): + """ + Returns a random string with a specified number of bytes. + """ + b = os.urandom(num_bytes) + h = hashlib.sha256(b).digest()[:16] + s = base64.b32encode(h).lower().replace(b"=", b"").decode("utf-8") + if not output_len: + return s + return s[:output_len] + + @staticmethod + def human_readable_filesize(b): + """ + Returns filesize in a human readable format. + """ + thresh = 1024.0 + if b < thresh: + return "{:.1f} B".format(b) + units = ("KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB") + u = 0 + b /= thresh + while b >= thresh: + b /= thresh + u += 1 + return "{:.1f} {}".format(b, units[u]) + + @staticmethod + def format_seconds(seconds): + """Return a human-readable string of the format 1d2h3m4s""" + days, seconds = divmod(seconds, 86400) + hours, seconds = divmod(seconds, 3600) + minutes, seconds = divmod(seconds, 60) + + human_readable = [] + if days: + human_readable.append("{:.0f}d".format(days)) + if hours: + human_readable.append("{:.0f}h".format(hours)) + if minutes: + human_readable.append("{:.0f}m".format(minutes)) + if seconds or not human_readable: + human_readable.append("{:.0f}s".format(seconds)) + return "".join(human_readable) + + @staticmethod + def estimated_time_remaining(bytes_downloaded, total_bytes, started): + now = time.time() + time_elapsed = now - started # in seconds + download_rate = bytes_downloaded / time_elapsed + remaining_bytes = total_bytes - bytes_downloaded + eta = remaining_bytes / download_rate + return Common.format_seconds(eta) + + @staticmethod + def get_available_port(min_port, max_port): + """ + Find a random available port within the given range. + """ + with socket.socket() as tmpsock: + while True: + try: + tmpsock.bind(("127.0.0.1", random.randint(min_port, max_port))) + break + except OSError as e: + pass + _, port = tmpsock.getsockname() + return port + + @staticmethod + def dir_size(start_path): + """ + Calculates the total size, in bytes, of all of the files in a directory. + """ + total_size = 0 + for dirpath, dirnames, filenames in os.walk(start_path): + for f in filenames: + fp = os.path.join(dirpath, f) + if not os.path.islink(fp): + total_size += os.path.getsize(fp) + return total_size + + +class AutoStopTimer(threading.Thread): + """ + Background thread sleeps t hours and returns. + """ + + def __init__(self, common, time): + threading.Thread.__init__(self) + + self.common = common + + self.setDaemon(True) + self.time = time + + def run(self): + self.common.log( + "AutoStopTimer", f"Server will shut down after {self.time} seconds" + ) + time.sleep(self.time) + return 1 diff --git a/cli/onionshare_cli/mode_settings.py b/cli/onionshare_cli/mode_settings.py new file mode 100644 index 00000000..b353fcde --- /dev/null +++ b/cli/onionshare_cli/mode_settings.py @@ -0,0 +1,146 @@ +# -*- coding: utf-8 -*- +""" +OnionShare | https://onionshare.org/ + +Copyright (C) 2014-2020 Micah Lee, et al. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +""" +import os +import json +import platform + +if platform.system() == "Darwin": + import pwd + + +class ModeSettings: + """ + This stores the settings for a single instance of an OnionShare mode. In CLI there + is only one ModeSettings, and in the GUI there is a separate ModeSettings for each tab + """ + + def __init__(self, common, filename=None, id=None): + self.common = common + + self.default_settings = { + "onion": { + "private_key": None, + "hidservauth_string": None, + "password": None, + }, + "persistent": {"mode": None, "enabled": False}, + "general": { + "public": False, + "autostart_timer": False, + "autostop_timer": False, + "legacy": False, + "client_auth": False, + "service_id": None, + }, + "share": {"autostop_sharing": True, "filenames": []}, + "receive": {"data_dir": self.build_default_receive_data_dir()}, + "website": {"disable_csp": False, "filenames": []}, + "chat": {"room": "default"}, + } + self._settings = {} + + self.just_created = False + if id: + self.id = id + else: + self.id = self.common.build_password(3) + + self.load(filename) + + def fill_in_defaults(self): + """ + If there are any missing settings from self._settings, replace them with + their default values. + """ + for key in self.default_settings: + if key in self._settings: + for inner_key in self.default_settings[key]: + if inner_key not in self._settings[key]: + self._settings[key][inner_key] = self.default_settings[key][ + inner_key + ] + else: + self._settings[key] = self.default_settings[key] + + def get(self, group, key): + return self._settings[group][key] + + def set(self, group, key, val): + self._settings[group][key] = val + self.common.log( + "ModeSettings", "set", f"updating {self.id}: {group}.{key} = {val}" + ) + self.save() + + def build_default_receive_data_dir(self): + """ + Returns the path of the default Downloads directory for receive mode. + """ + + if self.common.platform == "Darwin": + # We can't use os.path.expanduser() in macOS because in the sandbox it + # returns the path to the sandboxed homedir + real_homedir = pwd.getpwuid(os.getuid()).pw_dir + return os.path.join(real_homedir, "OnionShare") + elif self.common.platform == "Windows": + # On Windows, os.path.expanduser() needs to use backslash, or else it + # retains the forward slash, which breaks opening the folder in explorer. + return os.path.expanduser("~\OnionShare") + else: + # All other OSes + return os.path.expanduser("~/OnionShare") + + def load(self, filename=None): + # Load persistent settings from disk. If the file doesn't exist, create it + if filename: + self.filename = filename + else: + self.filename = os.path.join( + self.common.build_persistent_dir(), f"{self.id}.json" + ) + + if os.path.exists(self.filename): + try: + with open(self.filename, "r") as f: + self._settings = json.load(f) + self.fill_in_defaults() + self.common.log("ModeSettings", "load", f"loaded {self.filename}") + return + except: + pass + + # If loading settings didn't work, create the settings file + self.common.log("ModeSettings", "load", f"creating {self.filename}") + self.fill_in_defaults() + self.just_created = True + + def save(self): + # Save persistent setting to disk + if not self.get("persistent", "enabled"): + return + + if self.filename: + with open(self.filename, "w") as file: + file.write(json.dumps(self._settings, indent=2)) + + def delete(self): + # Delete the file from disk + if os.path.exists(self.filename): + os.remove(self.filename) diff --git a/cli/onionshare_cli/onion.py b/cli/onionshare_cli/onion.py new file mode 100644 index 00000000..5d08c1ed --- /dev/null +++ b/cli/onionshare_cli/onion.py @@ -0,0 +1,805 @@ +# -*- coding: utf-8 -*- +""" +OnionShare | https://onionshare.org/ + +Copyright (C) 2014-2020 Micah Lee, et al. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +""" + +from stem.control import Controller +from stem import ProtocolError, SocketClosed +from stem.connection import MissingPassword, UnreadableCookieFile, AuthenticationFailure +from Crypto.PublicKey import RSA +import base64, os, sys, tempfile, shutil, urllib, platform, subprocess, time, shlex + +from distutils.version import LooseVersion as Version +from . import common +from .settings import Settings + +# TODO: Figure out how to localize this for the GUI + + +class TorErrorAutomatic(Exception): + """ + OnionShare is failing to connect and authenticate to the Tor controller, + using automatic settings that should work with Tor Browser. + """ + + pass + + +class TorErrorInvalidSetting(Exception): + """ + This exception is raised if the settings just don't make sense. + """ + + pass + + +class TorErrorSocketPort(Exception): + """ + OnionShare can't connect to the Tor controller using the supplied address and port. + """ + + pass + + +class TorErrorSocketFile(Exception): + """ + OnionShare can't connect to the Tor controller using the supplied socket file. + """ + + pass + + +class TorErrorMissingPassword(Exception): + """ + OnionShare connected to the Tor controller, but it requires a password. + """ + + pass + + +class TorErrorUnreadableCookieFile(Exception): + """ + OnionShare connected to the Tor controller, but your user does not have permission + to access the cookie file. + """ + + pass + + +class TorErrorAuthError(Exception): + """ + OnionShare connected to the address and port, but can't authenticate. It's possible + that a Tor controller isn't listening on this port. + """ + + pass + + +class TorErrorProtocolError(Exception): + """ + This exception is raised if onionshare connects to the Tor controller, but it + isn't acting like a Tor controller (such as in Whonix). + """ + + pass + + +class TorTooOld(Exception): + """ + This exception is raised if onionshare needs to use a feature of Tor or stem + (like stealth ephemeral onion services) but the version you have installed + is too old. + """ + + pass + + +class BundledTorNotSupported(Exception): + """ + This exception is raised if onionshare is set to use the bundled Tor binary, + but it's not supported on that platform, or in dev mode. + """ + + +class BundledTorTimeout(Exception): + """ + This exception is raised if onionshare is set to use the bundled Tor binary, + but Tor doesn't finish connecting promptly. + """ + + +class BundledTorCanceled(Exception): + """ + This exception is raised if onionshare is set to use the bundled Tor binary, + and the user cancels connecting to Tor + """ + + +class BundledTorBroken(Exception): + """ + This exception is raised if onionshare is set to use the bundled Tor binary, + but the process seems to fail to run. + """ + + +class Onion(object): + """ + Onion is an abstraction layer for connecting to the Tor control port and + creating onion services. OnionShare supports creating onion services by + connecting to the Tor controller and using ADD_ONION, DEL_ONION. + + stealth: Should the onion service be stealth? + + settings: A Settings object. If it's not passed in, load from disk. + + bundled_connection_func: If the tor connection type is bundled, optionally + call this function and pass in a status string while connecting to tor. This + is necessary for status updates to reach the GUI. + """ + + def __init__(self, common, use_tmp_dir=False): + self.common = common + self.common.log("Onion", "__init__") + + self.use_tmp_dir = use_tmp_dir + + # Is bundled tor supported? + if ( + self.common.platform == "Windows" or self.common.platform == "Darwin" + ) and getattr(sys, "onionshare_dev_mode", False): + self.bundle_tor_supported = False + else: + self.bundle_tor_supported = True + + # Set the path of the tor binary, for bundled tor + ( + self.tor_path, + self.tor_geo_ip_file_path, + self.tor_geo_ipv6_file_path, + self.obfs4proxy_file_path, + ) = self.common.get_tor_paths() + + # The tor process + self.tor_proc = None + + # The Tor controller + self.c = None + + # Start out not connected to Tor + self.connected_to_tor = False + + # Assigned later if we are using stealth mode + self.auth_string = None + + def connect( + self, + custom_settings=None, + config=None, + tor_status_update_func=None, + connect_timeout=120, + local_only=False, + ): + if local_only: + self.common.log( + "Onion", "connect", "--local-only, so skip trying to connect" + ) + return + + self.common.log("Onion", "connect") + + # Either use settings that are passed in, or use them from common + if custom_settings: + self.settings = custom_settings + elif config: + self.common.load_settings(config) + self.settings = self.common.settings + else: + self.common.load_settings() + self.settings = self.common.settings + + # The Tor controller + self.c = None + + if self.settings.get("connection_type") == "bundled": + if not self.bundle_tor_supported: + raise BundledTorNotSupported( + # strings._("settings_error_bundled_tor_not_supported") + "Using the Tor version that comes with OnionShare does not work in developer mode on Windows or macOS." + ) + + # Create a torrc for this session + if self.use_tmp_dir: + self.tor_data_directory = tempfile.TemporaryDirectory( + dir=self.common.build_tmp_dir() + ) + self.tor_data_directory_name = self.tor_data_directory.name + else: + self.tor_data_directory_name = self.common.build_tor_dir() + self.common.log( + "Onion", + "connect", + f"tor_data_directory_name={self.tor_data_directory_name}", + ) + + # Create the torrc + with open(self.common.get_resource_path("torrc_template")) as f: + torrc_template = f.read() + self.tor_cookie_auth_file = os.path.join( + self.tor_data_directory_name, "cookie" + ) + try: + self.tor_socks_port = self.common.get_available_port(1000, 65535) + except: + raise OSError("OnionShare port not available") + self.tor_torrc = os.path.join(self.tor_data_directory_name, "torrc") + + if self.common.platform == "Windows" or self.common.platform == "Darwin": + # Windows doesn't support unix sockets, so it must use a network port. + # macOS can't use unix sockets either because socket filenames are limited to + # 100 chars, and the macOS sandbox forces us to put the socket file in a place + # with a really long path. + torrc_template += "ControlPort {{control_port}}\n" + try: + self.tor_control_port = self.common.get_available_port(1000, 65535) + except: + raise OSError("OnionShare port not available") + self.tor_control_socket = None + else: + # Linux and BSD can use unix sockets + torrc_template += "ControlSocket {{control_socket}}\n" + self.tor_control_port = None + self.tor_control_socket = os.path.join( + self.tor_data_directory_name, "control_socket" + ) + + torrc_template = torrc_template.replace( + "{{data_directory}}", self.tor_data_directory_name + ) + torrc_template = torrc_template.replace( + "{{control_port}}", str(self.tor_control_port) + ) + torrc_template = torrc_template.replace( + "{{control_socket}}", str(self.tor_control_socket) + ) + torrc_template = torrc_template.replace( + "{{cookie_auth_file}}", self.tor_cookie_auth_file + ) + torrc_template = torrc_template.replace( + "{{geo_ip_file}}", self.tor_geo_ip_file_path + ) + torrc_template = torrc_template.replace( + "{{geo_ipv6_file}}", self.tor_geo_ipv6_file_path + ) + torrc_template = torrc_template.replace( + "{{socks_port}}", str(self.tor_socks_port) + ) + + with open(self.tor_torrc, "w") as f: + f.write(torrc_template) + + # Bridge support + if self.settings.get("tor_bridges_use_obfs4"): + f.write( + f"ClientTransportPlugin obfs4 exec {self.obfs4proxy_file_path}\n" + ) + with open( + self.common.get_resource_path("torrc_template-obfs4") + ) as o: + for line in o: + f.write(line) + elif self.settings.get("tor_bridges_use_meek_lite_azure"): + f.write( + f"ClientTransportPlugin meek_lite exec {self.obfs4proxy_file_path}\n" + ) + with open( + self.common.get_resource_path("torrc_template-meek_lite_azure") + ) as o: + for line in o: + f.write(line) + + if self.settings.get("tor_bridges_use_custom_bridges"): + if "obfs4" in self.settings.get("tor_bridges_use_custom_bridges"): + f.write( + f"ClientTransportPlugin obfs4 exec {self.obfs4proxy_file_path}\n" + ) + elif "meek_lite" in self.settings.get( + "tor_bridges_use_custom_bridges" + ): + f.write( + f"ClientTransportPlugin meek_lite exec {self.obfs4proxy_file_path}\n" + ) + f.write(self.settings.get("tor_bridges_use_custom_bridges")) + f.write("\nUseBridges 1") + + # Execute a tor subprocess + start_ts = time.time() + if self.common.platform == "Windows": + # In Windows, hide console window when opening tor.exe subprocess + startupinfo = subprocess.STARTUPINFO() + startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW + self.tor_proc = subprocess.Popen( + [self.tor_path, "-f", self.tor_torrc], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + startupinfo=startupinfo, + ) + else: + self.tor_proc = subprocess.Popen( + [self.tor_path, "-f", self.tor_torrc], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + + # Wait for the tor controller to start + time.sleep(2) + + # Connect to the controller + try: + if ( + self.common.platform == "Windows" + or self.common.platform == "Darwin" + ): + self.c = Controller.from_port(port=self.tor_control_port) + self.c.authenticate() + else: + self.c = Controller.from_socket_file(path=self.tor_control_socket) + self.c.authenticate() + except Exception as e: + raise BundledTorBroken( + # strings._("settings_error_bundled_tor_broken").format(e.args[0]) + "OnionShare could not connect to Tor:\n{}".format(e.args[0]) + ) + + while True: + try: + res = self.c.get_info("status/bootstrap-phase") + except SocketClosed: + raise BundledTorCanceled() + + res_parts = shlex.split(res) + progress = res_parts[2].split("=")[1] + summary = res_parts[4].split("=")[1] + + # "\033[K" clears the rest of the line + print( + f"\rConnecting to the Tor network: {progress}% - {summary}\033[K", + end="", + ) + + if callable(tor_status_update_func): + if not tor_status_update_func(progress, summary): + # If the dialog was canceled, stop connecting to Tor + self.common.log( + "Onion", + "connect", + "tor_status_update_func returned false, canceling connecting to Tor", + ) + print() + return False + + if summary == "Done": + print("") + break + time.sleep(0.2) + + # If using bridges, it might take a bit longer to connect to Tor + if ( + self.settings.get("tor_bridges_use_custom_bridges") + or self.settings.get("tor_bridges_use_obfs4") + or self.settings.get("tor_bridges_use_meek_lite_azure") + ): + # Only override timeout if a custom timeout has not been passed in + if connect_timeout == 120: + connect_timeout = 150 + if time.time() - start_ts > connect_timeout: + print("") + try: + self.tor_proc.terminate() + raise BundledTorTimeout( + # strings._("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?" + ) + except FileNotFoundError: + pass + + elif self.settings.get("connection_type") == "automatic": + # Automatically try to guess the right way to connect to Tor Browser + + # Try connecting to control port + found_tor = False + + # If the TOR_CONTROL_PORT environment variable is set, use that + env_port = os.environ.get("TOR_CONTROL_PORT") + if env_port: + try: + self.c = Controller.from_port(port=int(env_port)) + found_tor = True + except: + pass + + else: + # Otherwise, try default ports for Tor Browser, Tor Messenger, and system tor + try: + ports = [9151, 9153, 9051] + for port in ports: + self.c = Controller.from_port(port=port) + found_tor = True + except: + pass + + # If this still didn't work, try guessing the default socket file path + socket_file_path = "" + if not found_tor: + try: + if self.common.platform == "Darwin": + socket_file_path = os.path.expanduser( + "~/Library/Application Support/TorBrowser-Data/Tor/control.socket" + ) + + self.c = Controller.from_socket_file(path=socket_file_path) + found_tor = True + except: + pass + + # If connecting to default control ports failed, so let's try + # guessing the socket file name next + if not found_tor: + try: + if self.common.platform == "Linux" or self.common.platform == "BSD": + socket_file_path = ( + f"/run/user/{os.geteuid()}/Tor/control.socket" + ) + elif self.common.platform == "Darwin": + socket_file_path = ( + f"/run/user/{os.geteuid()}/Tor/control.socket" + ) + elif self.common.platform == "Windows": + # Windows doesn't support unix sockets + raise TorErrorAutomatic( + # strings._("settings_error_automatic") + "Could not connect to the Tor controller. Is Tor Browser (available from torproject.org) running in the background?" + ) + + self.c = Controller.from_socket_file(path=socket_file_path) + + except: + raise TorErrorAutomatic( + # strings._("settings_error_automatic") + "Could not connect to the Tor controller. Is Tor Browser (available from torproject.org) running in the background?" + ) + + # Try authenticating + try: + self.c.authenticate() + except: + raise TorErrorAutomatic( + # strings._("settings_error_automatic") + "Could not connect to the Tor controller. Is Tor Browser (available from torproject.org) running in the background?" + ) + + else: + # Use specific settings to connect to tor + + # Try connecting + try: + if self.settings.get("connection_type") == "control_port": + self.c = Controller.from_port( + address=self.settings.get("control_port_address"), + port=self.settings.get("control_port_port"), + ) + elif self.settings.get("connection_type") == "socket_file": + self.c = Controller.from_socket_file( + path=self.settings.get("socket_file_path") + ) + else: + raise TorErrorInvalidSetting( + # strings._("settings_error_unknown") + "Can't connect to Tor controller because your settings don't make sense." + ) + + except: + if self.settings.get("connection_type") == "control_port": + raise TorErrorSocketPort( + # strings._("settings_error_socket_port") + "Can't connect to the Tor controller at {}:{}.".format( + self.settings.get("control_port_address"), + self.settings.get("control_port_port"), + ) + ) + else: + raise TorErrorSocketFile( + # strings._("settings_error_socket_file") + "Can't connect to the Tor controller using socket file {}.".format( + self.settings.get("socket_file_path") + ) + ) + + # Try authenticating + try: + if self.settings.get("auth_type") == "no_auth": + self.c.authenticate() + elif self.settings.get("auth_type") == "password": + self.c.authenticate(self.settings.get("auth_password")) + else: + raise TorErrorInvalidSetting( + # strings._("settings_error_unknown") + "Can't connect to Tor controller because your settings don't make sense." + ) + + except MissingPassword: + raise TorErrorMissingPassword( + # strings._("settings_error_missing_password") + "Connected to Tor controller, but it requires a password to authenticate." + ) + except UnreadableCookieFile: + raise TorErrorUnreadableCookieFile( + # strings._("settings_error_unreadable_cookie_file") + "Connected to the Tor controller, but password may be wrong, or your user is not permitted to read the cookie file." + ) + except AuthenticationFailure: + raise TorErrorAuthError( + # strings._("settings_error_auth") + "Connected to {}:{}, but can't authenticate. Maybe this isn't a Tor controller?".format( + self.settings.get("control_port_address"), + self.settings.get("control_port_port"), + ) + ) + + # If we made it this far, we should be connected to Tor + self.connected_to_tor = True + + # Get the tor version + self.tor_version = self.c.get_version().version_str + self.common.log("Onion", "connect", f"Connected to tor {self.tor_version}") + + # Do the versions of stem and tor that I'm using support ephemeral onion services? + list_ephemeral_hidden_services = getattr( + self.c, "list_ephemeral_hidden_services", None + ) + self.supports_ephemeral = ( + callable(list_ephemeral_hidden_services) and self.tor_version >= "0.2.7.1" + ) + + # Do the versions of stem and tor that I'm using support stealth onion services? + try: + res = self.c.create_ephemeral_hidden_service( + {1: 1}, + basic_auth={"onionshare": None}, + await_publication=False, + key_type="NEW", + key_content="RSA1024", + ) + tmp_service_id = res.service_id + self.c.remove_ephemeral_hidden_service(tmp_service_id) + self.supports_stealth = True + except: + # ephemeral stealth onion services are not supported + self.supports_stealth = False + + # Does this version of Tor support next-gen ('v3') onions? + # Note, this is the version of Tor where this bug was fixed: + # https://trac.torproject.org/projects/tor/ticket/28619 + self.supports_v3_onions = self.tor_version >= Version("0.3.5.7") + + def is_authenticated(self): + """ + Returns True if the Tor connection is still working, or False otherwise. + """ + if self.c is not None: + return self.c.is_authenticated() + else: + return False + + def start_onion_service(self, mode_settings, port, await_publication): + """ + Start a onion service on port 80, pointing to the given port, and + return the onion hostname. + """ + self.common.log("Onion", "start_onion_service", f"port={port}") + + if not self.supports_ephemeral: + raise TorTooOld( + # strings._("error_ephemeral_not_supported") + "Your version of Tor is too old, ephemeral onion services are not supported" + ) + if mode_settings.get("general", "client_auth") and not self.supports_stealth: + raise TorTooOld( + # strings._("error_stealth_not_supported") + "Your version of Tor is too old, stealth onion services are not supported" + ) + + auth_cookie = None + if mode_settings.get("general", "client_auth"): + if mode_settings.get("onion", "hidservauth_string"): + auth_cookie = mode_settings.get("onion", "hidservauth_string").split()[ + 2 + ] + if auth_cookie: + basic_auth = {"onionshare": auth_cookie} + else: + # If we had neither a scheduled auth cookie or a persistent hidservauth string, + # set the cookie to 'None', which means Tor will create one for us + basic_auth = {"onionshare": None} + else: + # Not using client auth at all + basic_auth = None + + if mode_settings.get("onion", "private_key"): + key_content = mode_settings.get("onion", "private_key") + if self.is_v2_key(key_content): + key_type = "RSA1024" + else: + # Assume it was a v3 key. Stem will throw an error if it's something illegible + key_type = "ED25519-V3" + else: + key_type = "NEW" + # Work out if we can support v3 onion services, which are preferred + if self.supports_v3_onions and not mode_settings.get("general", "legacy"): + key_content = "ED25519-V3" + else: + # fall back to v2 onion services + key_content = "RSA1024" + + # v3 onions don't yet support basic auth. Our ticket: + # https://github.com/micahflee/onionshare/issues/697 + if ( + key_type == "NEW" + and key_content == "ED25519-V3" + and not mode_settings.get("general", "legacy") + ): + basic_auth = None + + debug_message = f"key_type={key_type}" + if key_type == "NEW": + debug_message += f", key_content={key_content}" + self.common.log("Onion", "start_onion_service", debug_message) + try: + res = self.c.create_ephemeral_hidden_service( + {80: port}, + await_publication=await_publication, + basic_auth=basic_auth, + key_type=key_type, + key_content=key_content, + ) + + except ProtocolError as e: + raise TorErrorProtocolError( + # strings._("error_tor_protocol_error") + "Tor error: {}".format(e.args[0]) + ) + + onion_host = res.service_id + ".onion" + + # Save the service_id + mode_settings.set("general", "service_id", res.service_id) + + # Save the private key and hidservauth string + if not mode_settings.get("onion", "private_key"): + mode_settings.set("onion", "private_key", res.private_key) + if mode_settings.get("general", "client_auth") and not mode_settings.get( + "onion", "hidservauth_string" + ): + auth_cookie = list(res.client_auth.values())[0] + self.auth_string = f"HidServAuth {onion_host} {auth_cookie}" + mode_settings.set("onion", "hidservauth_string", self.auth_string) + + return onion_host + + def stop_onion_service(self, mode_settings): + """ + Stop a specific onion service + """ + onion_host = mode_settings.get("general", "service_id") + if onion_host: + self.common.log("Onion", "stop_onion_service", f"onion host: {onion_host}") + try: + self.c.remove_ephemeral_hidden_service( + mode_settings.get("general", "service_id") + ) + except: + self.common.log( + "Onion", "stop_onion_service", f"failed to remove {onion_host}" + ) + + def cleanup(self, stop_tor=True): + """ + Stop onion services that were created earlier. If there's a tor subprocess running, kill it. + """ + self.common.log("Onion", "cleanup") + + # Cleanup the ephemeral onion services, if we have any + try: + onions = self.c.list_ephemeral_hidden_services() + for service_id in onions: + onion_host = f"{service_id}.onion" + try: + self.common.log( + "Onion", "cleanup", f"trying to remove onion {onion_host}" + ) + self.c.remove_ephemeral_hidden_service(service_id) + except: + self.common.log( + "Onion", "cleanup", f"failed to remove onion {onion_host}" + ) + pass + except: + pass + + if stop_tor: + # Stop tor process + if self.tor_proc: + self.tor_proc.terminate() + time.sleep(0.2) + if self.tor_proc.poll() is None: + self.common.log( + "Onion", + "cleanup", + "Tried to terminate tor process but it's still running", + ) + try: + self.tor_proc.kill() + time.sleep(0.2) + if self.tor_proc.poll() is None: + self.common.log( + "Onion", + "cleanup", + "Tried to kill tor process but it's still running", + ) + except: + self.common.log( + "Onion", "cleanup", "Exception while killing tor process" + ) + self.tor_proc = None + + # Reset other Onion settings + self.connected_to_tor = False + + try: + # Delete the temporary tor data directory + if self.use_tmp_dir: + self.tor_data_directory.cleanup() + except: + pass + + def get_tor_socks_port(self): + """ + Returns a (address, port) tuple for the Tor SOCKS port + """ + self.common.log("Onion", "get_tor_socks_port") + + if self.settings.get("connection_type") == "bundled": + return ("127.0.0.1", self.tor_socks_port) + elif self.settings.get("connection_type") == "automatic": + return ("127.0.0.1", 9150) + else: + return (self.settings.get("socks_address"), self.settings.get("socks_port")) + + def is_v2_key(self, key): + """ + Helper function for determining if a key is RSA1024 (v2) or not. + """ + try: + # Import the key + key = RSA.importKey(base64.b64decode(key)) + # Is this a v2 Onion key? (1024 bits) If so, we should keep using it. + if key.n.bit_length() == 1024: + return True + else: + return False + except: + return False diff --git a/cli/onionshare_cli/onionshare.py b/cli/onionshare_cli/onionshare.py new file mode 100644 index 00000000..f74672ce --- /dev/null +++ b/cli/onionshare_cli/onionshare.py @@ -0,0 +1,111 @@ +# -*- coding: utf-8 -*- +""" +OnionShare | https://onionshare.org/ + +Copyright (C) 2014-2020 Micah Lee, et al. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +""" + +import os, shutil + +from . import common +from .onion import TorTooOld, TorErrorProtocolError +from .common import AutoStopTimer + + +class OnionShare(object): + """ + OnionShare is the main application class. Pass in options and run + start_onion_service and it will do the magic. + """ + + def __init__(self, common, onion, local_only=False, autostop_timer=0): + self.common = common + + self.common.log("OnionShare", "__init__") + + # The Onion object + self.onion = onion + + self.hidserv_dir = None + self.onion_host = None + self.port = None + + # files and dirs to delete on shutdown + self.cleanup_filenames = [] + + # do not use tor -- for development + self.local_only = local_only + + # optionally shut down after N hours + self.autostop_timer = autostop_timer + # init auto-stop timer thread + self.autostop_timer_thread = None + + def choose_port(self): + """ + Choose a random port. + """ + try: + self.port = self.common.get_available_port(17600, 17650) + except: + raise OSError("Cannot find an available OnionShare port") + + def start_onion_service(self, mode_settings, await_publication=True): + """ + Start the onionshare onion service. + """ + self.common.log("OnionShare", "start_onion_service") + + if not self.port: + self.choose_port() + + if self.autostop_timer > 0: + self.autostop_timer_thread = AutoStopTimer(self.common, self.autostop_timer) + + if self.local_only: + self.onion_host = f"127.0.0.1:{self.port}" + return + + self.onion_host = self.onion.start_onion_service( + mode_settings, self.port, await_publication + ) + + if mode_settings.get("general", "client_auth"): + self.auth_string = self.onion.auth_string + + def stop_onion_service(self, mode_settings): + """ + Stop the onion service + """ + self.onion.stop_onion_service(mode_settings) + + def cleanup(self): + """ + Shut everything down and clean up temporary files, etc. + """ + self.common.log("OnionShare", "cleanup") + + # Cleanup files + try: + for filename in self.cleanup_filenames: + if os.path.isfile(filename): + os.remove(filename) + elif os.path.isdir(filename): + shutil.rmtree(filename) + except: + # Don't crash if file is still in use + pass + self.cleanup_filenames = [] diff --git a/cli/onionshare_cli/resources/static/css/style.css b/cli/onionshare_cli/resources/static/css/style.css new file mode 100644 index 00000000..88d9cb79 --- /dev/null +++ b/cli/onionshare_cli/resources/static/css/style.css @@ -0,0 +1,393 @@ +.clearfix:after { + content: "."; + display: block; + clear: both; + visibility: hidden; + line-height: 0; + height: 0; +} + +body { + margin: 0; + font-family: Helvetica, sans-serif; +} + +.d-flex { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + align-items: center; +} + +header { + border-bottom: 1px solid rgba(0, 0, 0, 0.1); + background: #fcfcfc; + background: -webkit-linear-gradient(top, #fcfcfc 0%, #f2f2f2 100%); + padding: 0.8rem; +} + +header .logo { + vertical-align: middle; + width: 45px; + height: 45px; +} + +header h1 { + display: inline-block; + margin: 0 0 0 0.5rem; + vertical-align: middle; + font-weight: normal; + font-size: 1.5rem; + color: #666666; +} + +header .information { + font-size: 1rem; +} + +.button { + color: #ffffff; + background-color: #4e064f; + padding: 10px; + border: 0; + border-radius: 5px; + text-decoration: none; + margin-left: 1rem; + cursor: pointer; +} + +a.button:visited { + color: #ffffff; +} + +.close-button { + color: #ffffff; + background-color: #c90c0c; + padding: 10px; + border: 0; + border-radius: 5px; + text-decoration: none; + margin-left: 1rem; + cursor: pointer; + position: absolute; + right: 10px; + bottom: 10px; +} + +ul.breadcrumbs { + display: block; + list-style: none; + margin: 10px 0; + padding: 0; +} + +ul.breadcrumbs li { + display: inline-block; + list-style: none; + margin: 0; + padding: 5px; + color: #999999; +} + +ul.breadcrumbs li span.sep { + padding-left: 5px; +} + +ul.breadcrumbs li a:link, ul.breadcrumbs li a:visited { + color: #666666; + border-bottom: 1px solid #666666; +} + +.file-list { + width: 100%; + margin: 0 auto; + border-collapse: collapse; +} + +.file-list .heading { + text-align: left; + text-transform: uppercase; + font-weight: normal; + color: #666666; + padding: 0.5rem; +} + +.file-list div.d-flex { + border-bottom: 1px solid #e0e0e0; + justify-content: flex-start; +} + +.file-list div.d-flex div { + white-space: nowrap; + padding: 0.5rem 0.8rem 0.5rem 0.8rem; +} + +.file-list div.d-flex div img { + vertical-align: middle; + margin-right: 0.5rem; +} + +.file-list div.d-flex div:last-child { + padding-right: 0.8rem; + flex-basis: 0; + flex-grow: 1; +} + +.file-list div.d-flex div:first-child { + flex-basis: 0; + flex-grow: 2; +} + +@media (max-width: 950px) { + .file-list div.d-flex div:last-child { + flex-basis: auto; + flex-grow: 0; + } +} + +@media (max-width: 655px) { + .file-list div.d-flex { + display: block; + } + .file-list div.d-flex span { + max-width: 100%; + word-break: break-all; + white-space: normal; + } + .file-list div.d-flex #size-header { + display: none; + } + .file-list div.d-flex div:last-child { + padding-left: 3.5rem; + font-size: 0.85rem; + padding-top: 0; + } + header .information { + padding: 1rem 0; + } +} + +.chat-container { + display: flex; + font-family: monospace; +} + +.chat-users { + width: 20%; + border: 1px solid rgba(0, 0, 0, 0.1); + border-radius: 2px; + overflow: auto; + background: #f2f2f2; + margin: 1rem 0 1rem 1rem; +} + +.chat-users .editable-username { + display: flex; + padding: 1rem; + flex-direction: column; +} + +.chat-users .editable-username input { + font-family: monospace; + font-size: 1em; +} + +.chat-users .editable-username #username-error { + color: #c90c0c; + margin: 0.5rem; +} + +.chat-users #user-list li { + margin-bottom: 1em; +} + +.chat-wrapper { + display: flex; + flex-direction: column; + flex: 1; + margin: 1rem 1rem 0 1rem; + height: calc(100vh - (65px + 2em)); +} + +.chat-wrapper #chat { + border: 1px solid rgba(0, 0, 0, 0.1); + border-radius: 2px; + flex: 1; + overflow: auto; + background: #f2f2f2; + padding: 0 1rem; +} + +.chat-wrapper .status { + font-style: italic; + font-size: 0.8em; + color: #666666; +} + +.chat-wrapper .username { + font-weight: bold; + display: block; +} +.chat-wrapper .message { + font-weight: normal; + display: block; + margin-bottom: 0.3em; +} + +.chat-wrapper .chat-form { + display: block; + margin: 0.2rem 1rem 1rem 0; + padding: -0.5em; +} + +.chat-wrapper input#new-message { + height: 100%; + width: 100%; + font-family: monospace; + font-size: 1em; +} + +@media (max-width: 992px) { + .chat-users .editable-username { + display: block; + } + + .chat-users input#username { + width: 90%; + } +} + +.no-js { + display: none; +} + +.upload-wrapper { + align-items: center; + justify-content: center; + min-height: 400px; + text-align: center; +} + +.upload-wrapper img.logo { + width: 120px; + height: 120px; +} + +.upload-wrapper .upload-header { + font-size: 30px; + font-weight: normal; + color: #666666; + margin: 0 0 10px 0; +} + +.upload-wrapper .upload-description { + color: #666666; + margin: 0 0 20px 0; +} + +div#uploads { + width: 800px; + max-width: 90%; + margin: 0 auto; +} + +div#uploads .upload { + border: 1px solid #DDDDDD; + margin: 20px 0; + padding: 10px; + text-align: left; +} + +div#uploads .upload .upload-filename { + font-weight: bold; + font-family: monospace; + font-size: 1.1em; + margin-bottom: 5px; +} + +div#uploads .upload .upload-status { + color: #999999; + font-size: 0.9em; + margin-bottom: 5px; +} + +div#uploads .upload input.cancel { + color: #d0011b; + border: 0; + background: none; + box-shadow: none; + border-radius: 0px; + cursor: pointer; + font-family: sans-serif; + font-size: 12px; + text-decoration: none; + display: inline-block; + float:right; +} + +div#uploads .upload progress { + width: 100%; + height: 20px; +} + +ul.flashes { + list-style: none; + margin: 0; + padding: 0; + width: 800px; + max-width: 100%; + margin: 0 auto; +} + +ul.flashes li { + margin: 0 0 5px 0; + padding: 5px; + list-style: none; + text-align: center; + word-break: break-word; +} + +li.error { + color: #d0011b; +} + +li.info { + color: #5fa416; +} + +.closed-wrapper { + display: flex; + align-items: center; + justify-content: center; + min-height: 400px; +} + +.info { + text-align: center; +} + +.info img { + width: 120px; + height: 120px; +} + +.info .info-header { + font-size: 30px; + font-weight: normal; + color: #666666; + margin: 0 0 10px 0; +} + +.info .info-description { + color: #666666; + margin: 0 0 20px 0; +} + +a { + text-decoration: none; + color: #1c1ca0; +} + +a:visited { + color: #601ca0; +} \ No newline at end of file diff --git a/cli/onionshare_cli/resources/static/img/ajax.gif b/cli/onionshare_cli/resources/static/img/ajax.gif new file mode 100644 index 00000000..01d955aa Binary files /dev/null and b/cli/onionshare_cli/resources/static/img/ajax.gif differ diff --git a/cli/onionshare_cli/resources/static/img/favicon.ico b/cli/onionshare_cli/resources/static/img/favicon.ico new file mode 100644 index 00000000..63e65d8b Binary files /dev/null and b/cli/onionshare_cli/resources/static/img/favicon.ico differ diff --git a/cli/onionshare_cli/resources/static/img/logo.png b/cli/onionshare_cli/resources/static/img/logo.png new file mode 100644 index 00000000..43884c1f Binary files /dev/null and b/cli/onionshare_cli/resources/static/img/logo.png differ diff --git a/cli/onionshare_cli/resources/static/img/logo_large.png b/cli/onionshare_cli/resources/static/img/logo_large.png new file mode 100644 index 00000000..ee8f26ac Binary files /dev/null and b/cli/onionshare_cli/resources/static/img/logo_large.png differ diff --git a/cli/onionshare_cli/resources/static/img/web_file.png b/cli/onionshare_cli/resources/static/img/web_file.png new file mode 100644 index 00000000..1931aff0 Binary files /dev/null and b/cli/onionshare_cli/resources/static/img/web_file.png differ diff --git a/cli/onionshare_cli/resources/static/img/web_folder.png b/cli/onionshare_cli/resources/static/img/web_folder.png new file mode 100644 index 00000000..3ca5df21 Binary files /dev/null and b/cli/onionshare_cli/resources/static/img/web_folder.png differ diff --git a/cli/onionshare_cli/resources/static/js/chat.js b/cli/onionshare_cli/resources/static/js/chat.js new file mode 100644 index 00000000..39547725 --- /dev/null +++ b/cli/onionshare_cli/resources/static/js/chat.js @@ -0,0 +1,165 @@ +$(function () { + $(document).ready(function () { + $('.chat-container').removeClass('no-js'); + var socket = io.connect('http://' + document.domain + ':' + location.port + '/chat'); + + // Store current username received from app context + var current_username = $('#username').val(); + + // On browser connect, emit a socket event to be added to + // room and assigned random username + socket.on('connect', function () { + socket.emit('joined', {}); + }); + + // Triggered on any status change by any user, such as some + // user joined, or changed username, or left, etc. + socket.on('status', function (data) { + addMessageToRoom(data, current_username, 'status'); + console.log(data, current_username); + }); + + // Triggered when message is received from a user. Even when sent + // by self, it get triggered after the server sends back the emit. + socket.on('message', function (data) { + addMessageToRoom(data, current_username, 'chat'); + console.log(data, current_username); + }); + + // Triggered when disconnected either by server stop or timeout + socket.on('disconnect', function (data) { + addMessageToRoom({ 'msg': 'The chat server is disconnected.' }, current_username, 'status'); + }) + socket.on('connect_error', function (error) { + console.log("error"); + }) + + // Trigger new message on enter or click of send message button. + $('#new-message').on('keypress', function (e) { + var code = e.keyCode || e.which; + if (code == 13) { + emitMessage(socket); + } + }); + + // Keep buttons disabled unless changed or not empty + $('#username').on('keyup', function (event) { + if ($('#username').val() !== '' && $('#username').val() !== current_username) { + if (event.keyCode == 13) { + current_username = updateUsername(socket) || current_username; + } + } + }); + + // Show warning of losing data + $(window).on('beforeunload', function (e) { + e.preventDefault(); + e.returnValue = ''; + return ''; + }); + }); +}); + +var addMessageToRoom = function (data, current_username, messageType) { + var scrollDiff = getScrollDiffBefore(); + if (messageType === 'status') { + addStatusMessage(data.msg); + if (data.connected_users) { + addUserList(data.connected_users, current_username); + } + } else if (messageType === 'chat') { + addChatMessage(data.username, data.msg) + } + scrollBottomMaybe(scrollDiff); +} + +var emitMessage = function (socket) { + var text = $('#new-message').val(); + $('#new-message').val(''); + $('#chat').scrollTop($('#chat')[0].scrollHeight); + socket.emit('text', { msg: text }); +} + +var updateUsername = function (socket) { + var username = $('#username').val(); + if (!checkUsernameExists(username)) { + socket.emit('update_username', { username: username }); + $.ajax({ + method: 'POST', + url: `http://${document.domain}:${location.port}/update-session-username`, + contentType: 'application/json', + dataType: 'json', + data: JSON.stringify({ 'username': username }) + }).done(function (response) { + console.log(response); + }); + return username; + } + return false; +} + +/************************************/ +/********* Util Functions ***********/ +/************************************/ + +var createUserListHTML = function (connected_users, current_user) { + var userListHTML = ''; + connected_users.sort(); + connected_users.forEach(function (username) { + if (username !== current_user) { + userListHTML += `
  • ${sanitizeHTML(username)}
  • `; + } + }); + return userListHTML; +} + +var checkUsernameExists = function (username) { + $('#username-error').text(''); + var userMatches = $('#user-list li').filter(function () { + return $(this).text() === username; + }); + if (userMatches.length) { + $('#username-error').text('User with that username exists!'); + return true; + } + return false; +} + +var getScrollDiffBefore = function () { + return $('#chat').scrollTop() - ($('#chat')[0].scrollHeight - $('#chat')[0].offsetHeight); +} + +var scrollBottomMaybe = function (scrollDiff) { + // Scrolls to bottom if the user is scrolled at bottom + // if the user has scrolled upp, it wont scroll at bottom. + // Note: when a user themselves send a message, it will still + // scroll to the bottom even if they had scrolled up before. + if (scrollDiff > 0) { + $('#chat').scrollTop($('#chat')[0].scrollHeight); + } +} + +var addStatusMessage = function (message) { + $('#chat').append( + `

    ${sanitizeHTML(message)}

    ` + ); +} + +var addChatMessage = function (username, message) { + $('#chat').append(`

    ${sanitizeHTML(username)}${sanitizeHTML(message)}

    `); +} + +var addUserList = function (connected_users, current_username) { + $('#user-list').html( + createUserListHTML( + connected_users, + current_username + ) + ); +} + +var sanitizeHTML = function (str) { + var temp = document.createElement('span'); + temp.textContent = str; + return temp.innerHTML; +}; diff --git a/cli/onionshare_cli/resources/static/js/jquery-3.5.1.min.js b/cli/onionshare_cli/resources/static/js/jquery-3.5.1.min.js new file mode 100644 index 00000000..b0614034 --- /dev/null +++ b/cli/onionshare_cli/resources/static/js/jquery-3.5.1.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
    ",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0').addClass(category).text(message)); + }; + + var scriptSrc = document.getElementById('receive-script').src; + var staticImgPath = scriptSrc.substr(0, scriptSrc.lastIndexOf( '/' )+1).replace('js', 'img'); + + // Intercept submitting the form + $('#send').submit(function(event){ + event.preventDefault(); + + // Create form data, and list of filenames + var files = $('#file-select').get(0).files; + var filenames = []; + var formData = new FormData(); + for(var i = 0; i < files.length; i++) { + var file = files[i]; + filenames.push(file.name); + formData.append('file[]', file, file.name); + } + + // Reset the upload form + $('#send').get(0).reset(); + + // Don't use jQuery for ajax request, because the upload progress event doesn't + // have access to the the XMLHttpRequest object + var ajax = new XMLHttpRequest(); + + ajax.upload.addEventListener('progress', function(event){ + // Update progress bar for this specific upload + if(event.lengthComputable) { + $('progress', ajax.$upload_div).attr({ + value: event.loaded, + max: event.total, + }); + } + + // If it's finished sending all data to the first Tor node, remove cancel button + // and update the status + if(event.loaded == event.total) { + $('.cancel', ajax.$upload_div).remove(); + $('.upload-status', ajax.$upload_div).html(' Waiting for data to finish traversing Tor network ...'); + } + }, false); + + ajax.addEventListener('load', function(event){ + // Remove the upload div + ajax.$upload_div.remove(); + + // Parse response + try { + var response = JSON.parse(ajax.response); + + // The 'new_body' response replaces the whole HTML document and ends + if('new_body' in response) { + $('body').html(response['new_body']); + return; + } + + // Show error flashes + if('error_flashes' in response) { + for(var i=0; i +
    + +
    educational-video.mp4, secret-plans.pdf
    +
    Sending to first Tor node ...
    +
    + + */ + var $progress = $('').attr({ value: '0', max: 100 }); + var $cancel_button = $('').addClass('cancel').attr({ type: 'button', value: 'Cancel' }); + var $upload_filename = $('
    ').addClass('upload-filename').text(filenames.join(', ')); + var $upload_status = $('
    ').addClass('upload-status').text('Sending data to initial Tor node ...'); + + var $upload_div = $('
    ') + .addClass('upload') + .append( + $('
    ').addClass('upload-meta') + .append($cancel_button) + .append($upload_filename) + .append($upload_status) + ) + .append($progress); + + $cancel_button.click(function(){ + // Abort the upload, and remove the upload div + ajax.abort(); + $upload_div.remove() + }); + + ajax.$upload_div = $upload_div; + $('#uploads').append($upload_div); + + // Send the request + ajax.open('POST', '/upload-ajax', true); + ajax.send(formData); + }); +}); diff --git a/cli/onionshare_cli/resources/static/js/send.js b/cli/onionshare_cli/resources/static/js/send.js new file mode 100644 index 00000000..43e9892d --- /dev/null +++ b/cli/onionshare_cli/resources/static/js/send.js @@ -0,0 +1,75 @@ +// Function to convert human-readable sizes back to bytes, for sorting +function unhumanize(text) { + var powers = {'b': 0, 'k': 1, 'm': 2, 'g': 3, 't': 4}; + var regex = /(\d+(?:\.\d+)?)\s?(B|K|M|G|T)?/i; + var res = regex.exec(text); + if(res[2] === undefined) { + // Account for alphabetical words (file/dir names) + return text; + } else { + return res[1] * Math.pow(1024, powers[res[2].toLowerCase()]); + } +} +function sortTable(n) { + var table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0; + table = document.getElementById("file-list"); + switching = true; + // Set the sorting direction to ascending: + dir = "asc"; + /* Make a loop that will continue until + no switching has been done: */ + while (switching) { + // Start by saying: no switching is done: + switching = false; + rows = table.getElementsByTagName("TR"); + /* Loop through all table rows (except the + first, which contains table headers): */ + for (i = 1; i < (rows.length - 1); i++) { + // Start by saying there should be no switching: + shouldSwitch = false; + /* Get the two elements you want to compare, + one from current row and one from the next: */ + x = rows[i].getElementsByTagName("TD")[n]; + y = rows[i + 1].getElementsByTagName("TD")[n]; + /* Check if the two rows should switch place, + based on the direction, asc or desc: */ + if (dir == "asc") { + if (unhumanize(x.innerHTML.toLowerCase()) > unhumanize(y.innerHTML.toLowerCase())) { + // If so, mark as a switch and break the loop: + shouldSwitch= true; + break; + } + } else if (dir == "desc") { + if (unhumanize(x.innerHTML.toLowerCase()) < unhumanize(y.innerHTML.toLowerCase())) { + // If so, mark as a switch and break the loop: + shouldSwitch= true; + break; + } + } + } + if (shouldSwitch) { + /* If a switch has been marked, make the switch + and mark that a switch has been done: */ + rows[i].parentNode.insertBefore(rows[i + 1], rows[i]); + switching = true; + // Each time a switch is done, increase this count by 1: + switchcount ++; + } else { + /* If no switching has been done AND the direction is "asc", + set the direction to "desc" and run the while loop again. */ + if (switchcount == 0 && dir == "asc") { + dir = "desc"; + switching = true; + } + } + } +} + + +// Set click handlers +document.getElementById("filename-header").addEventListener("click", function(){ + sortTable(0); +}); +document.getElementById("size-header").addEventListener("click", function(){ + sortTable(1); +}); diff --git a/cli/onionshare_cli/resources/static/js/socket.io.min.js b/cli/onionshare_cli/resources/static/js/socket.io.min.js new file mode 100644 index 00000000..b622e1b9 --- /dev/null +++ b/cli/onionshare_cli/resources/static/js/socket.io.min.js @@ -0,0 +1,3 @@ +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.io=t()}}(function(){var t;return function e(t,n,r){function o(s,a){if(!n[s]){if(!t[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(i)return i(s,!0);throw new Error("Cannot find module '"+s+"'")}var p=n[s]={exports:{}};t[s][0].call(p.exports,function(e){var n=t[s][1][e];return o(n?n:e)},p,p.exports,e,t,n,r)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}},n.prototype.cleanup=function(){for(var t;t=this.subs.shift();)t.destroy();this.packetBuffer=[],this.encoding=!1,this.decoder.destroy()},n.prototype.close=n.prototype.disconnect=function(){this.skipReconnect=!0,this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},n.prototype.onclose=function(t){p("close"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()},n.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var t=this;if(this.backoff.attempts>=this._reconnectionAttempts)p("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var e=this.backoff.duration();p("will wait %dms before reconnect attempt",e),this.reconnecting=!0;var n=setTimeout(function(){t.skipReconnect||(p("attempting reconnect"),t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),t.skipReconnect||t.open(function(e){e?(p("reconnect attempt error"),t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",e.data)):(p("reconnect success"),t.onreconnect())}))},e);this.subs.push({destroy:function(){clearTimeout(n)}})}},n.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)}},{"./on":4,"./socket":5,"./url":6,backo2:7,"component-bind":8,"component-emitter":9,debug:10,"engine.io-client":11,indexof:42,"object-component":43,"socket.io-parser":46}],4:[function(t,e){function n(t,e,n){return t.on(e,n),{destroy:function(){t.removeListener(e,n)}}}e.exports=n},{}],5:[function(t,e,n){function r(t,e){this.io=t,this.nsp=e,this.json=this,this.ids=0,this.acks={},this.io.autoConnect&&this.open(),this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0}var o=t("socket.io-parser"),i=t("component-emitter"),s=t("to-array"),a=t("./on"),c=t("component-bind"),p=t("debug")("socket.io-client:socket"),u=t("has-binary");e.exports=n=r;var f={connect:1,connect_error:1,connect_timeout:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1},h=i.prototype.emit;i(r.prototype),r.prototype.subEvents=function(){if(!this.subs){var t=this.io;this.subs=[a(t,"open",c(this,"onopen")),a(t,"packet",c(this,"onpacket")),a(t,"close",c(this,"onclose"))]}},r.prototype.open=r.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"==this.io.readyState&&this.onopen(),this)},r.prototype.send=function(){var t=s(arguments);return t.unshift("message"),this.emit.apply(this,t),this},r.prototype.emit=function(t){if(f.hasOwnProperty(t))return h.apply(this,arguments),this;var e=s(arguments),n=o.EVENT;u(e)&&(n=o.BINARY_EVENT);var r={type:n,data:e};return"function"==typeof e[e.length-1]&&(p("emitting packet with ack id %d",this.ids),this.acks[this.ids]=e.pop(),r.id=this.ids++),this.connected?this.packet(r):this.sendBuffer.push(r),this},r.prototype.packet=function(t){t.nsp=this.nsp,this.io.packet(t)},r.prototype.onopen=function(){p("transport is open - connecting"),"/"!=this.nsp&&this.packet({type:o.CONNECT})},r.prototype.onclose=function(t){p("close (%s)",t),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",t)},r.prototype.onpacket=function(t){if(t.nsp==this.nsp)switch(t.type){case o.CONNECT:this.onconnect();break;case o.EVENT:this.onevent(t);break;case o.BINARY_EVENT:this.onevent(t);break;case o.ACK:this.onack(t);break;case o.BINARY_ACK:this.onack(t);break;case o.DISCONNECT:this.ondisconnect();break;case o.ERROR:this.emit("error",t.data)}},r.prototype.onevent=function(t){var e=t.data||[];p("emitting event %j",e),null!=t.id&&(p("attaching ack callback to event"),e.push(this.ack(t.id))),this.connected?h.apply(this,e):this.receiveBuffer.push(e)},r.prototype.ack=function(t){var e=this,n=!1;return function(){if(!n){n=!0;var r=s(arguments);p("sending ack %j",r);var i=u(r)?o.BINARY_ACK:o.ACK;e.packet({type:i,id:t,data:r})}}},r.prototype.onack=function(t){p("calling ack %s with %j",t.id,t.data);var e=this.acks[t.id];e.apply(this,t.data),delete this.acks[t.id]},r.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},r.prototype.emitBuffered=function(){var t;for(t=0;t0&&t.jitter<=1?t.jitter:0,this.attempts=0}e.exports=n,n.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-n:t+n}return 0|Math.min(t,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(t){this.ms=t},n.prototype.setMax=function(t){this.max=t},n.prototype.setJitter=function(t){this.jitter=t}},{}],8:[function(t,e){var n=[].slice;e.exports=function(t,e){if("string"==typeof e&&(e=t[e]),"function"!=typeof e)throw new Error("bind() requires a function");var r=n.call(arguments,2);return function(){return e.apply(t,r.concat(n.call(arguments)))}}},{}],9:[function(t,e){function n(t){return t?r(t):void 0}function r(t){for(var e in n.prototype)t[e]=n.prototype[e];return t}e.exports=n,n.prototype.on=n.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks[t]=this._callbacks[t]||[]).push(e),this},n.prototype.once=function(t,e){function n(){r.off(t,n),e.apply(this,arguments)}var r=this;return this._callbacks=this._callbacks||{},n.fn=e,this.on(t,n),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks[t];if(!n)return this;if(1==arguments.length)return delete this._callbacks[t],this;for(var r,o=0;or;++r)n[r].apply(this,e)}return this},n.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks[t]||[]},n.prototype.hasListeners=function(t){return!!this.listeners(t).length}},{}],10:[function(t,e){function n(t){return n.enabled(t)?function(e){e=r(e);var o=new Date,i=o-(n[t]||o);n[t]=o,e=t+" "+e+" +"+n.humanize(i),window.console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}:function(){}}function r(t){return t instanceof Error?t.stack||t.message:t}e.exports=n,n.names=[],n.skips=[],n.enable=function(t){try{localStorage.debug=t}catch(e){}for(var r=(t||"").split(/[\s,]+/),o=r.length,i=0;o>i;i++)t=r[i].replace("*",".*?"),"-"===t[0]?n.skips.push(new RegExp("^"+t.substr(1)+"$")):n.names.push(new RegExp("^"+t+"$"))},n.disable=function(){n.enable("")},n.humanize=function(t){var e=1e3,n=6e4,r=60*n;return t>=r?(t/r).toFixed(1)+"h":t>=n?(t/n).toFixed(1)+"m":t>=e?(t/e|0)+"s":t+"ms"},n.enabled=function(t){for(var e=0,r=n.skips.length;r>e;e++)if(n.skips[e].test(t))return!1;for(var e=0,r=n.names.length;r>e;e++)if(n.names[e].test(t))return!0;return!1};try{window.localStorage&&n.enable(localStorage.debug)}catch(o){}},{}],11:[function(t,e){e.exports=t("./lib/")},{"./lib/":12}],12:[function(t,e){e.exports=t("./socket"),e.exports.parser=t("engine.io-parser")},{"./socket":13,"engine.io-parser":25}],13:[function(t,e){(function(n){function r(t,e){if(!(this instanceof r))return new r(t,e);if(e=e||{},t&&"object"==typeof t&&(e=t,t=null),t&&(t=u(t),e.host=t.host,e.secure="https"==t.protocol||"wss"==t.protocol,e.port=t.port,t.query&&(e.query=t.query)),this.secure=null!=e.secure?e.secure:n.location&&"https:"==location.protocol,e.host){var o=e.host.split(":");e.hostname=o.shift(),o.length?e.port=o.pop():e.port||(e.port=this.secure?"443":"80")}this.agent=e.agent||!1,this.hostname=e.hostname||(n.location?location.hostname:"localhost"),this.port=e.port||(n.location&&location.port?location.port:this.secure?443:80),this.query=e.query||{},"string"==typeof this.query&&(this.query=h.decode(this.query)),this.upgrade=!1!==e.upgrade,this.path=(e.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!e.forceJSONP,this.jsonp=!1!==e.jsonp,this.forceBase64=!!e.forceBase64,this.enablesXDR=!!e.enablesXDR,this.timestampParam=e.timestampParam||"t",this.timestampRequests=e.timestampRequests,this.transports=e.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.callbackBuffer=[],this.policyPort=e.policyPort||843,this.rememberUpgrade=e.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=e.onlyBinaryUpgrades,this.pfx=e.pfx||null,this.key=e.key||null,this.passphrase=e.passphrase||null,this.cert=e.cert||null,this.ca=e.ca||null,this.ciphers=e.ciphers||null,this.rejectUnauthorized=e.rejectUnauthorized||null,this.open()}function o(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}var i=t("./transports"),s=t("component-emitter"),a=t("debug")("engine.io-client:socket"),c=t("indexof"),p=t("engine.io-parser"),u=t("parseuri"),f=t("parsejson"),h=t("parseqs");e.exports=r,r.priorWebsocketSuccess=!1,s(r.prototype),r.protocol=p.protocol,r.Socket=r,r.Transport=t("./transport"),r.transports=t("./transports"),r.parser=t("engine.io-parser"),r.prototype.createTransport=function(t){a('creating transport "%s"',t);var e=o(this.query);e.EIO=p.protocol,e.transport=t,this.id&&(e.sid=this.id);var n=new i[t]({agent:this.agent,hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:e,forceJSONP:this.forceJSONP,jsonp:this.jsonp,forceBase64:this.forceBase64,enablesXDR:this.enablesXDR,timestampRequests:this.timestampRequests,timestampParam:this.timestampParam,policyPort:this.policyPort,socket:this,pfx:this.pfx,key:this.key,passphrase:this.passphrase,cert:this.cert,ca:this.ca,ciphers:this.ciphers,rejectUnauthorized:this.rejectUnauthorized});return n},r.prototype.open=function(){var t;if(this.rememberUpgrade&&r.priorWebsocketSuccess&&-1!=this.transports.indexOf("websocket"))t="websocket";else{if(0==this.transports.length){var e=this;return void setTimeout(function(){e.emit("error","No transports available")},0)}t=this.transports[0]}this.readyState="opening";var t;try{t=this.createTransport(t)}catch(n){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)},r.prototype.setTransport=function(t){a("setting transport %s",t.name);var e=this;this.transport&&(a("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",function(){e.onDrain()}).on("packet",function(t){e.onPacket(t)}).on("error",function(t){e.onError(t)}).on("close",function(){e.onClose("transport close")})},r.prototype.probe=function(t){function e(){if(h.onlyBinaryUpgrades){var e=!this.supportsBinary&&h.transport.supportsBinary;f=f||e}f||(a('probe transport "%s" opened',t),u.send([{type:"ping",data:"probe"}]),u.once("packet",function(e){if(!f)if("pong"==e.type&&"probe"==e.data){if(a('probe transport "%s" pong',t),h.upgrading=!0,h.emit("upgrading",u),!u)return;r.priorWebsocketSuccess="websocket"==u.name,a('pausing current transport "%s"',h.transport.name),h.transport.pause(function(){f||"closed"!=h.readyState&&(a("changing transport and sending upgrade packet"),p(),h.setTransport(u),u.send([{type:"upgrade"}]),h.emit("upgrade",u),u=null,h.upgrading=!1,h.flush())})}else{a('probe transport "%s" failed',t);var n=new Error("probe error");n.transport=u.name,h.emit("upgradeError",n)}}))}function n(){f||(f=!0,p(),u.close(),u=null)}function o(e){var r=new Error("probe error: "+e);r.transport=u.name,n(),a('probe transport "%s" failed because of error: %s',t,e),h.emit("upgradeError",r)}function i(){o("transport closed")}function s(){o("socket closed")}function c(t){u&&t.name!=u.name&&(a('"%s" works - aborting "%s"',t.name,u.name),n())}function p(){u.removeListener("open",e),u.removeListener("error",o),u.removeListener("close",i),h.removeListener("close",s),h.removeListener("upgrading",c)}a('probing transport "%s"',t);var u=this.createTransport(t,{probe:1}),f=!1,h=this;r.priorWebsocketSuccess=!1,u.once("open",e),u.once("error",o),u.once("close",i),this.once("close",s),this.once("upgrading",c),u.open()},r.prototype.onOpen=function(){if(a("socket open"),this.readyState="open",r.priorWebsocketSuccess="websocket"==this.transport.name,this.emit("open"),this.flush(),"open"==this.readyState&&this.upgrade&&this.transport.pause){a("starting upgrade probes");for(var t=0,e=this.upgrades.length;e>t;t++)this.probe(this.upgrades[t])}},r.prototype.onPacket=function(t){if("opening"==this.readyState||"open"==this.readyState)switch(a('socket receive: type "%s", data "%s"',t.type,t.data),this.emit("packet",t),this.emit("heartbeat"),t.type){case"open":this.onHandshake(f(t.data));break;case"pong":this.setPing();break;case"error":var e=new Error("server error");e.code=t.data,this.emit("error",e);break;case"message":this.emit("data",t.data),this.emit("message",t.data)}else a('packet received with socket readyState "%s"',this.readyState)},r.prototype.onHandshake=function(t){this.emit("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.onOpen(),"closed"!=this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},r.prototype.onHeartbeat=function(t){clearTimeout(this.pingTimeoutTimer);var e=this;e.pingTimeoutTimer=setTimeout(function(){"closed"!=e.readyState&&e.onClose("ping timeout")},t||e.pingInterval+e.pingTimeout)},r.prototype.setPing=function(){var t=this;clearTimeout(t.pingIntervalTimer),t.pingIntervalTimer=setTimeout(function(){a("writing ping packet - expecting pong within %sms",t.pingTimeout),t.ping(),t.onHeartbeat(t.pingTimeout)},t.pingInterval)},r.prototype.ping=function(){this.sendPacket("ping")},r.prototype.onDrain=function(){for(var t=0;tn;n++)~c(this.transports,t[n])&&e.push(t[n]);return e}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./transport":14,"./transports":15,"component-emitter":9,debug:22,"engine.io-parser":25,indexof:42,parsejson:34,parseqs:35,parseuri:36}],14:[function(t,e){function n(t){this.path=t.path,this.hostname=t.hostname,this.port=t.port,this.secure=t.secure,this.query=t.query,this.timestampParam=t.timestampParam,this.timestampRequests=t.timestampRequests,this.readyState="",this.agent=t.agent||!1,this.socket=t.socket,this.enablesXDR=t.enablesXDR,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized}var r=t("engine.io-parser"),o=t("component-emitter");e.exports=n,o(n.prototype),n.timestamps=0,n.prototype.onError=function(t,e){var n=new Error(t);return n.type="TransportError",n.description=e,this.emit("error",n),this},n.prototype.open=function(){return("closed"==this.readyState||""==this.readyState)&&(this.readyState="opening",this.doOpen()),this},n.prototype.close=function(){return("opening"==this.readyState||"open"==this.readyState)&&(this.doClose(),this.onClose()),this},n.prototype.send=function(t){if("open"!=this.readyState)throw new Error("Transport not open");this.write(t)},n.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},n.prototype.onData=function(t){var e=r.decodePacket(t,this.socket.binaryType);this.onPacket(e)},n.prototype.onPacket=function(t){this.emit("packet",t)},n.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},{"component-emitter":9,"engine.io-parser":25}],15:[function(t,e,n){(function(e){function r(t){var n,r=!1,a=!1,c=!1!==t.jsonp;if(e.location){var p="https:"==location.protocol,u=location.port;u||(u=p?443:80),r=t.hostname!=location.hostname||u!=t.port,a=t.secure!=p}if(t.xdomain=r,t.xscheme=a,n=new o(t),"open"in n&&!t.forceJSONP)return new i(t);if(!c)throw new Error("JSONP disabled");return new s(t)}var o=t("xmlhttprequest"),i=t("./polling-xhr"),s=t("./polling-jsonp"),a=t("./websocket");n.polling=r,n.websocket=a}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./polling-jsonp":16,"./polling-xhr":17,"./websocket":19,xmlhttprequest:20}],16:[function(t,e){(function(n){function r(){}function o(t){i.call(this,t),this.query=this.query||{},a||(n.___eio||(n.___eio=[]),a=n.___eio),this.index=a.length;var e=this;a.push(function(t){e.onData(t)}),this.query.j=this.index,n.document&&n.addEventListener&&n.addEventListener("beforeunload",function(){e.script&&(e.script.onerror=r)},!1)}var i=t("./polling"),s=t("component-inherit");e.exports=o;var a,c=/\n/g,p=/\\n/g;s(o,i),o.prototype.supportsBinary=!1,o.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),i.prototype.doClose.call(this)},o.prototype.doPoll=function(){var t=this,e=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri(),e.onerror=function(e){t.onError("jsonp poll error",e)};var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n),this.script=e;var r="undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent);r&&setTimeout(function(){var t=document.createElement("iframe");document.body.appendChild(t),document.body.removeChild(t)},100)},o.prototype.doWrite=function(t,e){function n(){r(),e()}function r(){if(o.iframe)try{o.form.removeChild(o.iframe)}catch(t){o.onError("jsonp polling iframe removal error",t)}try{var e='