mirror of
https://github.com/onionshare/onionshare.git
synced 2025-02-14 13:41:25 -05:00
Merge branch 'develop' into 1459_linux_packaging
This commit is contained in:
commit
d53d52a163
@ -30,6 +30,10 @@ jobs:
|
|||||||
command: |
|
command: |
|
||||||
cd ~/repo/cli
|
cd ~/repo/cli
|
||||||
poetry run pytest -v ./tests
|
poetry run pytest -v ./tests
|
||||||
|
poetry run onionshare-cli --local-only ./tests --auto-stop-timer 2
|
||||||
|
poetry run onionshare-cli --local-only --receive --auto-stop-timer 2
|
||||||
|
poetry run onionshare-cli --local-only --website ../docs --auto-stop-timer 2
|
||||||
|
poetry run onionshare-cli --local-only --chat --auto-stop-timer 2
|
||||||
|
|
||||||
test-gui:
|
test-gui:
|
||||||
docker:
|
docker:
|
||||||
|
@ -27,8 +27,6 @@ from datetime import datetime
|
|||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
from .common import Common, CannotFindTor
|
from .common import Common, CannotFindTor
|
||||||
from .censorship import CensorshipCircumvention
|
|
||||||
from .meek import Meek, MeekNotRunning
|
|
||||||
from .web import Web
|
from .web import Web
|
||||||
from .onion import TorErrorProtocolError, TorTooOldEphemeral, TorTooOldStealth, Onion
|
from .onion import TorErrorProtocolError, TorTooOldEphemeral, TorTooOldStealth, Onion
|
||||||
from .onionshare import OnionShare
|
from .onionshare import OnionShare
|
||||||
@ -285,20 +283,6 @@ def main(cwd=None):
|
|||||||
# Create the Web object
|
# Create the Web object
|
||||||
web = Web(common, False, mode_settings, mode)
|
web = Web(common, False, mode_settings, mode)
|
||||||
|
|
||||||
# Create the Meek object and start the meek client
|
|
||||||
# meek = Meek(common)
|
|
||||||
# meek.start()
|
|
||||||
|
|
||||||
# Create the CensorshipCircumvention object to make
|
|
||||||
# API calls to Tor over Meek
|
|
||||||
censorship = CensorshipCircumvention(common, meek)
|
|
||||||
# Example: request recommended bridges, pretending to be from China, using
|
|
||||||
# domain fronting.
|
|
||||||
# censorship_recommended_settings = censorship.request_settings(country="cn")
|
|
||||||
# print(censorship_recommended_settings)
|
|
||||||
# Clean up the meek subprocess once we're done working with the censorship circumvention API
|
|
||||||
# meek.cleanup()
|
|
||||||
|
|
||||||
# Start the Onion object
|
# Start the Onion object
|
||||||
try:
|
try:
|
||||||
onion = Onion(common, use_tmp_dir=True)
|
onion = Onion(common, use_tmp_dir=True)
|
||||||
@ -474,13 +458,13 @@ def main(cwd=None):
|
|||||||
if app.autostop_timer > 0:
|
if app.autostop_timer > 0:
|
||||||
# if the auto-stop timer was set and has run out, stop the server
|
# if the auto-stop timer was set and has run out, stop the server
|
||||||
if not app.autostop_timer_thread.is_alive():
|
if not app.autostop_timer_thread.is_alive():
|
||||||
if mode == "share" or (mode == "website"):
|
if mode == "share":
|
||||||
# If there were no attempts to download the share, or all downloads are done, we can stop
|
# If there were no attempts to download the share, or all downloads are done, we can stop
|
||||||
if web.share_mode.cur_history_id == 0 or web.done:
|
if web.share_mode.cur_history_id == 0 or web.done:
|
||||||
print("Stopped because auto-stop timer ran out")
|
print("Stopped because auto-stop timer ran out")
|
||||||
web.stop(app.port)
|
web.stop(app.port)
|
||||||
break
|
break
|
||||||
if mode == "receive":
|
elif mode == "receive":
|
||||||
if (
|
if (
|
||||||
web.receive_mode.cur_history_id == 0
|
web.receive_mode.cur_history_id == 0
|
||||||
or not web.receive_mode.uploads_in_progress
|
or not web.receive_mode.uploads_in_progress
|
||||||
@ -489,6 +473,11 @@ def main(cwd=None):
|
|||||||
web.stop(app.port)
|
web.stop(app.port)
|
||||||
break
|
break
|
||||||
web.receive_mode.can_upload = False
|
web.receive_mode.can_upload = False
|
||||||
|
else:
|
||||||
|
# website or chat mode
|
||||||
|
print("Stopped because auto-stop timer ran out")
|
||||||
|
web.stop(app.port)
|
||||||
|
break
|
||||||
# Allow KeyboardInterrupt exception to be handled with threads
|
# Allow KeyboardInterrupt exception to be handled with threads
|
||||||
# https://stackoverflow.com/questions/3788208/python-threading-ignores-keyboardinterrupt-exception
|
# https://stackoverflow.com/questions/3788208/python-threading-ignores-keyboardinterrupt-exception
|
||||||
time.sleep(0.2)
|
time.sleep(0.2)
|
||||||
|
@ -43,7 +43,11 @@ def load_strings(common, locale_dir):
|
|||||||
current_locale = common.settings.get("locale")
|
current_locale = common.settings.get("locale")
|
||||||
strings = {}
|
strings = {}
|
||||||
for s in translations[default_locale]:
|
for s in translations[default_locale]:
|
||||||
if s in translations[current_locale] and translations[current_locale][s] != "":
|
if (
|
||||||
|
current_locale in translations
|
||||||
|
and s in translations[current_locale]
|
||||||
|
and translations[current_locale][s] != ""
|
||||||
|
):
|
||||||
strings[s] = translations[current_locale][s]
|
strings[s] = translations[current_locale][s]
|
||||||
else:
|
else:
|
||||||
strings[s] = translations[default_locale][s]
|
strings[s] = translations[default_locale][s]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user