diff options
Diffstat (limited to 'desktop/src/onionshare/tab/mode')
6 files changed, 19 insertions, 77 deletions
diff --git a/desktop/src/onionshare/tab/mode/__init__.py b/desktop/src/onionshare/tab/mode/__init__.py index aeecaf66..d4f2c23a 100644 --- a/desktop/src/onionshare/tab/mode/__init__.py +++ b/desktop/src/onionshare/tab/mode/__init__.py @@ -246,13 +246,23 @@ class Mode(QtWidgets.QWidget): self.start_onion_thread() def start_onion_thread(self, obtain_onion_early=False): - self.common.log("Mode", "start_server", "Starting an onion thread") - self.obtain_onion_early = obtain_onion_early - self.onion_thread = OnionThread(self) - self.onion_thread.success.connect(self.starting_server_step2.emit) - self.onion_thread.success_early.connect(self.starting_server_early.emit) - self.onion_thread.error.connect(self.starting_server_error.emit) - self.onion_thread.start() + # If we tried to start with Client Auth and our Tor is too old to support it, + # bail out early + if ( + not self.server_status.local_only + and not self.app.onion.supports_stealth + and not self.settings.get("general", "public") + ): + self.stop_server() + self.start_server_error(strings._("gui_server_doesnt_support_stealth")) + else: + self.common.log("Mode", "start_server", "Starting an onion thread") + self.obtain_onion_early = obtain_onion_early + self.onion_thread = OnionThread(self) + self.onion_thread.success.connect(self.starting_server_step2.emit) + self.onion_thread.success_early.connect(self.starting_server_early.emit) + self.onion_thread.error.connect(self.starting_server_error.emit) + self.onion_thread.start() def start_scheduled_service(self, obtain_onion_early=False): # We start a new OnionThread with the saved scheduled key from settings @@ -438,15 +448,6 @@ class Mode(QtWidgets.QWidget): """ pass - def handle_request_rate_limit(self, event): - """ - Handle REQUEST_RATE_LIMIT event. - """ - self.stop_server() - Alert( - self.common, strings._("error_rate_limit"), QtWidgets.QMessageBox.Critical - ) - def handle_request_progress(self, event): """ Handle REQUEST_PROGRESS event. diff --git a/desktop/src/onionshare/tab/mode/chat_mode/__init__.py b/desktop/src/onionshare/tab/mode/chat_mode/__init__.py index fe3e69f1..e7a17ce7 100644 --- a/desktop/src/onionshare/tab/mode/chat_mode/__init__.py +++ b/desktop/src/onionshare/tab/mode/chat_mode/__init__.py @@ -130,7 +130,6 @@ class ChatMode(Mode): """ # Reset web counters self.web.chat_mode.cur_history_id = 0 - self.web.reset_invalid_passwords() def start_server_step2_custom(self): """ diff --git a/desktop/src/onionshare/tab/mode/mode_settings_widget.py b/desktop/src/onionshare/tab/mode/mode_settings_widget.py index 9f55dbaf..0e80023e 100644 --- a/desktop/src/onionshare/tab/mode/mode_settings_widget.py +++ b/desktop/src/onionshare/tab/mode/mode_settings_widget.py @@ -129,28 +129,6 @@ class ModeSettingsWidget(QtWidgets.QScrollArea): autostop_timer_layout.addWidget(self.autostop_timer_checkbox) autostop_timer_layout.addWidget(self.autostop_timer_widget) - # Legacy address - self.legacy_checkbox = QtWidgets.QCheckBox() - self.legacy_checkbox.clicked.connect(self.legacy_checkbox_clicked) - self.legacy_checkbox.clicked.connect(self.update_ui) - self.legacy_checkbox.setText(strings._("mode_settings_legacy_checkbox")) - if self.settings.get("general", "legacy"): - self.legacy_checkbox.setCheckState(QtCore.Qt.Checked) - else: - self.legacy_checkbox.setCheckState(QtCore.Qt.Unchecked) - - # Client auth - self.client_auth_checkbox = QtWidgets.QCheckBox() - self.client_auth_checkbox.clicked.connect(self.client_auth_checkbox_clicked) - self.client_auth_checkbox.clicked.connect(self.update_ui) - self.client_auth_checkbox.setText( - strings._("mode_settings_client_auth_checkbox") - ) - if self.settings.get("general", "client_auth"): - self.client_auth_checkbox.setCheckState(QtCore.Qt.Checked) - else: - self.client_auth_checkbox.setCheckState(QtCore.Qt.Unchecked) - # Toggle advanced settings self.toggle_advanced_button = QtWidgets.QPushButton() self.toggle_advanced_button.clicked.connect(self.toggle_advanced_clicked) @@ -165,8 +143,6 @@ class ModeSettingsWidget(QtWidgets.QScrollArea): advanced_layout.addLayout(title_layout) advanced_layout.addLayout(autostart_timer_layout) advanced_layout.addLayout(autostop_timer_layout) - advanced_layout.addWidget(self.legacy_checkbox) - advanced_layout.addWidget(self.client_auth_checkbox) self.advanced_widget = QtWidgets.QWidget() self.advanced_widget.setLayout(advanced_layout) self.advanced_widget.hide() @@ -200,28 +176,6 @@ class ModeSettingsWidget(QtWidgets.QScrollArea): strings._("mode_settings_advanced_toggle_show") ) - # Client auth is only a legacy option - if self.client_auth_checkbox.isChecked(): - self.legacy_checkbox.setChecked(True) - self.legacy_checkbox.setEnabled(False) - else: - self.legacy_checkbox.setEnabled(True) - if self.legacy_checkbox.isChecked(): - self.client_auth_checkbox.show() - else: - self.client_auth_checkbox.hide() - - # If the server has been started in the past, prevent changing legacy option - if self.settings.get("onion", "private_key"): - if self.legacy_checkbox.isChecked(): - # If using legacy, disable legacy and client auth options - self.legacy_checkbox.setEnabled(False) - self.client_auth_checkbox.setEnabled(False) - else: - # If using v3, hide legacy and client auth options - self.legacy_checkbox.hide() - self.client_auth_checkbox.hide() - def title_editing_finished(self): if self.title_lineedit.text().strip() == "": self.title_lineedit.setText("") @@ -283,14 +237,6 @@ class ModeSettingsWidget(QtWidgets.QScrollArea): else: self.autostop_timer_widget.hide() - def legacy_checkbox_clicked(self): - self.settings.set("general", "legacy", self.legacy_checkbox.isChecked()) - - def client_auth_checkbox_clicked(self): - self.settings.set( - "general", "client_auth", self.client_auth_checkbox.isChecked() - ) - def toggle_advanced_clicked(self): if self.advanced_widget.isVisible(): self.advanced_widget.hide() diff --git a/desktop/src/onionshare/tab/mode/receive_mode/__init__.py b/desktop/src/onionshare/tab/mode/receive_mode/__init__.py index d07b5ffc..d5036d1d 100644 --- a/desktop/src/onionshare/tab/mode/receive_mode/__init__.py +++ b/desktop/src/onionshare/tab/mode/receive_mode/__init__.py @@ -183,16 +183,15 @@ class ReceiveMode(Mode): self.main_layout.addWidget(header_label) self.main_layout.addWidget(receive_warning) self.main_layout.addWidget(self.primary_action, stretch=1) - self.main_layout.addWidget(MinimumSizeWidget(525, 0)) + self.main_layout.addWidget(self.server_status) # Row layout content_row = QtWidgets.QHBoxLayout() - content_row.addLayout(self.main_layout) + content_row.addLayout(self.main_layout, stretch=1) content_row.addWidget(self.image) row_layout = QtWidgets.QVBoxLayout() row_layout.addLayout(top_bar_layout) row_layout.addLayout(content_row, stretch=1) - row_layout.addWidget(self.server_status) # Column layout self.column_layout = QtWidgets.QHBoxLayout() @@ -296,7 +295,6 @@ class ReceiveMode(Mode): """ # Reset web counters self.web.receive_mode.cur_history_id = 0 - self.web.reset_invalid_passwords() # Hide and reset the uploads if we have previously shared self.reset_info_counters() diff --git a/desktop/src/onionshare/tab/mode/share_mode/__init__.py b/desktop/src/onionshare/tab/mode/share_mode/__init__.py index 4056d92e..5d3e3c35 100644 --- a/desktop/src/onionshare/tab/mode/share_mode/__init__.py +++ b/desktop/src/onionshare/tab/mode/share_mode/__init__.py @@ -219,7 +219,6 @@ class ShareMode(Mode): """ # Reset web counters self.web.share_mode.cur_history_id = 0 - self.web.reset_invalid_passwords() # Hide and reset the downloads if we have previously shared self.reset_info_counters() diff --git a/desktop/src/onionshare/tab/mode/website_mode/__init__.py b/desktop/src/onionshare/tab/mode/website_mode/__init__.py index 577ea28e..a50d15b9 100644 --- a/desktop/src/onionshare/tab/mode/website_mode/__init__.py +++ b/desktop/src/onionshare/tab/mode/website_mode/__init__.py @@ -210,7 +210,6 @@ class WebsiteMode(Mode): """ # Reset web counters self.web.website_mode.visit_count = 0 - self.web.reset_invalid_passwords() # Hide and reset the downloads if we have previously shared self.reset_info_counters() |