Showing with 11,415 additions and 5,756 deletions.
  1. +0 −5 .circleci/config.yml
  2. +6 −0 CHANGELOG.md
  3. +1 −1 README.md
  4. +2 −1 RELEASE.md
  5. +58 −3 cli/README.md
  6. +28 −73 cli/onionshare_cli/__init__.py
  7. +2 −4 cli/onionshare_cli/mode_settings.py
  8. +74 −70 cli/onionshare_cli/onion.py
  9. +3 −1 cli/onionshare_cli/onionshare.py
  10. +0 −21 cli/onionshare_cli/resources/templates/401.html
  11. +2 −2 cli/onionshare_cli/resources/templates/send.html
  12. +1 −1 cli/onionshare_cli/resources/version.txt
  13. +16 −16 cli/onionshare_cli/settings.py
  14. +2 −5 cli/onionshare_cli/web/chat_mode.py
  15. +7 −11 cli/onionshare_cli/web/receive_mode.py
  16. +1 −3 cli/onionshare_cli/web/send_base_mode.py
  17. +7 −11 cli/onionshare_cli/web/share_mode.py
  18. +37 −122 cli/onionshare_cli/web/web.py
  19. +260 −172 cli/poetry.lock
  20. +3 −4 cli/pyproject.toml
  21. +1 −1 cli/setup.py
  22. +1 −1 cli/tests/test_cli_common.py
  23. +1 −1 cli/tests/test_cli_settings.py
  24. +15 −79 cli/tests/test_cli_web.py
  25. +2 −2 desktop/pyproject.toml
  26. +3 −3 desktop/scripts/get-tor-osx.py
  27. +3 −3 desktop/scripts/get-tor-windows.py
  28. +25 −1 desktop/src/onionshare/__init__.py
  29. +3 −7 desktop/src/onionshare/resources/locale/af.json
  30. +0 −6 desktop/src/onionshare/resources/locale/am.json
  31. +26 −11 desktop/src/onionshare/resources/locale/ar.json
  32. +0 −6 desktop/src/onionshare/resources/locale/bg.json
  33. +27 −13 desktop/src/onionshare/resources/locale/bn.json
  34. +1 −9 desktop/src/onionshare/resources/locale/ca.json
  35. +1 −6 desktop/src/onionshare/resources/locale/ckb.json
  36. +17 −7 desktop/src/onionshare/resources/locale/cs.json
  37. +1 −9 desktop/src/onionshare/resources/locale/da.json
  38. +28 −16 desktop/src/onionshare/resources/locale/de.json
  39. +2 −5 desktop/src/onionshare/resources/locale/el.json
  40. +21 −12 desktop/src/onionshare/resources/locale/en.json
  41. +219 −0 desktop/src/onionshare/resources/locale/enm.json
  42. +0 −3 desktop/src/onionshare/resources/locale/eo.json
  43. +27 −15 desktop/src/onionshare/resources/locale/es.json
  44. +0 −6 desktop/src/onionshare/resources/locale/fa.json
  45. +32 −11 desktop/src/onionshare/resources/locale/fi.json
  46. +1 −9 desktop/src/onionshare/resources/locale/fr.json
  47. +21 −12 desktop/src/onionshare/resources/locale/ga.json
  48. +27 −12 desktop/src/onionshare/resources/locale/gl.json
  49. +0 −6 desktop/src/onionshare/resources/locale/gu.json
  50. +0 −6 desktop/src/onionshare/resources/locale/he.json
  51. +57 −29 desktop/src/onionshare/resources/locale/hi.json
  52. +2 −9 desktop/src/onionshare/resources/locale/hr.json
  53. +0 −6 desktop/src/onionshare/resources/locale/hu.json
  54. +1 −8 desktop/src/onionshare/resources/locale/id.json
  55. +26 −15 desktop/src/onionshare/resources/locale/is.json
  56. +1 −8 desktop/src/onionshare/resources/locale/it.json
  57. +1 −8 desktop/src/onionshare/resources/locale/ja.json
  58. +0 −6 desktop/src/onionshare/resources/locale/ka.json
  59. +0 −6 desktop/src/onionshare/resources/locale/km.json
  60. +0 −6 desktop/src/onionshare/resources/locale/ko.json
  61. +0 −6 desktop/src/onionshare/resources/locale/lg.json
  62. +26 −9 desktop/src/onionshare/resources/locale/lt.json
  63. +0 −6 desktop/src/onionshare/resources/locale/mk.json
  64. +0 −6 desktop/src/onionshare/resources/locale/ms.json
  65. +31 −15 desktop/src/onionshare/resources/locale/nb_NO.json
  66. +1 −8 desktop/src/onionshare/resources/locale/nl.json
  67. +0 −6 desktop/src/onionshare/resources/locale/pa.json
  68. +87 −68 desktop/src/onionshare/resources/locale/pl.json
  69. +27 −14 desktop/src/onionshare/resources/locale/pt_BR.json
  70. +1 −8 desktop/src/onionshare/resources/locale/pt_PT.json
  71. +0 −6 desktop/src/onionshare/resources/locale/ro.json
  72. +27 −14 desktop/src/onionshare/resources/locale/ru.json
  73. +1 −6 desktop/src/onionshare/resources/locale/si.json
  74. +1 −6 desktop/src/onionshare/resources/locale/sk.json
  75. +0 −6 desktop/src/onionshare/resources/locale/sl.json
  76. +0 −6 desktop/src/onionshare/resources/locale/sn.json
  77. +1 −8 desktop/src/onionshare/resources/locale/sr_Latn.json
  78. +27 −15 desktop/src/onionshare/resources/locale/sv.json
  79. +0 −6 desktop/src/onionshare/resources/locale/sw.json
  80. +0 −6 desktop/src/onionshare/resources/locale/te.json
  81. +27 −15 desktop/src/onionshare/resources/locale/tr.json
  82. +32 −19 desktop/src/onionshare/resources/locale/uk.json
  83. +0 −6 desktop/src/onionshare/resources/locale/wo.json
  84. +0 −6 desktop/src/onionshare/resources/locale/yo.json
  85. +26 −14 desktop/src/onionshare/resources/locale/zh_Hans.json
  86. +1 −8 desktop/src/onionshare/resources/locale/zh_Hant.json
  87. +17 −16 desktop/src/onionshare/tab/mode/__init__.py
  88. +0 −1 desktop/src/onionshare/tab/mode/chat_mode/__init__.py
  89. +0 −54 desktop/src/onionshare/tab/mode/mode_settings_widget.py
  90. +2 −4 desktop/src/onionshare/tab/mode/receive_mode/__init__.py
  91. +0 −1 desktop/src/onionshare/tab/mode/share_mode/__init__.py
  92. +0 −1 desktop/src/onionshare/tab/mode/website_mode/__init__.py
  93. +163 −38 desktop/src/onionshare/tab/server_status.py
  94. +12 −19 desktop/src/onionshare/tab/tab.py
  95. +1 −6 desktop/src/onionshare/threads.py
  96. +9 −3 desktop/src/onionshare/widgets.py
  97. +2 −2 desktop/src/org.onionshare.OnionShare.appdata.xml
  98. +1 −1 desktop/src/setup.py
  99. +96 −45 desktop/tests/gui_base_test.py
  100. +8 −21 desktop/tests/test_gui_chat.py
  101. +11 −51 desktop/tests/test_gui_receive.py
  102. +25 −110 desktop/tests/test_gui_share.py
  103. +8 −22 desktop/tests/test_gui_website.py
  104. +1 −1 docs/build.sh
  105. +2 −2 docs/check-weblate.py
  106. BIN docs/gettext/.doctrees/advanced.doctree
  107. BIN docs/gettext/.doctrees/develop.doctree
  108. BIN docs/gettext/.doctrees/environment.pickle
  109. BIN docs/gettext/.doctrees/features.doctree
  110. BIN docs/gettext/.doctrees/help.doctree
  111. BIN docs/gettext/.doctrees/index.doctree
  112. BIN docs/gettext/.doctrees/install.doctree
  113. BIN docs/gettext/.doctrees/security.doctree
  114. BIN docs/gettext/.doctrees/tor.doctree
  115. +25 −41 docs/gettext/advanced.pot
  116. +16 −16 docs/gettext/develop.pot
  117. +79 −71 docs/gettext/features.pot
  118. +2 −2 docs/gettext/help.pot
  119. +2 −2 docs/gettext/index.pot
  120. +24 −16 docs/gettext/install.pot
  121. +5 −5 docs/gettext/security.pot
  122. +2 −2 docs/gettext/sphinx.pot
  123. +3 −3 docs/gettext/tor.pot
  124. BIN docs/source/_static/screenshots/advanced-save-tabs.png
  125. BIN docs/source/_static/screenshots/advanced-schedule-start-timer.png
  126. BIN docs/source/_static/screenshots/advanced-schedule-stop-timer.png
  127. BIN docs/source/_static/screenshots/chat-sharing.png
  128. BIN docs/source/_static/screenshots/chat-torbrowser.png
  129. BIN docs/source/_static/screenshots/chat.png
  130. BIN docs/source/_static/screenshots/private-key.png
  131. BIN docs/source/_static/screenshots/receive-sharing.png
  132. BIN docs/source/_static/screenshots/receive-torbrowser.png
  133. BIN docs/source/_static/screenshots/receive.png
  134. BIN docs/source/_static/screenshots/settings.png
  135. BIN docs/source/_static/screenshots/share-files.png
  136. BIN docs/source/_static/screenshots/share-sharing.png
  137. BIN docs/source/_static/screenshots/share-torbrowser.png
  138. BIN docs/source/_static/screenshots/share.png
  139. BIN docs/source/_static/screenshots/tabs.png
  140. BIN docs/source/_static/screenshots/website-files.png
  141. BIN docs/source/_static/screenshots/website.png
  142. +23 −44 docs/source/advanced.rst
  143. +8 −5 docs/source/conf.py
  144. +63 −65 docs/source/develop.rst
  145. +26 −18 docs/source/features.rst
  146. +10 −3 docs/source/install.rst
  147. +15 −13 docs/source/locale/ar/LC_MESSAGES/features.po
  148. +13 −9 docs/source/locale/ar/LC_MESSAGES/help.po
  149. +178 −98 docs/source/locale/de/LC_MESSAGES/advanced.po
  150. +37 −34 docs/source/locale/de/LC_MESSAGES/develop.po
  151. +233 −146 docs/source/locale/de/LC_MESSAGES/features.po
  152. +15 −11 docs/source/locale/de/LC_MESSAGES/help.po
  153. +60 −39 docs/source/locale/de/LC_MESSAGES/install.po
  154. +119 −47 docs/source/locale/de/LC_MESSAGES/security.po
  155. +21 −20 docs/source/locale/de/LC_MESSAGES/tor.po
  156. +177 −98 docs/source/locale/el/LC_MESSAGES/advanced.po
  157. +18 −17 docs/source/locale/el/LC_MESSAGES/develop.po
  158. +262 −183 docs/source/locale/el/LC_MESSAGES/features.po
  159. +68 −49 docs/source/locale/el/LC_MESSAGES/install.po
  160. +107 −42 docs/source/locale/el/LC_MESSAGES/security.po
  161. +19 −18 docs/source/locale/el/LC_MESSAGES/tor.po
  162. +152 −63 docs/source/locale/en/LC_MESSAGES/advanced.po
  163. +33 −17 docs/source/locale/en/LC_MESSAGES/develop.po
  164. +292 −87 docs/source/locale/en/LC_MESSAGES/features.po
  165. +49 −19 docs/source/locale/en/LC_MESSAGES/install.po
  166. +129 −23 docs/source/locale/en/LC_MESSAGES/security.po
  167. +13 −2 docs/source/locale/en/LC_MESSAGES/tor.po
  168. +174 −95 docs/source/locale/es/LC_MESSAGES/advanced.po
  169. +18 −17 docs/source/locale/es/LC_MESSAGES/develop.po
  170. +236 −149 docs/source/locale/es/LC_MESSAGES/features.po
  171. +13 −9 docs/source/locale/es/LC_MESSAGES/help.po
  172. +60 −42 docs/source/locale/es/LC_MESSAGES/install.po
  173. +103 −38 docs/source/locale/es/LC_MESSAGES/security.po
  174. +19 −18 docs/source/locale/es/LC_MESSAGES/tor.po
  175. +363 −0 docs/source/locale/fi/LC_MESSAGES/advanced.po
  176. +271 −0 docs/source/locale/fi/LC_MESSAGES/develop.po
  177. +649 −0 docs/source/locale/fi/LC_MESSAGES/features.po
  178. +96 −0 docs/source/locale/fi/LC_MESSAGES/help.po
  179. +30 −0 docs/source/locale/fi/LC_MESSAGES/index.po
  180. +212 −0 docs/source/locale/fi/LC_MESSAGES/install.po
  181. +180 −0 docs/source/locale/fi/LC_MESSAGES/security.po
  182. +27 −0 docs/source/locale/fi/LC_MESSAGES/sphinx.po
  183. +289 −0 docs/source/locale/fi/LC_MESSAGES/tor.po
  184. +7 −7 docs/source/locale/fr/LC_MESSAGES/advanced.po
  185. +7 −7 docs/source/locale/fr/LC_MESSAGES/features.po
  186. +7 −7 docs/source/locale/fr/LC_MESSAGES/help.po
  187. +19 −9 docs/source/locale/fr/LC_MESSAGES/install.po
  188. +8 −6 docs/source/locale/ga/LC_MESSAGES/index.po
  189. +9 −7 docs/source/locale/ga/LC_MESSAGES/sphinx.po
  190. +206 −77 docs/source/locale/pl/LC_MESSAGES/advanced.po
  191. +111 −28 docs/source/locale/pl/LC_MESSAGES/develop.po
  192. +434 −111 docs/source/locale/pl/LC_MESSAGES/features.po
  193. +42 −15 docs/source/locale/pl/LC_MESSAGES/help.po
  194. +101 −31 docs/source/locale/pl/LC_MESSAGES/install.po
  195. +107 −32 docs/source/locale/pl/LC_MESSAGES/security.po
  196. +103 −18 docs/source/locale/pl/LC_MESSAGES/tor.po
  197. +210 −78 docs/source/locale/pt_BR/LC_MESSAGES/advanced.po
  198. +119 −31 docs/source/locale/pt_BR/LC_MESSAGES/develop.po
  199. +437 −110 docs/source/locale/pt_BR/LC_MESSAGES/features.po
  200. +34 −11 docs/source/locale/pt_BR/LC_MESSAGES/help.po
  201. +69 −54 docs/source/locale/pt_BR/LC_MESSAGES/install.po
  202. +105 −31 docs/source/locale/pt_BR/LC_MESSAGES/security.po
  203. +100 −19 docs/source/locale/pt_BR/LC_MESSAGES/tor.po
  204. +187 −107 docs/source/locale/ru/LC_MESSAGES/advanced.po
  205. +35 −33 docs/source/locale/ru/LC_MESSAGES/develop.po
  206. +257 −183 docs/source/locale/ru/LC_MESSAGES/features.po
  207. +14 −11 docs/source/locale/ru/LC_MESSAGES/help.po
  208. +89 −67 docs/source/locale/ru/LC_MESSAGES/install.po
  209. +133 −65 docs/source/locale/ru/LC_MESSAGES/security.po
  210. +70 −63 docs/source/locale/ru/LC_MESSAGES/tor.po
  211. +95 −264 docs/source/locale/sv/LC_MESSAGES/advanced.po
  212. +10 −6 docs/source/locale/sv/LC_MESSAGES/index.po
  213. +4 −4 docs/source/locale/sv/LC_MESSAGES/sphinx.po
  214. +186 −106 docs/source/locale/tr/LC_MESSAGES/advanced.po
  215. +32 −29 docs/source/locale/tr/LC_MESSAGES/develop.po
  216. +248 −168 docs/source/locale/tr/LC_MESSAGES/features.po
  217. +12 −9 docs/source/locale/tr/LC_MESSAGES/help.po
  218. +70 −49 docs/source/locale/tr/LC_MESSAGES/install.po
  219. +138 −68 docs/source/locale/tr/LC_MESSAGES/security.po
  220. +57 −50 docs/source/locale/tr/LC_MESSAGES/tor.po
  221. +182 −103 docs/source/locale/uk/LC_MESSAGES/advanced.po
  222. +39 −35 docs/source/locale/uk/LC_MESSAGES/develop.po
  223. +262 −182 docs/source/locale/uk/LC_MESSAGES/features.po
  224. +16 −12 docs/source/locale/uk/LC_MESSAGES/help.po
  225. +70 −48 docs/source/locale/uk/LC_MESSAGES/install.po
  226. +117 −48 docs/source/locale/uk/LC_MESSAGES/security.po
  227. +27 −26 docs/source/locale/uk/LC_MESSAGES/tor.po
  228. +3 −3 docs/source/security.rst
  229. +1 −1 docs/source/tor.rst
  230. +0 −27 flatpak/org.onionshare.OnionShare.yaml
  231. +11 −8 snap/snapcraft.yaml
