88 Commits

Author SHA1 Message Date
Micah Lee
3d880afe7a Merge branch 'develop' of github.com:onionshare/onionshare into ros-fixes 2022-01-16 15:49:33 -08:00
Micah Lee
26ad8a22ad Solve obnoxious cx_Freeze issue that broke websockets by enforcing async_mode=gevent, and including the correct modules in the build 2021-12-21 16:55:59 -08:00
Micah Lee
c74c23d658 Enable websocket logs in verbose mode 2021-12-21 15:01:35 -08:00
Micah Lee
5f17b47d1a Fix permission denied error in Windows, which was introduced using tempfile.NamedTemporaryFile, by using a TemporaryDirectory instead 2021-12-21 14:28:23 -08:00
Miguel Jacq
e00db31de5 Force the MIME type for .js files to be text/javascript, to override silly OS databases/registries with incorrect settings, which Flask would otherwise depend on 2021-12-17 17:53:15 +11:00
Micah Lee
167f4a8cc1 Add temp file to cleanup list just once when its first created 2021-12-02 18:51:06 -08:00
Micah Lee
6c72e9e7a5 Fix CLI tests 2021-12-01 21:01:32 -08:00
Micah Lee
5322d4f037 Merge branch 'develop' into 1470_tempfiles 2021-12-01 20:37:45 -08:00
Micah Lee
2ff5f53c69 Explicitly cleanup temp files and dirs 2021-12-01 20:34:54 -08:00
Micah Lee
926359de3c Use NamedTemporaryFile instead of TemporaryFile, to fix crash when sharing one file 2021-12-01 20:10:51 -08:00
Saptak S
4df863ce4d Checks if username is ASCII string else throw an error 2021-11-30 01:19:29 +05:30
Saptak S
b525a190e9 Removes invisible whitespace characters from username in chat 2021-11-19 15:25:10 +05:30
Micah Lee
c80303df35 Use a NamedTemporaryFile instead of TemporaryFile for streamed gzip files 2021-11-18 20:17:39 -08:00
Micah Lee
9663f78147 Use high level tempfile classes that clean up after themselves 2021-11-18 20:03:18 -08:00
Micah Lee
c29ffdf9fa Merge branch 'advisory-fix-1' of github.com:onionshare/onionshare-ghsa-jh82-c5jw-pxpc into ros-fixes 2021-11-18 19:16:00 -08:00
Micah Lee
3641f829ff Merge branch 'chat-session-handling' of github.com:onionshare/onionshare-ghsa-gjj5-998g-v36v into ros-fixes 2021-11-18 19:15:24 -08:00
Saptak S
132bbb0db9 Refuses connection if another session is already active 2021-11-14 23:44:16 +05:30
Saptak S
e9e2afe2ee Adds username validation for socketio event handler as well 2021-11-14 23:28:17 +05:30
Saptak S
6031f36185 Renames message event to chat_message 2021-11-14 21:06:47 +05:30
Saptak S
7f846ae2fd Removed room from chat
- Uses the global room instead of adding and leaving room for users
- Removes the joining event and triggers connection status from
server as soon as a connection event is received in server side
2021-11-14 20:58:21 +05:30
Miguel Jacq
7c41721d42 Use microseconds for Receive Mode dir/file names 2021-11-09 12:30:48 +11:00
Miguel Jacq
ff45a5c76b Support sending a custom Content-Security-Policy header in Website mode 2021-11-08 16:31:05 +11:00
Saptak S
19da3d73a3 Removes trailing slash from directories inside directories 2021-09-04 20:41:22 +05:30
Micah Lee
78aa64aab9 Merge pull request #1416 from SaptakS/fix-chat-shutdown
Adds exception for ConnectionError in chat mode during shutdown
2021-09-03 13:23:43 -07:00
Saptak Sengupta
4f69e387e0 Merge pull request #1399 from easyteacher/develop
Make last_modified and if_date timezone-aware (Fix #1398)
2021-09-04 00:13:12 +05:30
Fushan Wen
8baad0eeb5 Make last_modified and if_date timezone-aware
Fix #1398
2021-09-03 00:07:48 +08:00
Saptak S
5d3a0cfa38 Adds exception for ConnectionError in chat mode during shutdown
The way flask-socketio stops a connection when running using
eventlet is by raising SystemExit to abort all the processes.
Hence the connections are closed and no response is returned
So I am just catching the ConnectionError to check if it was
chat mode, in which case it's okay.
2021-09-02 18:57:21 +05:30
Miguel Jacq
0f3a5fdabf Merge develop and resolve conflict 2021-08-30 13:41:15 +10:00
Miguel Jacq
baba958040 Remove rate-limit related code, and a couple more places where flask-httpauth was referenced 2021-08-28 09:41:09 +10:00
Miguel Jacq
5d9554438f ClientAuthV3 fixes
* Remove Client Auth as an explicit option (it's on by default).
 * Update wording about Public mode
 * Fix tuple error when raising TorTooOldStealth exception in CLI
 * Move Private Key button next to URL button in GUI
 * Replace visual references of ClientAuth to Private Key
 * Remove HTTPAuth Flask dependency and remove a lot of code to do with password generation,
   401 auth triggers/invalid password rate limit detection etc
 * Test updates
 * Remove obsolete locale keys
2021-08-27 15:52:29 +10:00
Micah Lee
961e920878 Remove endpoint altogether because it's not needed 2021-08-20 11:59:26 -07:00
Twann
d83a4e3ebc Fix issue #1365 2021-08-19 16:15:53 +02:00
whew
8d0b261fb7 fix another typo... 2021-05-31 12:28:57 +00:00
whew
81fc11ef74 fix typo 2021-05-31 12:23:32 +00:00
whew
8c7e75f194 Merge branch 'develop' into add_security_headers 2021-05-31 12:13:58 +00:00
whew
da1e6eb866 resolve conflict in chat_mode.py 2021-05-31 12:05:31 +00:00
whew
2d79bcdfcc resolve conflict in web.py 2021-05-31 12:04:24 +00:00
Micah Lee
8e284f1027 Merge branch 'fix_405_error_and_other_methods' of https://github.com/mig5/onionshare into mig5-fix_405_error_and_other_methods 2021-05-25 16:27:26 -07:00
Miguel Jacq
1e5e886577 Prevent usernames in Chat mode of length 128 chars or more 2021-05-14 10:44:14 +10:00
whew
c9bc5759c1 Update web.py 2021-05-13 08:17:51 +00:00
whew
4e335800a5 Update share_mode.py 2021-05-13 08:15:17 +00:00
whew
a2ba9e5f1d Update send_base_mode.py 2021-05-13 08:14:33 +00:00
whew
6652ae5a5b Update receive_mode.py 2021-05-13 08:13:43 +00:00
whew
64b6abdf64 Update chat_mode.py 2021-05-13 08:11:29 +00:00
Miguel Jacq
aa7a6e321b Move the 'supports_file_requests' attribute into the actual modes rather than the Web class 2021-05-11 09:25:22 +10:00
Miguel Jacq
52d625203c Adds attribute self.mode_supports_file_requests in Web class. Don't send REQUEST_INDIVIDUAL_FILE_STARTED to the frontend if the mode doesn't support this, so that we don't trigger a chain reaction of toggling history widgets and the like. Set this attribute to True by default since most modes use it, but turn it off for Chat mode. Prevents an exception when sending a bad HTTP method or a 404 to a chat room 2021-05-11 08:41:17 +10:00
Miguel Jacq
c2bd0a6a22 Disable OPTIONS on the update-session-username route on Chat mode 2021-05-11 08:39:44 +10:00
Miguel Jacq
e409141362 Website mode doesn't need to support POST as a method 2021-05-11 08:14:49 +10:00
Miguel Jacq
d1cbe2faf6 Fix HTTP return code for custom 500 internal server error handler 2021-05-10 15:57:23 +10:00
Miguel Jacq
92027345d0 Register the 405 error handler properly. Enforce the appropriate methods for each route (GET or POST only, with OPTIONS disabled). Add tests for invalid methods. Add a friendlier 500 internal server error handler 2021-05-10 11:23:44 +10:00