Commit Graph

656 Commits

Author SHA1 Message Date
Miguel Jacq
875b538347
Make auto-stop timer work on CLI when an upload is still in progress on expiry 2018-10-02 15:41:29 +10:00
Miguel Jacq
61d2e6cc5f
Try to fix logic handling last upload after timer expiry 2018-10-02 08:22:08 +10:00
Miguel Jacq
e9148ddb49
remove unused variable 2018-10-02 07:33:13 +10:00
Miguel Jacq
7d140f384f
remove uploads_in_progress list from web side 2018-10-01 19:18:50 +10:00
Miguel Jacq
9e14514d25
Another unused variable 2018-10-01 19:17:50 +10:00
Miguel Jacq
d104af11dc
remove unused variable, whitespace 2018-10-01 19:15:58 +10:00
Miguel Jacq
3f32db2cca
Fix logic for handling an upload still in progress when timer runs out. Show thankyou page for last uploader post-timer expiry 2018-10-01 18:42:53 +10:00
Miguel Jacq
f653e8cc04
Merge develop in and fix upload/timer functionality so that it works as described. Still needs fixing to not throw a connection error to the lucky last uploader after their upload completes and server stops due to expiry having passed 2018-10-01 16:42:54 +10:00
Miguel Jacq
7e8a76be8a
Load default settings before parsing for any alternate config. Reload strings if an alternate config was passed in after 2018-10-01 15:32:53 +10:00
Micah Lee
a1f5b5964a
Remove the useless gui=True arg getting passed intro strings._ all over the place 2018-09-30 17:47:10 -07:00
Micah Lee
c572ab996a
Fix tests 2018-09-30 17:35:58 -07:00
Micah Lee
60afaaf338
Make printing the settings filename as debug statement instead of print 2018-09-30 17:18:56 -07:00
Micah Lee
c4f776c42a
Set OnionShare language based on the locale stored in settings, and prompt user to restart OnionShare after changing their language 2018-09-30 17:06:29 -07:00
Micah Lee
9d5f9d18ed
Translate language names to their own language 2018-09-30 16:18:40 -07:00
Micah Lee
64a4428465
Make Settings.available_locales be a dictionary mapping locale codes to language names in that language 2018-09-30 15:01:02 -07:00
Micah Lee
d28f38b1a0
Add locale to Settings, and make it default to the system locale, or English 2018-09-30 14:45:21 -07:00
Micah Lee
4b3a68bb65
Got the indicator label to display in the correct location for share mode 2018-09-29 14:40:55 -07:00
Micah Lee
e87263353f
Added an indicator count for share mode 2018-09-28 19:54:46 -07:00
Micah Lee
9a05eef494
Slightly improve Downloads progress bar style, but still needs spacing 2018-09-28 19:05:26 -07:00
Micah Lee
a5b549770a
Got empty Downloads looking good 2018-09-28 18:30:32 -07:00
Micah Lee
c0e6968b2b
Attempting to redesign Downloads 2018-09-28 17:01:48 -07:00
Micah Lee
75153db11e
Keep trying ports until it finds a free one 2018-09-27 21:22:10 -07:00
Micah Lee
d3410e7843
Merge pull request #789 from mig5/show_v3_onion_support
Show whether Tor version supports next-gen onion support
2018-09-26 17:09:34 -07:00
Miguel Jacq
3ed04bf5ec
Show whether Tor version supports next-gen onion support 2018-09-25 15:26:19 +10:00
Miguel Jacq
d34364530d
Analyse the right file size to determine if the download has finished in the UI (in order to decide whether to stop server yet) 2018-09-25 14:40:10 +10:00
Micah Lee
a1cddeb9a9
Access .upload_count from the correct object after the web refactor 2018-09-21 17:42:36 -07:00
Micah Lee
4d125bd3dc
Actually tell the GUI the progess 2018-09-21 17:08:11 -07:00
Micah Lee
017a4ebe31
Merge branch 'develop' into 663_zip_away 2018-09-21 16:23:49 -07:00
Micah Lee
09ccbf4a60
Dynamically figure out the total size of the download based on the whether or not the client making the http request accepts gzip 2018-09-21 16:22:37 -07:00
Micah Lee
98fcf4d0ac
Remove the 'using_ephemeral' string 2018-09-21 15:11:18 -07:00
Micah Lee
eac4e44dc5
Remove no_filenames string, and instead display CLI usage if you don't specify filenames 2018-09-21 13:58:42 -07:00
Micah Lee
2a309af680
If only sharing one file, compress it with gzip, and serve it with gzip compression if the browser supports it 2018-09-21 12:29:23 -07:00
Micah Lee
98aae9d83b
Pass common into ShareModeWeb and ReceiveModeWeb 2018-09-21 11:41:49 -07:00
Micah Lee
28fd67cbcc
Move more mode-specific logic out of the Web class and into the approprate mode web classes 2018-09-21 11:36:19 -07:00
Micah Lee
a86681e903
Refactor the CLI main function to explicitly use 'share' or 'receive' mode 2018-09-21 11:19:36 -07:00
Micah Lee
cc9f646f8b
Refactor web even more to all of the share and receive web logic into ShareModeWeb and ReceiveModeWeb classes 2018-09-21 11:14:32 -07:00
Micah Lee
8ce90fdd60
Refactor web to push share and receive mode logic into their respective files 2018-09-20 23:58:27 -07:00
Micah Lee
71ea9bf29e
Split the web module into different files for receive mode and share mode logic 2018-09-20 23:43:04 -07:00
Micah Lee
603be8a02c
Make web a module, so I can split it into multiple files 2018-09-20 23:31:52 -07:00
Micah Lee
81fa5e052c
Only add the download_filename to cleanup_filenames (which get deleted) if the file is zipped up. Otherwise, OnionShare deletes the original file 2018-09-20 23:18:17 -07:00
Micah Lee
324538bdd3
When there is only 1 file being shared, don't zip it 2018-09-20 09:14:56 -07:00
Miguel Jacq
997e2f87ee
Throw a 403 on the index pages if the timer has run out but an upload is in progress 2018-09-20 11:33:37 +10:00
Miguel Jacq
abb270834b
Log the public_mode flag as well 2018-09-19 14:53:33 +10:00
Miguel Jacq
f45eae5768
Fix syntax for opening explorer and selecting the filename. Fix a bug in the downloads_dir for Windows (need to use a backslash) 2018-09-19 12:12:18 +10:00
Miguel Jacq
62804dfdce
Merge pull request #758 from micahflee/665_cancel_compression
Fix zip progress bar not canceling problem
2018-09-19 10:59:11 +10:00
Micah Lee
6da5ae84f7
Tor version must actually be 0.3.3.1 for ephemeral v3 onion services 2018-09-18 17:31:40 -07:00
Micah Lee
cc265491fd
Properly handle exceptions in CLI, and pass the actual exception message in TorErrorProtocolError exceptions 2018-09-18 17:17:25 -07:00
Micah Lee
5448c4f345
Remove some debug logs 2018-09-18 16:58:16 -07:00
Micah Lee
0234ff5f37
Set self.cancel_compression to false in the set_file_info() function instead of Web's constructor, so it gets reset every time 2018-09-18 16:28:54 -07:00
Micah Lee
c52c846227
Make Web.set_file_info return False on cancel 2018-09-18 13:42:13 -07:00
Micah Lee
174de57405
Refactor all of the threading.Threads into QThreads, and quit them all when canceling the server. When canceling the compression thread, specifically mass a cancel message into the Web and ZipWriter objects to make the bail out on compression early 2018-09-17 20:55:54 -07:00
Micah Lee
7c5d154519
Make separate function for comparing the slug and comparing the shutdown_slug, to prevent 404 errors on the shutdown request 2018-09-17 17:42:21 -07:00
Miguel Jacq
c3755389dd
Fix conflict 2018-09-18 10:26:16 +10:00
Micah Lee
6efc281fbb
Merge branch 'develop' into receiver-mode-gui 2018-09-17 16:15:08 -07:00
Micah Lee
359e470383
Make what's this links use the same string, and change their style 2018-09-17 16:11:52 -07:00
Miguel Jacq
7e875e021a
Remove unnecessary loop. Remove the Close route/setting which can DoS another running upload. Fix detecting whether any uploads are still in progress before terminating the service after timer expires. Don't register 404s for uploads after expiry has finished (throw a 403 instead)" 2018-09-18 08:36:07 +10:00
Miguel Jacq
b06fd8af26
Hold a share open if its timer hsa expired but a file is still uploading. Don't allow other uploads during this time 2018-09-17 17:42:04 +10:00
Micah Lee
f90e96e21a
Monkeypatch flask to suppress output that isn't applicable to OnionShare 2018-09-15 22:04:08 -07:00
Miguel Jacq
3a7ae401af
Fix conflicts 2018-09-16 13:37:22 +10:00
Micah Lee
9815c612eb
Check for public_mode in the check_slug_candidate function, to make 404 errors work again during public mode 2018-09-15 19:47:42 -07:00
Miguel Jacq
8bb75cc530
Fix conflict in tests 2018-09-15 12:07:01 +10:00
Micah Lee
8312058fcc
Merge branch 'develop' into receiver-mode-gui 2018-09-14 18:59:36 -07:00
Micah Lee
2605967011
Merge branch '685_use_dist_socks' of https://github.com/mig5/onionshare into mig5-685_use_dist_socks 2018-09-14 18:40:26 -07:00
Miguel Jacq
e54a1473ce
Don't check slug candidate in public mode 2018-09-15 11:36:34 +10:00
Miguel Jacq
25eed81b00
Fixing a future check for persistent v3 onions (still disabled for now) 2018-09-13 16:35:24 +10:00
Miguel Jacq
0b0eef7245
More clarity for the returned values in generate_v3_private_key(), also more consistent with generate_v2_private_key() 2018-09-13 12:29:48 +10:00
Miguel Jacq
8955ce0699
Refactor the onionkey stuff to be more like @maqp's revised version (thanks) 2018-09-13 12:21:38 +10:00
Miguel Jacq
45a5a2ae63
Use the distribution's PySocks module instead of our custom version 2018-09-04 14:26:47 +10:00
Miguel Jacq
11bf059015
Fix conflict from receiver-mode-gui branch 2018-09-04 11:48:39 +10:00
Micah Lee
f83aa3cffb
Merge branch 'receive_mode_styling' of https://github.com/mig5/onionshare into mig5-receive_mode_styling 2018-09-02 23:01:06 -07:00
Miguel Jacq
5c8b0d7796
Rather than hide persistence/stealth mode altogether if the Tor version is high enough for v3, give the user the option to 'use legacy v2 onions' in Settings dialog, so that they may continue to use persistence etc 2018-08-22 11:45:08 +10:00
Miguel Jacq
2de9359629
Introduce v3 onion support 2018-08-21 19:31:02 +10:00
Miguel Jacq
3b45f93dbe
Expand 'public mode' (optional slugs) to be possible for sharing too, not just receiving, with no rate-limiting/self-destruct on invalid routes. 2018-07-21 17:06:11 +10:00
Miguel Jacq
a830eb57fe
#691 remove meek_lite Amazon 2018-07-21 15:52:11 +10:00
Miguel Jacq
4092a65e0c
Improve styling of flash() messages by using categories, and style the closed.html. Replace references to 'Uploading' with 'Sending' for consistency 2018-07-17 11:45:14 +10:00
Miguel Jacq
69ae29272c
Fix minor spelling/grammar issues 2018-07-14 16:43:21 +10:00
Micah Lee
1ad68c46d4
Merge branch 'license' into develop 2018-06-18 19:29:03 -07:00
Micah Lee
9344fbd274
Update OnionShare copyright year to 2018 2018-06-17 16:53:44 -07:00
Micah Lee
96a680e05d
Improve the CLI output for receive mode 2018-05-20 15:20:21 -07:00
Micah Lee
d6ce902eb6
Only mark a file upload complete when it closes, which makes the open folder button appear 2018-05-20 13:13:06 -07:00
Micah Lee
18573ba49c
Remove REQUEST_UPLOAD_NEW_FILE_STARTED event, because it's not actually needed 2018-05-20 12:07:15 -07:00
Micah Lee
9857d9fce8
Make the receive.html template not use slugs if receive_public_mode is True, and fix some bugs with receive routes 2018-05-20 11:16:09 -07:00
Micah Lee
7a571764ef
Allow file uploads to finish, and improve uploads styling 2018-05-19 22:58:55 -07:00
Micah Lee
ee9c0d0abb
Refactor uploads GUI so that each upload POST has one progess bar, and a list of files, with partial styling 2018-05-19 22:36:08 -07:00
Micah Lee
caf87b8d96
Fix bug where ReceiveModeRequest was not recognizing an upload request if the POST included a slug when receive_public_mode == True 2018-05-19 21:20:51 -07:00
Micah Lee
db7d5a6552
Move downloads_dir validation into the /upload request in Web, and display an error in both CLI and GUI 2018-05-19 21:11:57 -07:00
Micah Lee
c23ab77a58
Move downloads dir validation into Common 2018-05-19 20:51:01 -07:00
Micah Lee
841e47b234
ReceiveModeRequest should only deal with upload_ids for upload requests, not for other requests 2018-05-08 13:35:50 -07:00
Micah Lee
eb3d6f2171
Start making Web events actually put Upload objects into Uploads 2018-05-07 23:07:11 -07:00
Micah Lee
591e97a57a
Make receive mode events just like share mode, and rename REQUEST_DOWNLOAD to REQUEST_SHARE 2018-05-07 22:15:29 -07:00
Micah Lee
4d5f1a34cd
Move all stylesheets definitions into Common, so now we no longer have blocks of css spread across the GUI code, and it's easier to re-use stylesheets 2018-05-07 16:21:22 -07:00
Micah Lee
7b25ae1d6b
Remove --shutdown-timeout as an option for onionshare_gui, since GUI options are set in the settings dialog. Also fixed a bug where --local-only and --shutdown-timeout were not compatible in onionshare CLI 2018-05-04 16:43:30 -07:00
Micah Lee
e32e850548
Fix stay_open regression bug. Before, it was closing automatically even when the setting wasn't set. Also, remove the --stay-open option from the GUI, since GUI settings are set in the settings dialog not cli args 2018-05-04 16:35:32 -07:00
Micah Lee
86f1fb223e
Add a few receive mode web tests, to test the receive_allow_receiver_shutdown and receive_public_mode settings 2018-04-29 18:19:00 -07:00
Micah Lee
7ec993d2e0
Implemented test: test_share_mode_close_after_first_download 2018-04-29 18:00:10 -07:00
Micah Lee
b6a15cf6c7
Display the URL without the slug for receive_public_mode in the CLI 2018-04-29 16:44:45 -07:00
Micah Lee
9a076635c5
Make the "download page loaded" and "upload page loaded" messages displayed as systray notifications instead of in the status bar, and make it work for Receive Mode 2018-04-29 16:41:05 -07:00
Micah Lee
4f89082f18
Add support for receive mode's "public mode", which doesn't use a slug. Still needs more testing 2018-04-29 16:33:48 -07:00
Micah Lee
6cfb7026da
Display desktop notification to the user when the receiver closes the server, and finish up closing the server 2018-04-29 15:49:18 -07:00
Micah Lee
996df24646
Make receive_allow_receiver_shutdown setting work 2018-04-29 15:34:11 -07:00
Micah Lee
6632a4b426
Add two new receive mode settings: receive_allow_receiver_shutdown and receive_public_mode 2018-04-28 21:08:53 -07:00
Micah Lee
1a4aaa70fa
Fix a race condition where the URL was sometimes getting copied to the clipboard before it was actually generated, causing a crash 2018-04-28 15:00:23 -07:00
Micah Lee
1456361566
Generalize the handling of Tor exceptions, more logging in Web 2018-04-28 13:59:36 -07:00
Micah Lee
406515085e
Fixed crash when starting recieve mode server 2018-04-27 23:19:46 -07:00
Micah Lee
c6a2cab529
Make Web's the REQUEST_ constants static attributes 2018-04-26 11:00:59 -07:00
Micah Lee
9e9f65572b
Instead of creating a Web object and passing it into OnionShareGui, now each mode creates its own separate Web object, instantiated in its own way 2018-04-26 09:30:53 -07:00
Micah Lee
4b957f3271
Merge branch 'receiver-mode' into receiver-mode-gui 2018-04-24 17:22:06 -07:00
Micah Lee
aa8c07c434
In CLI recieve mode, tell the user where to look for uploaded files 2018-04-24 17:18:18 -07:00
Micah Lee
b6b61f753d
Update GPL copyright year 2018-04-24 10:07:59 -07:00
Micah Lee
2ee7e74236
Remove the desktop notification setting -- everyone gets them now 2018-04-24 09:26:06 -07:00
Micah Lee
91536ea571
Fix a few bugs that I missed when merging in develop 2018-04-22 17:46:14 -07:00
Micah Lee
bd7305ab16
Add new WSGI middleware just to attach the Web object to environ, and improve the UI of file upload progress 2018-03-21 18:27:42 -07:00
Micah Lee
f7640416eb
Remove the WSGI middleware, because I'm solving the problem in a different way 2018-03-21 17:51:42 -07:00
Micah Lee
facd441caf
For receive mode, use a custom flask Request, and a custom TemporaryFile, in order to keep track of file upload progress 2018-03-21 17:34:11 -07:00
Micah Lee
aafa9b1543
Add WSGI middleware in order to capture the progress of POST request uploads 2018-03-19 02:25:22 -07:00
Micah Lee
fee1d49563
Fix bug with shutdown_slug 2018-03-14 08:33:25 -07:00
Micah Lee
72698a7247
Display a template after closing the server, and standardize the style of other simple templates 2018-03-14 08:30:14 -07:00
Micah Lee
01f86daf8f
In receive mode, allow uploader to close the server when they are done 2018-03-14 08:16:09 -07:00
Micah Lee
0b10e71547
Add receive mode warning, and print notification for each upload, in CLI mode 2018-03-14 07:35:04 -07:00
Micah Lee
01dd16d92f
Uploading files works in CLI 2018-03-14 04:03:50 -07:00
Micah Lee
000d9620c1
Add flash messages to receive template, and begin implementing upload POST 2018-03-13 05:50:26 -07:00
Micah Lee
8e82c07039
Fixed bug in validating downloads dir related to moving settings into common 2018-03-13 03:59:52 -07:00
Micah Lee
76d299a6c9
Move settings into the Common object, so the settings are available to all objects (including Web, which is required for receive mode) 2018-03-13 03:28:47 -07:00
Micah Lee
c2fecf8aa4
Fix tests after refactoring Common 2018-03-13 02:22:26 -07:00
Micah Lee
50409167d4
Completely refactor common to make a Common class, and pass that class down into all parts of the program 2018-03-08 10:18:31 -08:00
Micah Lee
49e352d131
Rename close_after_seconds class to ShutdownTimer 2018-03-08 05:50:23 -08:00
Micah Lee
2e6538b7f8
Move ZipWriter from common into web, because that's the only place it's used 2018-03-08 05:45:07 -08:00
Micah Lee
878dd4f880
In CLI, validate downloads_dir when starting in receive mode 2018-03-06 07:40:57 -08:00
Micah Lee
e980bc153b
Change default receive mode download directory to ~/OnionShare 2018-03-06 05:25:49 -08:00
Micah Lee
5d42e76eb8
Show different message for receive mode than for send mode 2018-03-06 03:24:17 -08:00
Micah Lee
649afa2fad
Move (optional) javascript into file, and use CSP to ban inline js 2018-03-06 03:17:54 -08:00
Micah Lee
4606a3ad3a
Stop using inline css, and reorganize static folder 2018-03-06 03:03:24 -08:00
Micah Lee
ce852fc60a
Create separate templates and static folder, and make the web app use both of these. Yay, now we have real static resources 2018-03-06 02:54:12 -08:00
Micah Lee
baede53632
Make separate template for send and receive mode 2018-03-06 02:06:44 -08:00
Micah Lee
fa9f714651
Make separate routes for send and receive modes 2018-03-06 01:50:43 -08:00
Micah Lee
4a0c6e8dcd
Refactor OnionShareGui to use new Web class 2018-03-06 00:56:40 -08:00
Micah Lee
0cec696055
Refactor web.py to move all the web logic into the Web class, and refactor onionshare (cli) to work with it -- but onionshare_gui is currently broken 2018-03-05 11:06:59 -08:00
Micah Lee
cd1a1d9638
Web needs to know about receive mode, not the OnionShare object 2018-03-05 08:48:04 -08:00
Micah Lee
383ccb94fc
Add downloads_dir to settings, make it default to ~/Downloads 2018-03-05 07:52:51 -08:00
Micah Lee
18ac830a9e
Add command line flag for receive mode 2018-03-05 07:45:10 -08:00
Micah Lee
49fa2805e7
Merge branch 'cancel_share' of https://github.com/mig5/onionshare into mig5-cancel_share 2018-02-25 16:14:59 -08:00
Miguel Jacq
096c202362
Add ability to cancel a share 2018-02-25 17:44:27 +11:00
Micah Lee
79b461d071
Merge branch 'develop' into 641_fix_images_windows 2018-02-24 19:40:23 -08:00
Micah Lee
3797e9e203
When using <img>, put the src in quotes. Otherwise the filename is likely to have spaces in it, and the <img> src will break. Also, in Windows use backslashes for local resources instead of forward slashes 2018-02-24 18:38:40 -08:00
Micah Lee
e76b1e0c28
Merge branch 'remove_platform_re' of https://github.com/delirious-lettuce/onionshare into delirious-lettuce-remove_platform_re 2018-02-24 17:56:35 -08:00
Miguel Jacq
cff267c09c Revert the cancel feature that causes issues at least on macOS (#637) 2018-02-25 12:31:32 +11:00
delirious-lettuce
641fec7c05 Remove use of re module by using str.endswith 2018-02-24 15:44:23 -07:00
Miguel Jacq
dface51dd0
Merge pull request #588 from micahflee/ux-update
Major user experience update
2018-02-25 08:27:46 +11:00
Micah Lee
bb3f18ee00
Merge branch 'develop' of https://github.com/irykoon/onionshare into irykoon-develop 2018-02-22 16:57:06 -08:00
Micah Lee
3d1c0eabc4
Merge branch 'develop' into mig5-info_widgets_download_info 2018-02-19 18:02:51 -08:00