5 changes: 0 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# To run the tests, CircleCI needs these environment variables:
# QT_EMAIL - email address for a Qt account
# QT_PASSWORD - password for a Qt account
# (Unfortunately you can't install Qt without logging in.)

version: 2
workflows:
version: 2
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# OnionShare Changelog

## 2.4

* Major feature: Private keys (v3 onion client authentication) replaces passwords and HTTP basic auth
* Updated Tor to 0.4.6.7 on all platforms
* Various bug fixes

## 2.3.3

* New feature: Setting for light or dark theme
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/onionshare/onionshare.svg?style=svg)](https://circleci.com/gh/onionshare/onionshare)
3 changes: 2 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Before making a release, you must update the version in these places:
- [ ] `cli/onionshare_cli/resources/version.txt`
- [ ] `desktop/pyproject.toml` (under `version` and **don't forget** the `./onionshare_cli-$VERSION-py3-none-any.whl` dependency)
- [ ] `desktop/src/setup.py`
- [ ] `desktop/src/org.onionshare.OnionShare.appdata.xml`
- [ ] `docs/source/conf.py` (`version` at the top, and the `versions` list too)
- [ ] `snap/snapcraft.yaml`

Expand Down Expand Up @@ -41,7 +42,7 @@ Finalize localization:

You also must edit these files:

- [ ] `desktop/src/org.onionshare.OnionShare.appdata.xml` should have the correct version, release date, and links to correct screenshots
- [ ] `desktop/src/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

Make sure snapcraft packaging works. In `snap/snapcraft.yaml`:
Expand Down
61 changes: 58 additions & 3 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,69 @@

## 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`.
First, make sure you have `tor` and `python3` installed. In Linux, install it through your package manager. In macOS, install it with [Homebrew](https://brew.sh): `brew install tor`. Second, OnionShare is written in python, and you can install the command line version use python's package manager `pip`.

Then install OnionShare CLI:
### Requirements

Debian/Ubuntu (APT):
```sh
pip install onionshare-cli
sudo apt-get install tor python3-pip
```

Arch (Pacman):
```sh
sudo pacman -S tor python-pip
```

CentOS, Red Hat, and Fedora (Yum):
```sh
sudo yum install tor python3 python3-wheel
```

macOS (Homebrew):
```sh
brew install tor python
sudo easy_install pip
```

### Main

#### Installation

Install OnionShare CLI:

```sh
pip install --user onionshare-cli
```

#### Set path

When you install programs with pip and use the --user flag, it installs them into ~/.local/bin, which isn't in your path by default. To add ~/.local/bin to your path automatically for the next time you reopen the terminal or source your shell configuration file, do the following:

First, discover what shell you are using:

```sh
echo $SHELL
```

Then apply the path to your shell file:

bash:

```sh
echo "PATH=\$PATH:~/.local/bin" >> ~/.bashrc
source ~/.bashrc
```

zsh:

```sh
echo "PATH=\$PATH:~/.local/bin" >> ~/.zshrc
source ~/.zshrc
```

#### Usage

Then run it with:

```sh
Expand Down
101 changes: 28 additions & 73 deletions cli/onionshare_cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@
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
Expand Down Expand Up @@ -113,7 +105,7 @@ def main(cwd=None):
action="store_true",
dest="public",
default=False,
help="Don't use a password",
help="Don't use a private key",
)
parser.add_argument(
"--auto-start-timer",
Expand All @@ -129,20 +121,6 @@ def main(cwd=None):
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(
"--no-autostop-sharing",
Expand Down Expand Up @@ -215,8 +193,6 @@ def main(cwd=None):
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 = not bool(args.no_autostop_sharing)
data_dir = args.data_dir
webhook_url = args.webhook_url
Expand All @@ -225,25 +201,9 @@ def main(cwd=None):
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)
Expand All @@ -254,18 +214,26 @@ def main(cwd=None):
if persistent_filename:
mode_settings = ModeSettings(common, persistent_filename)
mode_settings.set("persistent", "enabled", True)
mode_settings.set("persistent", "mode", mode)
else:
mode_settings = ModeSettings(common)

if receive:
mode = "receive"
elif website:
mode = "website"
elif chat:
mode = "chat"
else:
mode = "share"

if mode_settings.just_created:
# This means the mode settings were just created, not loaded from disk
mode_settings.set("general", "title", title)
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 persistent_filename:
mode_settings.set("persistent", "mode", mode)
if mode == "share":
mode_settings.set("share", "autostop_sharing", autostop_sharing)
if mode == "receive":
Expand Down Expand Up @@ -352,11 +320,6 @@ def main(cwd=None):
try:
common.settings.load()

if mode_settings.get("general", "public"):
web.password = None
else:
web.generate_password(mode_settings.get("onion", "password"))

# Receive mode needs to know the tor proxy details for webhooks
if mode == "receive":
if local_only:
Expand All @@ -381,7 +344,7 @@ def main(cwd=None):
sys.exit()

app.start_onion_service(mode, mode_settings, False)
url = build_url(mode_settings, app, web)
url = f"http://{app.onion_host}"
schedule = datetime.now() + timedelta(seconds=autostart_timer)
if mode == "receive":
print(
Expand All @@ -394,21 +357,21 @@ def main(cwd=None):
"what you are doing."
)
print("")
if mode_settings.get("general", "client_auth"):
if not mode_settings.get("general", "public"):
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')}"
f"Give this address and private key to your sender, and tell them it won't be accessible until: {schedule.strftime('%I:%M:%S%p, %b %d, %y')}"
)
print(app.auth_string)
print(f"Private key: {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"):
if not mode_settings.get("general", "public"):
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')}"
f"Give this address and private key 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)
print(f"Private key: {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')}"
Expand All @@ -426,7 +389,6 @@ def main(cwd=None):
sys.exit()
except (TorTooOldEphemeral, TorTooOldStealth, TorErrorProtocolError) as e:
print("")
print(e.args[0])
sys.exit()

if mode == "website":
Expand Down Expand Up @@ -458,21 +420,14 @@ def main(cwd=None):
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)
url = f"http://{app.onion_host}"

print("")
if autostart_timer > 0:
Expand All @@ -490,21 +445,21 @@ def main(cwd=None):
)
print("")

if mode_settings.get("general", "client_auth"):
print("Give this address and HidServAuth to the sender:")
if mode_settings.get("general", "public"):
print("Give this address to the sender:")
print(url)
print(app.auth_string)
else:
print("Give this address to the sender:")
print("Give this address and private key to the sender:")
print(url)
print(f"Private key: {app.auth_string}")
else:
if mode_settings.get("general", "client_auth"):
print("Give this address and HidServAuth line to the recipient:")
if mode_settings.get("general", "public"):
print("Give this address to the recipient:")
print(url)
print(app.auth_string)
else:
print("Give this address to the recipient:")
print("Give this address and private key to the recipient:")
print(url)
print(f"Private key: {app.auth_string}")
print("")
print("Press Ctrl+C to stop the server")

Expand Down
6 changes: 2 additions & 4 deletions cli/onionshare_cli/mode_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,15 @@ def __init__(self, common, filename=None, id=None):
self.default_settings = {
"onion": {
"private_key": None,
"hidservauth_string": None,
"password": None,
"client_auth_priv_key": None,
"client_auth_pub_key": None,
},
"persistent": {"mode": None, "enabled": False},
"general": {
"title": None,
"public": False,
"autostart_timer": False,
"autostop_timer": False,
"legacy": False,
"client_auth": False,
"service_id": None,
},
"share": {"autostop_sharing": True, "filenames": []},
Expand Down
Loading