aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md6
-rw-r--r--RELEASE.md2
-rw-r--r--cli/onionshare_cli/resources/templates/receive.html8
-rw-r--r--cli/pyproject.toml2
-rw-r--r--desktop/src/onionshare/resources/locale/en.json6
-rw-r--r--desktop/src/onionshare/tab/tab.py8
-rw-r--r--desktop/tests/gui_base_test.py13
-rwxr-xr-xdesktop/tests/run.sh3
-rw-r--r--desktop/tests/test_gui_chat.py75
-rw-r--r--desktop/tests/test_gui_tabs.py30
10 files changed, 136 insertions, 17 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6ac01275..25bdbe31 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,11 +2,13 @@
## 2.3.2
-* New feature: Receive mode supports custom titles
+* New feature: Custom titles can be set for OnionShare's various modes
* New feature: Receive mode supports notification webhooks
-* New feature: Receive mode supports submitting messages as well files
+* New feature: Receive mode supports submitting messages as well as files
* New feature: New ASCII art banner and prettier verbose output
* New feature: Partial support for range requests (pausing and resuming in HTTP)
+* Updated Tor to 0.4.5.7
+* Updated built-in obfs4 bridges
* Various bug fixes
## 2.3.1
diff --git a/RELEASE.md b/RELEASE.md
index 5d28a40f..e69a8184 100644
--- a/RELEASE.md
+++ b/RELEASE.md
@@ -14,6 +14,8 @@ Before making a release, you must update the version in these places:
- [ ] `docs/source/conf.py` (`version` at the top, and the `versions` list too)
- [ ] `snap/snapcraft.yaml`
+If you update flask-socketio, ensure that you also update the [socket.io.min.js](https://github.com/micahflee/onionshare/blob/develop/cli/onionshare_cli/resources/static/js/socket.io.min.js) file to a version that is [supported](https://flask-socketio.readthedocs.io/en/latest/#version-compatibility) by the updated version of flask-socketio.
+
Use tor binaries from the latest Tor Browser:
- [ ] `desktop/scripts/get-tor-osx.py`
diff --git a/cli/onionshare_cli/resources/templates/receive.html b/cli/onionshare_cli/resources/templates/receive.html
index c28813ea..159bfac5 100644
--- a/cli/onionshare_cli/resources/templates/receive.html
+++ b/cli/onionshare_cli/resources/templates/receive.html
@@ -21,11 +21,13 @@
{% if not disable_text and not disable_files %}
<p class="upload-header">Submit Files or Messages</p>
- <p class="upload-description">You can submit files, a message, or both</p>
+ <p class="upload-description">You can submit files, a message, or both.</p>
+ <p class="upload-description">Remember, you are accessing this service anonymously! Provide contact info if you want a response to the message.</p>
{% endif %}
{% if not disable_text and disable_files %}
<p class="upload-header">Submit Messages</p>
- <p class="upload-description">You can submit a message</p>
+ <p class="upload-description">You can submit a message.</p>
+ <p class="upload-description">Remember, you are accessing this service anonymously! Provide contact info if you want a response to the message.</p>
{% endif %}
{% if disable_text and not disable_files %}
<p class="upload-header">Submit Files</p>
@@ -61,4 +63,4 @@
<script async src="{{ static_url_path }}/js/receive.js" id="receive-script"></script>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/cli/pyproject.toml b/cli/pyproject.toml
index 6457a781..958d3434 100644
--- a/cli/pyproject.toml
+++ b/cli/pyproject.toml
@@ -20,7 +20,7 @@ python = "^3.6"
click = "*"
flask = "*"
flask-httpauth = "*"
-flask-socketio = "*"
+flask-socketio = "5.0.1"
psutil = "*"
pycryptodome = "*"
pysocks = "*"
diff --git a/desktop/src/onionshare/resources/locale/en.json b/desktop/src/onionshare/resources/locale/en.json
index 8a69142c..a847264b 100644
--- a/desktop/src/onionshare/resources/locale/en.json
+++ b/desktop/src/onionshare/resources/locale/en.json
@@ -101,6 +101,10 @@
"gui_status_indicator_receive_working": "Starting…",
"gui_status_indicator_receive_scheduled": "Scheduled…",
"gui_status_indicator_receive_started": "Receiving",
+ "gui_status_indicator_chat_stopped": "Ready to chat",
+ "gui_status_indicator_chat_working": "Starting…",
+ "gui_status_indicator_chat_scheduled": "Scheduled…",
+ "gui_status_indicator_chat_started": "Chatting",
"gui_file_info": "{} files, {}",
"gui_file_info_single": "{} file, {}",
"history_in_progress_tooltip": "{} in progress",
@@ -198,4 +202,4 @@
"error_port_not_available": "OnionShare port not available",
"history_receive_read_message_button": "Read Message",
"error_tor_protocol_error": "There was an error with Tor: {}"
-} \ No newline at end of file
+}
diff --git a/desktop/src/onionshare/tab/tab.py b/desktop/src/onionshare/tab/tab.py
index d39cf826..09982de9 100644
--- a/desktop/src/onionshare/tab/tab.py
+++ b/desktop/src/onionshare/tab/tab.py
@@ -452,20 +452,20 @@ class Tab(QtWidgets.QWidget):
# Chat mode
if self.chat_mode.server_status.status == ServerStatus.STATUS_STOPPED:
self.set_server_status_indicator_stopped(
- strings._("gui_status_indicator_receive_stopped")
+ strings._("gui_status_indicator_chat_stopped")
)
elif self.chat_mode.server_status.status == ServerStatus.STATUS_WORKING:
if self.settings.get("general", "autostart_timer"):
self.set_server_status_indicator_working(
- strings._("gui_status_indicator_receive_scheduled")
+ strings._("gui_status_indicator_chat_scheduled")
)
else:
self.set_server_status_indicator_working(
- strings._("gui_status_indicator_receive_working")
+ strings._("gui_status_indicator_chat_working")
)
elif self.chat_mode.server_status.status == ServerStatus.STATUS_STARTED:
self.set_server_status_indicator_started(
- strings._("gui_status_indicator_receive_started")
+ strings._("gui_status_indicator_chat_started")
)
def set_server_status_indicator_stopped(self, label_text):
diff --git a/desktop/tests/gui_base_test.py b/desktop/tests/gui_base_test.py
index c6a5da2f..3a38ff8e 100644
--- a/desktop/tests/gui_base_test.py
+++ b/desktop/tests/gui_base_test.py
@@ -14,6 +14,7 @@ from onionshare import Application, MainWindow, GuiCommon
from onionshare.tab.mode.share_mode import ShareMode
from onionshare.tab.mode.receive_mode import ReceiveMode
from onionshare.tab.mode.website_mode import WebsiteMode
+from onionshare.tab.mode.chat_mode import ChatMode
from onionshare import strings
@@ -133,6 +134,17 @@ class GuiBaseTest(unittest.TestCase):
return tab
+ def new_chat_tab(self):
+ tab = self.gui.tabs.widget(0)
+ self.verify_new_tab(tab)
+
+ # Chat
+ tab.chat_button.click()
+ self.assertFalse(tab.new_tab.isVisible())
+ self.assertTrue(tab.chat_mode.isVisible())
+
+ return tab
+
def close_all_tabs(self):
for _ in range(self.gui.tabs.count()):
tab = self.gui.tabs.widget(0)
@@ -361,6 +373,7 @@ class GuiBaseTest(unittest.TestCase):
and not tab.settings.get("share", "autostop_sharing")
)
or (type(tab.get_mode()) == WebsiteMode)
+ or (type(tab.get_mode()) == ChatMode)
):
tab.get_mode().server_status.server_button.click()
self.assertEqual(tab.get_mode().server_status.status, 0)
diff --git a/desktop/tests/run.sh b/desktop/tests/run.sh
index 833c1516..0f019b05 100755
--- a/desktop/tests/run.sh
+++ b/desktop/tests/run.sh
@@ -2,4 +2,5 @@
pytest -v tests/test_gui_tabs.py && \
pytest -v tests/test_gui_share.py && \
pytest -v tests/test_gui_receive.py && \
-pytest -v tests/test_gui_website.py
+pytest -v tests/test_gui_website.py && \
+pytest -v tests/test_gui_chat.py
diff --git a/desktop/tests/test_gui_chat.py b/desktop/tests/test_gui_chat.py
new file mode 100644
index 00000000..7a19168b
--- /dev/null
+++ b/desktop/tests/test_gui_chat.py
@@ -0,0 +1,75 @@
+import requests
+
+from PySide2 import QtTest
+
+from .gui_base_test import GuiBaseTest
+
+
+class TestChat(GuiBaseTest):
+ # Shared test methods
+
+ def view_chat(self, tab):
+ """Test that we can view the chat room"""
+ url = f"http://127.0.0.1:{tab.app.port}/"
+ if tab.settings.get("general", "public"):
+ r = requests.get(url)
+ else:
+ r = requests.get(
+ url,
+ auth=requests.auth.HTTPBasicAuth(
+ "onionshare", tab.get_mode().server_status.web.password
+ ),
+ )
+
+ QtTest.QTest.qWait(500, self.gui.qtapp)
+ self.assertTrue("Chat <b>requires JavaScript</b>" in r.text)
+
+ cookies_dict = requests.utils.dict_from_cookiejar(r.cookies)
+ self.assertTrue("session" in cookies_dict.keys())
+
+ def change_username(self, tab):
+ """Test that we can change our username"""
+ url = f"http://127.0.0.1:{tab.app.port}/update-session-username"
+ data = {"username":"oniontest"}
+ if tab.settings.get("general", "public"):
+ r = requests.post(url, json=data)
+ else:
+ r = requests.post(
+ url,
+ json=data,
+ auth=requests.auth.HTTPBasicAuth(
+ "onionshare", tab.get_mode().server_status.web.password
+ ),
+ )
+
+ QtTest.QTest.qWait(500, self.gui.qtapp)
+ jsonResponse = r.json()
+ self.assertTrue(jsonResponse["success"])
+ self.assertEqual(jsonResponse["username"], "oniontest")
+
+ def run_all_chat_mode_tests(self, tab):
+ """Tests in chat mode after starting a chat"""
+ self.server_working_on_start_button_pressed(tab)
+ self.server_status_indicator_says_starting(tab)
+ self.server_is_started(tab, startup_time=500)
+ self.web_server_is_running(tab)
+ self.have_a_password(tab)
+ self.url_description_shown(tab)
+ self.have_copy_url_button(tab)
+ self.have_show_qr_code_button(tab)
+ self.server_status_indicator_says_started(tab)
+ self.view_chat(tab)
+ self.change_username(tab)
+ self.server_is_stopped(tab)
+ self.web_server_is_stopped(tab)
+ self.server_status_indicator_says_closed(tab)
+
+ # Tests
+
+ def test_chat(self):
+ """
+ Test chat mode
+ """
+ tab = self.new_chat_tab()
+ self.run_all_chat_mode_tests(tab)
+ self.close_all_tabs()
diff --git a/desktop/tests/test_gui_tabs.py b/desktop/tests/test_gui_tabs.py
index 84558420..09f38bb4 100644
--- a/desktop/tests/test_gui_tabs.py
+++ b/desktop/tests/test_gui_tabs.py
@@ -153,11 +153,21 @@ class TestTabs(GuiBaseTest):
self.gui.status_bar.server_status_label.text(), "Ready to share"
)
+ # New tab, chat mode
+ self.gui.tabs.new_tab_button.click()
+ self.gui.tabs.widget(4).chat_button.click()
+ self.assertFalse(self.gui.tabs.widget(4).new_tab.isVisible())
+ self.assertTrue(self.gui.tabs.widget(4).chat_mode.isVisible())
+ self.assertEqual(
+ self.gui.status_bar.server_status_label.text(), "Ready to chat"
+ )
+
# Close tabs
self.gui.tabs.tabBar().tabButton(0, QtWidgets.QTabBar.RightSide).click()
self.gui.tabs.tabBar().tabButton(0, QtWidgets.QTabBar.RightSide).click()
self.gui.tabs.tabBar().tabButton(0, QtWidgets.QTabBar.RightSide).click()
self.gui.tabs.tabBar().tabButton(0, QtWidgets.QTabBar.RightSide).click()
+ self.gui.tabs.tabBar().tabButton(0, QtWidgets.QTabBar.RightSide).click()
def test_07_close_share_tab_while_server_started_should_warn(self):
"""Closing a share mode tab when the server is running should throw a warning"""
@@ -165,7 +175,7 @@ class TestTabs(GuiBaseTest):
self.close_tab_with_active_server(tab)
def test_08_close_receive_tab_while_server_started_should_warn(self):
- """Closing a recieve mode tab when the server is running should throw a warning"""
+ """Closing a receive mode tab when the server is running should throw a warning"""
tab = self.new_receive_tab()
self.close_tab_with_active_server(tab)
@@ -174,22 +184,32 @@ class TestTabs(GuiBaseTest):
tab = self.new_website_tab_with_files()
self.close_tab_with_active_server(tab)
- def test_10_close_persistent_share_tab_shows_warning(self):
+ def test_10_close_chat_tab_while_server_started_should_warn(self):
+ """Closing a chat mode tab when the server is running should throw a warning"""
+ tab = self.new_chat_tab()
+ self.close_tab_with_active_server(tab)
+
+ def test_11_close_persistent_share_tab_shows_warning(self):
"""Closing a share mode tab that's persistent should show a warning"""
tab = self.new_share_tab_with_files()
self.close_persistent_tab(tab)
- def test_11_close_persistent_receive_tab_shows_warning(self):
+ def test_12_close_persistent_receive_tab_shows_warning(self):
"""Closing a receive mode tab that's persistent should show a warning"""
tab = self.new_receive_tab()
self.close_persistent_tab(tab)
- def test_12_close_persistent_website_tab_shows_warning(self):
+ def test_13_close_persistent_website_tab_shows_warning(self):
"""Closing a website mode tab that's persistent should show a warning"""
tab = self.new_website_tab_with_files()
self.close_persistent_tab(tab)
- def test_13_quit_with_server_started_should_warn(self):
+ def test_14_close_persistent_chat_tab_shows_warning(self):
+ """Closing a chat mode tab that's persistent should show a warning"""
+ tab = self.new_chat_tab()
+ self.close_persistent_tab(tab)
+
+ def test_15_quit_with_server_started_should_warn(self):
"""Quitting OnionShare with any active servers should show a warning"""
tab = self.new_share_tab()