Commit Graph

416 Commits

Author SHA1 Message Date
Micah Lee
02216f246b
Merge branch '285_systray_notifications' of https://github.com/mig5/onionshare into mig5-285_systray_notifications 2017-05-22 16:15:06 -07:00
Micah Lee
a513c8b6df
Don't load strings directly in the web module. It isn't needed anymore, and it's preventing tests from passing in travis-ci 2017-05-22 15:02:22 -07:00
Micah Lee
174c03e892
Remove version string from http response headers, to avoid any information disclosure about the sender's server 2017-05-22 14:58:23 -07:00
Micah Lee
e01716bca9
Merge branch '253-security-headers' of https://github.com/mig5/onionshare into mig5-253-security-headers 2017-05-22 14:56:32 -07:00
Miguel Jacq
3766a6048d
Add desktop notification messages on download events (via systray) 2017-05-22 16:47:23 +10:00
Miguel Jacq
16f4d5f3ca
use the actual OnionShare version as the Server header string 2017-05-21 10:30:37 +10:00
Miguel Jacq
38ee7fde21
Remove duplication of security headers 2017-05-21 10:03:18 +10:00
Miguel Jacq
3641f376b7
Reinstate the alternative method of shutting down the web server - necessary for clicking 'Stop sharing' from GUI 2017-05-20 17:37:12 +10:00
Miguel Jacq
6c52988842
Harden some response headers 2017-05-20 12:34:00 +10:00
Miguel Jacq
55cb3b78cf
Remove onionshare-gui symlink pointing to itself 2017-05-19 14:15:54 +10:00
Micah Lee
d3eeda887b
In bundled Tor mode, wait 2 full seconds before connecting to the Tor controller 2017-05-18 17:34:36 -07:00
Miguel Jacq
c875e923d2
Wait a bit longer before attempting to connect to the Tor controller 2017-05-19 09:45:54 +10:00
Micah Lee
1bbcd6f5ea
Update get-tor-osx.py to grab the Tor binary from Tor Browser 6.5.2 instead of 6.5.1, and make it retain the same directory structure in OnionShare as it uses in Tor Browser, including copying libevent-2.0.5.dylib, which was missing before (#385) 2017-05-18 11:22:50 -07:00
Miguel Jacq
8a1fad7a79
#345 - validate the readability of files before adding them 2017-05-18 18:09:49 +10:00
Micah Lee
d3a7eef95c
Catch errors that occur when connection_type is bundled_tor, but the tor process closes before it can connect 2017-05-17 12:00:42 -07:00
Micah Lee
010bddb066
When saving settings, if Tor settings changed or if Tor isn't connected, reboot the Onion object, so that it's always connected to Tor when using the app 2017-05-16 16:50:33 -07:00
Micah Lee
22fb34d50d
Fixed signal/slot/thread issue in TorConnectionDialog and TorConnectionThread, and updated the language of bundled Tor error messages 2017-05-16 13:09:27 -07:00
Micah Lee
18ba940669
Made Settings debug log less verbose 2017-05-16 13:01:57 -07:00
Micah Lee
852a6761ee
Make the Onion object poll the tor controller less frequently, now that the connection happens in a separate thread 2017-05-16 11:47:18 -07:00
Micah Lee
388202e1ea
Move connecting to Tor into its own separate thread 2017-05-16 11:44:34 -07:00
Micah Lee
9c166a07d2
Add debug logging to Onion, OnionShare, and Settings objects 2017-05-16 11:23:18 -07:00
Micah Lee
7003349873
Add log() method to onionshare.common, which logs to stdout if in debug mode 2017-05-16 11:12:55 -07:00
Micah Lee
1591888863
Renamed onionshare.helpers module to onionshare.common 2017-05-16 11:05:48 -07:00
Micah Lee
219c4351e1
Pass debug into the Onion and OnionShareGUI objects 2017-05-16 10:57:59 -07:00
Micah Lee
2ca92c52db
Move owernship of the TorConnetionDialog objection from __init__.py into the OnionShareGUI class, and make it so when the Tor connection gets canceled, OnionShare quits 2017-05-14 18:30:45 -07:00
Micah Lee
dc23946fe8
Fixed various issues introduced by creating an singleton Onion object and passing it into the OnionShare object 2017-05-14 17:21:13 -07:00
Micah Lee
984d3f9c11
Merge branch 'master' into tor-bundle-autoupdate 2017-04-18 16:07:46 -07:00
Micah Lee
2f426fb8b2
Merge branch 'tor-bundle' into autoupdate 2017-04-18 16:00:24 -07:00
Micah Lee
6d58d5dcff
Added support for bundled Tor in macOS 2017-04-18 15:12:24 -07:00
Micah Lee
90e82217e7 Onion calls tor_status_update_func much more frequently, which makes the GUI more responsive 2017-04-17 20:54:55 -07:00
Micah Lee
6c02984a98 Add an Onion exception for canceling connecting Tor 2017-04-17 20:49:06 -07:00
Micah Lee
71dc65edee Began making a TorConnectionDialog, which handles connecting to the Tor network 2017-04-17 20:26:35 -07:00
Micah Lee
9f43b7298c Move OnionShare object into its own file, so __init__ is just CLI logic 2017-04-17 19:28:51 -07:00
Micah Lee
593c9e9afe Make it so ctrl-c actually quits the CLI version 2017-04-17 19:22:40 -07:00
Micah Lee
6b5dfe62c0 Added helper function get_available_port(), and use it to avoid code duplication. Removed unused is_root() helper function. Refactored Onion object to not try to connect in the constructor. 2017-04-17 19:13:53 -07:00
Micah Lee
bb990ff574 Removed transparent_torification from the full app, and refactored OnionShare class to get passed in an Onion, and doesn't get passed in stealth. 2017-04-17 19:12:02 -07:00
Micah Lee
fa12784f8b Added Tor SOCKS address and port settings 2017-04-15 16:33:41 -07:00
Micah Lee
4b11bd00c5 Added autoupdate settings to Settings, and also to the settings dialog 2017-04-15 15:24:08 -07:00
Micah Lee
e4cdfa6c99 Make sure tor process is killed in a more robust manner, and also increase tor connection timeout to 45 seconds 2017-04-15 11:43:19 -07:00
Micah Lee
0ddcda1570 Don't use shell=true in subprocess, and instead hide the console window in Windows using the startupinfo arg 2017-04-15 11:34:03 -07:00
Micah Lee
9b3cee0878 Added support for bundled tor connection type in Windows, including using ports instead of socket files 2017-04-14 18:33:44 -07:00
Micah Lee
6200cb3b08
Increase Tor connection timeout to 30 seconds 2017-04-14 10:32:15 -07:00
Micah Lee
ffc2e23981
Connecting to Tor now times out of 10 seconds 2017-04-14 10:00:56 -07:00
Micah Lee
87e969fc4a
Change the settings to default to bundled connection type instead of automatic 2017-04-13 23:20:24 -07:00
Micah Lee
1fa88c3d07
Add Tor connection status to the main window status bar 2017-04-13 23:08:25 -07:00
Micah Lee
80d475f65b
In the settings dialog, show Tor connection status when the connection type is bundled 2017-04-13 22:56:47 -07:00
Micah Lee
169be518eb
Connecting to Tor in bundled mode now creates a temporary tor data dir, starts a new tor process, and connects to it. Also, refactored Settings dialog to allow Linux to use bundled tor as well 2017-04-13 22:22:34 -07:00
Micah Lee
da225ed7d1 Started to implement Bundled Tor connection settings 2017-04-08 18:10:17 -07:00
Micah Lee
848d8db34e Added close_after_first_download and use_stealth to settings, and also to the GUI settings dialog 2017-04-08 13:42:07 -07:00
Micah Lee
6c074e4e3e
In Whonix, listen on 0.0.0.0 instead of 127.0.0.1 (#220) 2017-02-22 18:42:41 -08:00
Micah Lee
34301d3088
Catch Tor protocol error exceptions when starting an onion service (#344) 2017-02-22 16:45:52 -08:00
Micah Lee
1336a1c3b4
Update comments to be more accurate 2017-02-22 15:28:06 -08:00
Micah Lee
6370139d2e
Rip out support for non-ephemeral onion services 2017-02-22 14:10:06 -08:00
Micah Lee
a57703cb5a
Properly handle KeyboardInterrupt exception in CLI in macOS 2017-02-22 13:35:34 -08:00
Micah Lee
248f59cbd1
Renamed 'resources' to 'share', and updated location of 'share' files in OSX/Win binaries 2017-02-21 16:59:14 -08:00
Micah Lee
6f5a3aedbb
Update helpers.get_resource_path to correctly find resources in frozen macOS app bundles 2017-02-21 14:34:34 -08:00
Micah Lee
12acb893f8
Add new AuthenticationFailure exception, and make the Onion/stem code catch more exceptions when connecting to a Tor controller 2017-01-07 17:31:26 -08:00
Micah Lee
db052ce85f
Moved onionshare and onionshare_gui logic directly into __init__.py files 2017-01-06 19:00:08 -08:00
Micah Lee
f8005a63ea
Change GPL copyright from 2016 to 2017 2017-01-06 18:58:15 -08:00
Micah Lee
f14b5ebfa1
Catch exceptions for guessing default Tor Browser socket file path 2017-01-06 11:54:42 -08:00
Micah Lee
d069cc2a29
Guess the default socket file path for new versions of Tor Browser in OS X 2017-01-06 11:46:41 -08:00
Garrett Robinson
406fffdb39 Make render_template_string autoescape by default in Flask versions < 0.11 2016-12-30 13:04:19 -05:00
Garrett Robinson
bfbf006c57 Revert "Added a function to remove HTML from file and directory names"
This reverts commit 11c5f5b699.
2016-12-30 12:04:09 -05:00
Garrett Robinson
e1f9957f56 Revert "Replaced sanitize_html() function that was based on regex with python3's html.escape()"
This reverts commit cff11cd7e4.
2016-12-30 12:02:40 -05:00
Micah Lee
50835b67f8
You must connect to a socket file instead of a port for Tor Browser 6.5a6. Make automatic settings fallback to socket file if the port doesn't work (only for Linux so far, have not tested in OS X, and is not supported in Windows) 2016-12-29 13:36:29 -08:00
Micah Lee
a0abab3653
Make automatic settings work with with Tor Browser 6.0.8 2016-12-29 12:57:58 -08:00
Micah Lee
ebf13cfa11
Handle new Tor controller errors in CLI 2016-12-29 10:16:20 -08:00
Micah Lee
b8e797049b
Display information about tor when testing settings is successful 2016-12-29 10:03:29 -08:00
Micah Lee
19d020f245
Onion now connects to the Tor controller using the settings in Settings (except automatic still needs some work), and the settings dialog handles error when testing settings 2016-12-29 09:58:13 -08:00
Micah Lee
5bfa4da648
Refactor Settings object so it does not load from file by default. Make it so you can pass a Settings into Onion, to test settings 2016-12-29 08:02:32 -08:00
Micah Lee
9462b7d05f
Clicking Save in the settings dialog saves settings 2016-12-28 20:03:32 -08:00
Micah Lee
c9607cf986
Remove wrong comment 2016-12-28 19:53:02 -08:00
Micah Lee
25109c8a66
Created a Settings object, which loads and saves settings to file, and made the Settings dialog use the settings from this object 2016-12-28 19:52:21 -08:00
Sigma
7fe9f3be13 Support stem versions older than 1.5.0 again. Fix for issue #332 2016-12-25 22:27:47 -08:00
Micah Lee
6eed7258a7
Properly handle errors for using stealth onion services in the GUI, instead of crashing in the background (#144) 2016-12-23 19:08:18 -08:00
Micah Lee
6fdef85878
Catch all exceptions when checking for stealth support, not just TypeError, to successfully identity old versions of stem 2016-12-22 17:07:01 -08:00
Micah Lee
eff0d3729a
Add support for stealth onion services in CLI version 2016-12-22 16:56:39 -08:00
Micah Lee
fd41eac48d
Added dev scripts for launching onionshare and onionshare-gui from the source code tree, without having to install it 2016-12-22 16:19:54 -08:00
Micah Lee
eb00a29ca7
Merge branch 'master' of https://github.com/eightnoteight/onionshare into eightnoteight-master
Conflicts:
	onionshare/web.py
	onionshare_gui/onionshare_gui.py
	resources/locale/cs.json
	resources/locale/eo.json
	resources/locale/nl.json

This merge required quite a bit of refactoring because.
2016-12-22 16:00:06 -08:00
Micah Lee
e46c4f510a
Add support for Tor control port authentication 2016-12-22 13:39:32 -08:00
Micah Lee
05e25b120a
Merge branch 'shutdowncrashfix' of https://github.com/b3sigma/onionshare into b3sigma-shutdowncrashfix 2016-12-21 23:08:33 -08:00
Micah Lee
cff11cd7e4
Replaced sanitize_html() function that was based on regex with python3's html.escape() 2016-12-21 22:56:15 -08:00
Sigma
58d8f55a63 Fix crash when tor is closed first and then onionshare is closed and a stem.SocketClosed exception is raised. 2016-12-20 01:44:20 -08:00
Emmanuel Morales
11c5f5b699 Added a function to remove HTML from file and directory names 2016-12-18 21:07:38 -08:00
xSmurf
4f464aaf2c Only check if we are in the sys prefix but not the actual executable name as this could be renamed or wrapped 2016-09-28 17:24:28 +00:00
anonym
c74d892968 Try to get the Tor ControlPort from the environment.
... via the TOR_CONTROL_PORT variable. If set, onionshare will only
try this port.
2016-09-22 14:10:24 +02:00
Micah Lee
76937d5cb5
Move imports to module level 2016-09-06 13:17:55 -07:00
Micah Lee
7a46336149
Enable stdout in Windows, OSX CLI versions (#305) 2016-09-06 12:09:10 -07:00
Micah Lee
e093c7298a Disable writing to stdout in Windows (fixes #304) 2016-09-06 18:44:35 -07:00
Micah Lee
7ab936cec2
Prevent canceling download from being confused with rate limit attacker 2016-09-06 10:18:50 -07:00
Micah Lee
87761c6fce
Remove HSDirError exception, because it is no longer thrown 2016-09-05 11:32:30 -07:00
Micah Lee
360fb6cfcc
Refactor onionshare CLI to use await_publication=True when using ephemeral onion services, instead of relying on wait_for_hs function 2016-09-05 11:29:12 -07:00
Micah Lee
1372239ed7
Renamed hs to onion 2016-09-05 11:16:54 -07:00
Micah Lee
db9d81ba90
Migrate from PyInstaller to cx_Freeze for OSX 2016-09-04 19:21:09 -07:00
Micah Lee
bba46e088f
Merge branch 'master' into cx_Freeze 2016-09-04 17:23:27 -07:00
Micah Lee
dbf4af02ac Pass helpers into strings.load_strings instead of importing it, so fix issue with cx_Freeze in Windows 2016-09-04 20:09:18 -07:00
Micah Lee
7e8b3e1750 Oops, use spaces instead of tabs 2016-09-04 20:08:36 -07:00
Micah Lee
8e8ea9c357 Added resources to cx_Freeze setup, and make those resources findable by the app 2016-09-04 19:54:45 -07:00
Micah Lee
310d861ce0
Stop saying 'hidden service', start saying 'onion service' 2016-09-04 17:23:06 -07:00
Srinivas Devaki
c570d7ea77 added progress bar for zipping files 2016-08-24 01:43:21 +05:30
Micah Lee
62e7035d3d
Tweaked Spanish locale and typo in comment, thanks to kant (#269, #270) 2016-06-10 17:24:44 -07:00
Micah Lee
7f438052c6 Merge pull request #288 from mscherer/fix_cve
Fix CVE-2016-5026
2016-06-10 17:18:36 -07:00
Micah Lee
185006d662 Merge pull request #280 from jvoisin/pep8
Improve pep8 conformance
2016-06-10 17:14:11 -07:00
Michael Scherer
70c55511b1 Fix CVE-2016-5026
See http://www.openwall.com/lists/oss-security/2016/05/23/5 for details
on a potential convoluted attack. Basically,  /tmp/onionshare is
a predictable name, which mean that a local attacker
could precreate it on a shared server and later mess with the hidden
service operations in various way.
2016-05-23 20:45:07 +02:00
jvoisin
17e389b800 Improve pep8 conformance 2016-04-18 01:40:17 +02:00
jvoisin
3d13c1aa27 Simplify get_resource_path 2016-04-18 01:12:59 +02:00
Micah Lee
db1ed7c6de Fix issue with shutting down Flask server when not using --local-only (#238) 2016-04-12 17:04:19 -07:00
Micah Lee
d35b5a9acd Added rate-limiting to GUI. After 20 404 errors, server automatically stops (#238) 2016-04-12 16:49:46 -07:00
Micah Lee
b47ef630d5 Replace onionshare slug with 2-words from securedrop diceware list (#238) 2016-04-12 16:29:11 -07:00
Micah Lee
c07f4e5f83 If "Stop sharing automatically" is selected, only allow one download at a time (fixes #248) 2016-04-12 15:59:49 -07:00
Micah Lee
0b588e543a Fix PyInstaller to point to new resources directory, for OSX and Windows 2016-04-12 15:21:47 -07:00
Micah Lee
e81f809882 Move all resources (locale, images, html, version.txt) into central resources dir, and clean up logic to find absolute paths to resources 2016-04-12 15:14:02 -07:00
Micah Lee
e8ce6b1c54 Make helpers.get_pyinstaller_resource_path work when package is not frozen, and make tests report real platform to get accurate paths 2016-04-12 10:43:28 -07:00
Micah Lee
ef5665b050 Switched from py2app to PyInstaller for Windows. Renamed version to version.txt, to avoid Windows namespace collision with version.dll. 2016-04-11 23:25:40 -07:00
Micah Lee
7b8e9e1e6f Closing the GUI window causes any current download to stop immediately (fixes #262) 2016-04-10 17:43:37 -07:00
Micah Lee
00d1e29333 Switch from py2app to PyInstaller 2016-04-10 14:20:18 -07:00
Micah Lee
3ed1f964cb Choose ports in range 17600-17650, so Tails can whitelist them (#220) 2016-02-27 18:03:42 +01:00
Micah Lee
683610e962 Update copyright year to 2016 2016-02-15 22:37:28 -08:00
Micah Lee
deac54db92 Made sure switch to python3 and Qt5 works in OSX (#261). Updated OSX instructions in BUILD.md. 2016-02-12 15:45:26 -08:00
Micah Lee
170811f450 Porting onionshare from python2 to python3 (#261). This commit only ports the CLI version, not the GUI. Has not been tested in Fedora, Windows, or OSX. Removed hack to make unicode filenames work because hack does not work in python3. Replaced constant_time_compare function with a new one that works in python3. Tweaked hidden service checking code because urllib is different in python3. 2016-02-12 14:34:19 -08:00
Micah Lee
b2bda8294a Create new slug each time onionshare server is started (#247). This required making removing check_slug_candidate as a decorator and calling it inside functions that needed it instead. 2016-02-12 11:56:35 -08:00
Micah Lee
e199946a8d Display version string automatically in CLI, and in the status bar in GUI (#251) 2016-02-12 11:00:35 -08:00
Micah Lee
3c3ea6faf3 Merge branch 'eta' of https://github.com/garrettr/onionshare into garrettr-eta 2016-02-12 08:36:46 -08:00
Garrett Robinson
ea47e80f14 Add estimated time remaining to progress indicator
Estimates the time remaining for each download and displays it in the
progress bar. Waits for 10 seconds before showing the progress bar to
allow the download rate to stabilize, which prevents the estimated time
remaining from jumping all over the place at the start of the download
(a.k.a the "Windows copy dialog experience"). If your download takes
less than 10 seconds, you don't really need to see an ETA anyway.

This commit also refactors the Downloads class, splitting out the
download-specific functionality into a new Download class, providing
better encapsulation. As a result, I was able to simplify the call to
`update_download` because it was no longer necessary to pass the
`total_bytes` (which don't change after the download has begun).

Tested on Mac OS 10.9.
2015-12-23 01:05:30 -05:00
Garrett Robinson
9d5ba9b4f6 Revert to using wait_for_hs for ephemeral HS
Using `await_publication = True` blocks inside stem until the hidden
service is published, which makes OnionShare appear to hang. This is a
quick fix that reverts to using `wait_for_hs` for ephemeral hidden
services (as well as non-ephemeral hidden services), which avoids
blocking OnionShare.
2015-12-22 23:09:30 -05:00
Micah Lee
e60a82ad22 Fixed crash in Windows, related to HS directory path and slashes 2015-12-07 23:47:13 -08:00
Micah Lee
d67d5010d1 Catch exception that occurs when stopping a web app that has not started (fixes #237) 2015-12-07 15:03:53 -08:00
Micah Lee
2ce32e2327 Make hidserv_dir a class variable so it can be cleaned up (fixes #232), and refactor _hsdic2list (#199) 2015-12-06 13:51:42 -08:00
Micah Lee
9723270794 Revert "Refactored non-ephemeral hidden services to use get_hidden_service_conf and set_hidden_service_conf rather than get_conf_map and set_options. So much cleaner this way. (fixes #216)"
I'm reverting this it's causing #232.

This reverts commit df8e4f6cd4.
2015-12-06 13:40:35 -08:00
Micah Lee
f4780813d6 Decorator is expecting argument to be named slug_candidate, not shutdown_slug_candidate (#200) 2015-12-04 13:17:45 -08:00
Micah Lee
9d1abf668a Merge branch 'slug_decorator' of https://github.com/pwplus/onionshare into pwplus-slug_decorator 2015-12-04 12:46:51 -08:00
Micah Lee
f2389cc602 Remove all language and localization from download page, to prevent leaking the sender's locale (fixes #228) 2015-12-04 12:43:12 -08:00
Micah Lee
e6e323fc9a Don't access self.hs when using --local-only 2015-12-04 12:37:51 -08:00
Micah Lee
df8e4f6cd4 Refactored non-ephemeral hidden services to use get_hidden_service_conf and set_hidden_service_conf rather than get_conf_map and set_options. So much cleaner this way. (fixes #216) 2015-11-20 17:47:42 -08:00
Micah Lee
8f8e38b11d Refactored _hsdic2list method. It it much easier to understand now. (fixes #199) 2015-11-20 14:20:29 -08:00
Micah Lee
76d65c678b Changed 404 page to just say "404" (fixes #225) 2015-11-20 12:50:34 -08:00
Micah Lee
35c1c9cbcb When looking for a Tor to use, prefer (in this order): Tor Browser, Tor Messenger, system Tor (fixes #215) 2015-11-20 12:43:08 -08:00
Will Plusnick
42d7dd4181 Add a decorator to check the slug
This commit will add a decorator to the check the slug rather than copy
and pasting the same lines of code at the begining of every route.
2015-11-16 02:09:51 -06:00
Micah Lee
dc58921187 Add docstrings to all classes and methods (fix #198) 2015-11-15 19:01:20 -08:00
Micah Lee
a5aff46050 Cleanup ephemeral hidden services 2015-11-15 16:26:44 -08:00
Micah Lee
fd39f84bff Merge branch 'master' into ephemeral
Conflicts:
	onionshare/helpers.py
	onionshare/onionshare.py
2015-11-15 15:35:59 -08:00
Micah Lee
34591b5634 Merge branch 'master' of https://github.com/jvoisin/onionshare into jvoisin-master
Conflicts:
	onionshare/socks.py
2015-11-08 15:53:41 -08:00
Micah Lee
d67ca2c406 Merge pull request #207 from lazlolazlolazlo/docstrings
Add some missing docstrings.
2015-11-08 12:44:30 -08:00
Micah Lee
55c4c0fac1 Updated onionshare-gui to support ephemeral hidden services 2015-09-08 18:12:24 -07:00
Micah Lee
82e0c4e122 No need to pass transparent_torification into wait_for_hs 2015-09-08 17:48:16 -07:00
Micah Lee
1a4cb26f5d Move wait_for_hs() function into the HS class 2015-09-08 17:42:08 -07:00
Micah Lee
629a70c249 Fixed call to create_ephemeral_hidden_service, and also await_publication=True to make the app.wait_for_hs() call obsolete 2015-09-08 17:28:23 -07:00
Micah Lee
eba6dbb843 Moved hidden service login into separate file. Prefer to use ephemeral hidden services now if they are available. Ephermal does not yet work, but old hidservdir still works. 2015-09-07 22:34:54 -07:00
Micah Lee
bbee1599c5 Updated copyright year to 2015 2015-09-07 21:48:49 -07:00
Micah Lee
5d37d9b7b2 Removed all of the Tails-specific code. If we use ephemeral hidden services, we no longer need to touch the filesystem, and hopefully no longer need root in Tails. 2015-09-07 21:44:29 -07:00