mirror of
https://github.com/onionshare/onionshare.git
synced 2025-02-18 21:34:17 -05:00
Rename "slug" to "password"
This commit is contained in:
parent
5aceb5ad2c
commit
7dce7eec45
@ -121,9 +121,9 @@ def main(cwd=None):
|
|||||||
try:
|
try:
|
||||||
common.settings.load()
|
common.settings.load()
|
||||||
if not common.settings.get('public_mode'):
|
if not common.settings.get('public_mode'):
|
||||||
web.generate_slug(common.settings.get('slug'))
|
web.generate_password(common.settings.get('password'))
|
||||||
else:
|
else:
|
||||||
web.slug = None
|
web.password = None
|
||||||
app = OnionShare(common, onion, local_only, autostop_timer)
|
app = OnionShare(common, onion, local_only, autostop_timer)
|
||||||
app.set_stealth(stealth)
|
app.set_stealth(stealth)
|
||||||
app.choose_port()
|
app.choose_port()
|
||||||
@ -132,7 +132,7 @@ def main(cwd=None):
|
|||||||
if common.settings.get('public_mode'):
|
if common.settings.get('public_mode'):
|
||||||
url = 'http://{0:s}'.format(app.onion_host)
|
url = 'http://{0:s}'.format(app.onion_host)
|
||||||
else:
|
else:
|
||||||
url = 'http://onionshare:{0:s}@{1:s}'.format(web.slug, app.onion_host)
|
url = 'http://onionshare:{0:s}@{1:s}'.format(web.password, app.onion_host)
|
||||||
|
|
||||||
# Delay the startup if a startup timer was set
|
# Delay the startup if a startup timer was set
|
||||||
if autostart_timer > 0:
|
if autostart_timer > 0:
|
||||||
@ -200,22 +200,22 @@ def main(cwd=None):
|
|||||||
print('')
|
print('')
|
||||||
|
|
||||||
# Start OnionShare http service in new thread
|
# Start OnionShare http service in new thread
|
||||||
t = threading.Thread(target=web.start, args=(app.port, stay_open, common.settings.get('public_mode'), web.slug))
|
t = threading.Thread(target=web.start, args=(app.port, stay_open, common.settings.get('public_mode'), web.password))
|
||||||
t.daemon = True
|
t.daemon = True
|
||||||
t.start()
|
t.start()
|
||||||
|
|
||||||
try: # Trap Ctrl-C
|
try: # Trap Ctrl-C
|
||||||
# Wait for web.generate_slug() to finish running
|
# Wait for web.generate_password() to finish running
|
||||||
time.sleep(0.2)
|
time.sleep(0.2)
|
||||||
|
|
||||||
# start auto-stop timer thread
|
# start auto-stop timer thread
|
||||||
if app.autostop_timer > 0:
|
if app.autostop_timer > 0:
|
||||||
app.autostop_timer_thread.start()
|
app.autostop_timer_thread.start()
|
||||||
|
|
||||||
# Save the web slug if we are using a persistent private key
|
# Save the web password if we are using a persistent private key
|
||||||
if common.settings.get('save_private_key'):
|
if common.settings.get('save_private_key'):
|
||||||
if not common.settings.get('slug'):
|
if not common.settings.get('password'):
|
||||||
common.settings.set('slug', web.slug)
|
common.settings.set('password', web.password)
|
||||||
common.settings.save()
|
common.settings.save()
|
||||||
|
|
||||||
print('')
|
print('')
|
||||||
|
@ -143,7 +143,7 @@ class Common(object):
|
|||||||
os.makedirs(onionshare_data_dir, 0o700, True)
|
os.makedirs(onionshare_data_dir, 0o700, True)
|
||||||
return onionshare_data_dir
|
return onionshare_data_dir
|
||||||
|
|
||||||
def build_slug(self):
|
def build_password(self):
|
||||||
"""
|
"""
|
||||||
Returns a random string made from two words from the wordlist, such as "deter-trig".
|
Returns a random string made from two words from the wordlist, such as "deter-trig".
|
||||||
"""
|
"""
|
||||||
|
@ -111,7 +111,7 @@ class Settings(object):
|
|||||||
'save_private_key': False,
|
'save_private_key': False,
|
||||||
'private_key': '',
|
'private_key': '',
|
||||||
'public_mode': False,
|
'public_mode': False,
|
||||||
'slug': '',
|
'password': '',
|
||||||
'hidservauth_string': '',
|
'hidservauth_string': '',
|
||||||
'data_dir': self.build_default_data_dir(),
|
'data_dir': self.build_default_data_dir(),
|
||||||
'locale': None # this gets defined in fill_in_defaults()
|
'locale': None # this gets defined in fill_in_defaults()
|
||||||
|
@ -38,7 +38,7 @@ class ReceiveModeWeb(object):
|
|||||||
if self.common.settings.get('public_mode'):
|
if self.common.settings.get('public_mode'):
|
||||||
upload_action = '/upload'
|
upload_action = '/upload'
|
||||||
else:
|
else:
|
||||||
upload_action = '/{}/upload'.format(self.web.slug)
|
upload_action = '/{}/upload'.format(self.web.password)
|
||||||
|
|
||||||
r = make_response(render_template(
|
r = make_response(render_template(
|
||||||
'receive.html',
|
'receive.html',
|
||||||
@ -87,7 +87,7 @@ class ReceiveModeWeb(object):
|
|||||||
if self.common.settings.get('public_mode'):
|
if self.common.settings.get('public_mode'):
|
||||||
return redirect('/')
|
return redirect('/')
|
||||||
else:
|
else:
|
||||||
return redirect('/{}'.format(slug_candidate))
|
return redirect('/{}'.format(password_candidate))
|
||||||
|
|
||||||
# Note that flash strings are in English, and not translated, on purpose,
|
# Note that flash strings are in English, and not translated, on purpose,
|
||||||
# to avoid leaking the locale of the OnionShare user
|
# to avoid leaking the locale of the OnionShare user
|
||||||
@ -117,7 +117,7 @@ class ReceiveModeWeb(object):
|
|||||||
if self.common.settings.get('public_mode'):
|
if self.common.settings.get('public_mode'):
|
||||||
path = '/'
|
path = '/'
|
||||||
else:
|
else:
|
||||||
path = '/{}'.format(slug_candidate)
|
path = '/{}'.format(password_candidate)
|
||||||
return redirect('{}'.format(path))
|
return redirect('{}'.format(path))
|
||||||
else:
|
else:
|
||||||
if ajax:
|
if ajax:
|
||||||
@ -238,7 +238,7 @@ class ReceiveModeRequest(Request):
|
|||||||
if self.path == '/upload' or self.path == '/upload-ajax':
|
if self.path == '/upload' or self.path == '/upload-ajax':
|
||||||
self.upload_request = True
|
self.upload_request = True
|
||||||
else:
|
else:
|
||||||
if self.path == '/{}/upload'.format(self.web.slug) or self.path == '/{}/upload-ajax'.format(self.web.slug):
|
if self.path == '/{}/upload'.format(self.web.password) or self.path == '/{}/upload-ajax'.format(self.web.password):
|
||||||
self.upload_request = True
|
self.upload_request = True
|
||||||
|
|
||||||
if self.upload_request:
|
if self.upload_request:
|
||||||
|
@ -64,10 +64,10 @@ class ShareModeWeb(object):
|
|||||||
else:
|
else:
|
||||||
self.filesize = self.download_filesize
|
self.filesize = self.download_filesize
|
||||||
|
|
||||||
if self.web.slug:
|
if self.web.password:
|
||||||
r = make_response(render_template(
|
r = make_response(render_template(
|
||||||
'send.html',
|
'send.html',
|
||||||
slug=self.web.slug,
|
password=self.web.password,
|
||||||
file_info=self.file_info,
|
file_info=self.file_info,
|
||||||
filename=os.path.basename(self.download_filename),
|
filename=os.path.basename(self.download_filename),
|
||||||
filesize=self.filesize,
|
filesize=self.filesize,
|
||||||
|
@ -45,7 +45,7 @@ class Web(object):
|
|||||||
REQUEST_UPLOAD_FINISHED = 8
|
REQUEST_UPLOAD_FINISHED = 8
|
||||||
REQUEST_UPLOAD_CANCELED = 9
|
REQUEST_UPLOAD_CANCELED = 9
|
||||||
REQUEST_ERROR_DATA_DIR_CANNOT_CREATE = 10
|
REQUEST_ERROR_DATA_DIR_CANNOT_CREATE = 10
|
||||||
REQUEST_INVALID_SLUG = 11
|
REQUEST_INVALID_PASSWORD = 11
|
||||||
|
|
||||||
def __init__(self, common, is_gui, mode='share'):
|
def __init__(self, common, is_gui, mode='share'):
|
||||||
self.common = common
|
self.common = common
|
||||||
@ -97,14 +97,14 @@ class Web(object):
|
|||||||
]
|
]
|
||||||
|
|
||||||
self.q = queue.Queue()
|
self.q = queue.Queue()
|
||||||
self.slug = None
|
self.password = None
|
||||||
|
|
||||||
self.reset_invalid_slugs()
|
self.reset_invalid_passwords()
|
||||||
|
|
||||||
self.done = False
|
self.done = False
|
||||||
|
|
||||||
# shutting down the server only works within the context of flask, so the easiest way to do it is over http
|
# shutting down the server only works within the context of flask, so the easiest way to do it is over http
|
||||||
self.shutdown_slug = self.common.random_string(16)
|
self.shutdown_password = self.common.random_string(16)
|
||||||
|
|
||||||
# Keep track if the server is running
|
# Keep track if the server is running
|
||||||
self.running = False
|
self.running = False
|
||||||
@ -131,7 +131,7 @@ class Web(object):
|
|||||||
@self.auth.get_password
|
@self.auth.get_password
|
||||||
def get_pw(username):
|
def get_pw(username):
|
||||||
if username == 'onionshare':
|
if username == 'onionshare':
|
||||||
return self.slug
|
return self.password
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -148,12 +148,12 @@ class Web(object):
|
|||||||
def not_found(e):
|
def not_found(e):
|
||||||
return self.error404()
|
return self.error404()
|
||||||
|
|
||||||
@self.app.route("/<slug_candidate>/shutdown")
|
@self.app.route("/<password_candidate>/shutdown")
|
||||||
def shutdown(slug_candidate):
|
def shutdown(password_candidate):
|
||||||
"""
|
"""
|
||||||
Stop the flask web server, from the context of an http request.
|
Stop the flask web server, from the context of an http request.
|
||||||
"""
|
"""
|
||||||
if slug_candidate == self.shutdown_slug:
|
if password_candidate == self.shutdown_password:
|
||||||
self.force_shutdown()
|
self.force_shutdown()
|
||||||
return ""
|
return ""
|
||||||
abort(404)
|
abort(404)
|
||||||
@ -169,14 +169,14 @@ class Web(object):
|
|||||||
def error401(self):
|
def error401(self):
|
||||||
auth = request.authorization
|
auth = request.authorization
|
||||||
if auth:
|
if auth:
|
||||||
if auth['username'] == 'onionshare' and auth['password'] not in self.invalid_slugs:
|
if auth['username'] == 'onionshare' and auth['password'] not in self.invalid_passwords:
|
||||||
print('Invalid password guess: {}'.format(auth['password']))
|
print('Invalid password guess: {}'.format(auth['password']))
|
||||||
self.add_request(Web.REQUEST_INVALID_SLUG, data=auth['password'])
|
self.add_request(Web.REQUEST_INVALID_PASSWORD, data=auth['password'])
|
||||||
|
|
||||||
self.invalid_slugs.append(auth['password'])
|
self.invalid_passwords.append(auth['password'])
|
||||||
self.invalid_slugs_count += 1
|
self.invalid_passwords_count += 1
|
||||||
|
|
||||||
if self.invalid_slugs_count == 20:
|
if self.invalid_passwords_count == 20:
|
||||||
self.add_request(Web.REQUEST_RATE_LIMIT)
|
self.add_request(Web.REQUEST_RATE_LIMIT)
|
||||||
self.force_shutdown()
|
self.force_shutdown()
|
||||||
print("Someone has made too many wrong attempts to guess your password, so OnionShare has stopped the server. Start sharing again and send the recipient a new address to share.")
|
print("Someone has made too many wrong attempts to guess your password, so OnionShare has stopped the server. Start sharing again and send the recipient a new address to share.")
|
||||||
@ -218,14 +218,14 @@ class Web(object):
|
|||||||
'data': data
|
'data': data
|
||||||
})
|
})
|
||||||
|
|
||||||
def generate_slug(self, persistent_slug=None):
|
def generate_password(self, persistent_password=None):
|
||||||
self.common.log('Web', 'generate_slug', 'persistent_slug={}'.format(persistent_slug))
|
self.common.log('Web', 'generate_password', 'persistent_password={}'.format(persistent_password))
|
||||||
if persistent_slug != None and persistent_slug != '':
|
if persistent_password != None and persistent_password != '':
|
||||||
self.slug = persistent_slug
|
self.password = persistent_password
|
||||||
self.common.log('Web', 'generate_slug', 'persistent_slug sent, so slug is: "{}"'.format(self.slug))
|
self.common.log('Web', 'generate_password', 'persistent_password sent, so password is: "{}"'.format(self.password))
|
||||||
else:
|
else:
|
||||||
self.slug = self.common.build_slug()
|
self.password = self.common.build_password()
|
||||||
self.common.log('Web', 'generate_slug', 'built random slug: "{}"'.format(self.slug))
|
self.common.log('Web', 'generate_password', 'built random password: "{}"'.format(self.password))
|
||||||
|
|
||||||
def verbose_mode(self):
|
def verbose_mode(self):
|
||||||
"""
|
"""
|
||||||
@ -236,9 +236,9 @@ class Web(object):
|
|||||||
log_handler.setLevel(logging.WARNING)
|
log_handler.setLevel(logging.WARNING)
|
||||||
self.app.logger.addHandler(log_handler)
|
self.app.logger.addHandler(log_handler)
|
||||||
|
|
||||||
def reset_invalid_slugs(self):
|
def reset_invalid_passwords(self):
|
||||||
self.invalid_slugs_count = 0
|
self.invalid_passwords_count = 0
|
||||||
self.invalid_slugs = []
|
self.invalid_passwords = []
|
||||||
|
|
||||||
def force_shutdown(self):
|
def force_shutdown(self):
|
||||||
"""
|
"""
|
||||||
@ -254,11 +254,11 @@ class Web(object):
|
|||||||
pass
|
pass
|
||||||
self.running = False
|
self.running = False
|
||||||
|
|
||||||
def start(self, port, stay_open=False, public_mode=False, slug=None):
|
def start(self, port, stay_open=False, public_mode=False, password=None):
|
||||||
"""
|
"""
|
||||||
Start the flask web server.
|
Start the flask web server.
|
||||||
"""
|
"""
|
||||||
self.common.log('Web', 'start', 'port={}, stay_open={}, public_mode={}, slug={}'.format(port, stay_open, public_mode, slug))
|
self.common.log('Web', 'start', 'port={}, stay_open={}, public_mode={}, password={}'.format(port, stay_open, public_mode, password))
|
||||||
|
|
||||||
self.stay_open = stay_open
|
self.stay_open = stay_open
|
||||||
|
|
||||||
@ -287,11 +287,11 @@ class Web(object):
|
|||||||
# Let the mode know that the user stopped the server
|
# Let the mode know that the user stopped the server
|
||||||
self.stop_q.put(True)
|
self.stop_q.put(True)
|
||||||
|
|
||||||
# To stop flask, load http://shutdown:[shutdown_slug]@127.0.0.1/[shutdown_slug]/shutdown
|
# To stop flask, load http://shutdown:[shutdown_password]@127.0.0.1/[shutdown_password]/shutdown
|
||||||
# (We're putting the shutdown_slug in the path as well to make routing simpler)
|
# (We're putting the shutdown_password in the path as well to make routing simpler)
|
||||||
if self.running:
|
if self.running:
|
||||||
requests.get('http://127.0.0.1:{}/{}/shutdown'.format(port, self.shutdown_slug),
|
requests.get('http://127.0.0.1:{}/{}/shutdown'.format(port, self.shutdown_password),
|
||||||
auth=requests.auth.HTTPBasicAuth('onionshare', self.slug))
|
auth=requests.auth.HTTPBasicAuth('onionshare', self.password))
|
||||||
|
|
||||||
# Reset any slug that was in use
|
# Reset any password that was in use
|
||||||
self.slug = None
|
self.password = None
|
||||||
|
@ -24,7 +24,7 @@ from onionshare.common import AutoStopTimer
|
|||||||
|
|
||||||
from ..server_status import ServerStatus
|
from ..server_status import ServerStatus
|
||||||
from ..threads import OnionThread
|
from ..threads import OnionThread
|
||||||
from ..threads import AutoStartTimer
|
from ..threads import AutoStartTimer
|
||||||
from ..widgets import Alert
|
from ..widgets import Alert
|
||||||
|
|
||||||
class Mode(QtWidgets.QWidget):
|
class Mode(QtWidgets.QWidget):
|
||||||
@ -181,7 +181,7 @@ class Mode(QtWidgets.QWidget):
|
|||||||
self.app.port = None
|
self.app.port = None
|
||||||
|
|
||||||
# Start the onion thread. If this share was scheduled for a future date,
|
# Start the onion thread. If this share was scheduled for a future date,
|
||||||
# the OnionThread will start and exit 'early' to obtain the port, slug
|
# the OnionThread will start and exit 'early' to obtain the port, password
|
||||||
# and onion address, but it will not start the WebThread yet.
|
# and onion address, but it will not start the WebThread yet.
|
||||||
if self.server_status.autostart_timer_datetime:
|
if self.server_status.autostart_timer_datetime:
|
||||||
self.start_onion_thread(obtain_onion_early=True)
|
self.start_onion_thread(obtain_onion_early=True)
|
||||||
|
@ -113,7 +113,7 @@ class ReceiveMode(Mode):
|
|||||||
"""
|
"""
|
||||||
# Reset web counters
|
# Reset web counters
|
||||||
self.web.receive_mode.upload_count = 0
|
self.web.receive_mode.upload_count = 0
|
||||||
self.web.reset_invalid_slugs()
|
self.web.reset_invalid_passwords()
|
||||||
|
|
||||||
# Hide and reset the uploads if we have previously shared
|
# Hide and reset the uploads if we have previously shared
|
||||||
self.reset_info_counters()
|
self.reset_info_counters()
|
||||||
|
@ -147,7 +147,7 @@ class ShareMode(Mode):
|
|||||||
"""
|
"""
|
||||||
# Reset web counters
|
# Reset web counters
|
||||||
self.web.share_mode.download_count = 0
|
self.web.share_mode.download_count = 0
|
||||||
self.web.reset_invalid_slugs()
|
self.web.reset_invalid_passwords()
|
||||||
|
|
||||||
# Hide and reset the downloads if we have previously shared
|
# Hide and reset the downloads if we have previously shared
|
||||||
self.reset_info_counters()
|
self.reset_info_counters()
|
||||||
|
@ -143,7 +143,7 @@ class WebsiteMode(Mode):
|
|||||||
"""
|
"""
|
||||||
# Reset web counters
|
# Reset web counters
|
||||||
self.web.website_mode.visit_count = 0
|
self.web.website_mode.visit_count = 0
|
||||||
self.web.reset_invalid_slugs()
|
self.web.reset_invalid_passwords()
|
||||||
|
|
||||||
# Hide and reset the downloads if we have previously shared
|
# Hide and reset the downloads if we have previously shared
|
||||||
self.reset_info_counters()
|
self.reset_info_counters()
|
||||||
|
@ -471,11 +471,11 @@ class OnionShareGui(QtWidgets.QMainWindow):
|
|||||||
Alert(self.common, strings._('error_cannot_create_data_dir').format(event["data"]["receive_mode_dir"]))
|
Alert(self.common, strings._('error_cannot_create_data_dir').format(event["data"]["receive_mode_dir"]))
|
||||||
|
|
||||||
if event["type"] == Web.REQUEST_OTHER:
|
if event["type"] == Web.REQUEST_OTHER:
|
||||||
if event["path"] != '/favicon.ico' and event["path"] != "/{}/shutdown".format(mode.web.shutdown_slug):
|
if event["path"] != '/favicon.ico' and event["path"] != "/{}/shutdown".format(mode.web.shutdown_password):
|
||||||
self.status_bar.showMessage('{0:s}: {1:s}'.format(strings._('other_page_loaded'), event["path"]))
|
self.status_bar.showMessage('{0:s}: {1:s}'.format(strings._('other_page_loaded'), event["path"]))
|
||||||
|
|
||||||
if event["type"] == Web.REQUEST_INVALID_SLUG:
|
if event["type"] == Web.REQUEST_INVALID_PASSWORD:
|
||||||
self.status_bar.showMessage('[#{0:d}] {1:s}: {2:s}'.format(mode.web.invalid_slugs_count, strings._('invalid_slug_guess'), event["data"]))
|
self.status_bar.showMessage('[#{0:d}] {1:s}: {2:s}'.format(mode.web.invalid_passwords_count, strings._('invalid_password_guess'), event["data"]))
|
||||||
|
|
||||||
mode.timer_callback()
|
mode.timer_callback()
|
||||||
|
|
||||||
|
@ -243,8 +243,8 @@ class ServerStatus(QtWidgets.QWidget):
|
|||||||
self.show_url()
|
self.show_url()
|
||||||
|
|
||||||
if self.common.settings.get('save_private_key'):
|
if self.common.settings.get('save_private_key'):
|
||||||
if not self.common.settings.get('slug'):
|
if not self.common.settings.get('password'):
|
||||||
self.common.settings.set('slug', self.web.slug)
|
self.common.settings.set('password', self.web.password)
|
||||||
self.common.settings.save()
|
self.common.settings.save()
|
||||||
|
|
||||||
if self.common.settings.get('autostart_timer'):
|
if self.common.settings.get('autostart_timer'):
|
||||||
@ -421,5 +421,5 @@ class ServerStatus(QtWidgets.QWidget):
|
|||||||
if self.common.settings.get('public_mode'):
|
if self.common.settings.get('public_mode'):
|
||||||
url = 'http://{0:s}'.format(self.app.onion_host)
|
url = 'http://{0:s}'.format(self.app.onion_host)
|
||||||
else:
|
else:
|
||||||
url = 'http://onionshare:{0:s}@{1:s}'.format(self.web.slug, self.app.onion_host)
|
url = 'http://onionshare:{0:s}@{1:s}'.format(self.web.password, self.app.onion_host)
|
||||||
return url
|
return url
|
||||||
|
@ -54,7 +54,7 @@ class SettingsDialog(QtWidgets.QDialog):
|
|||||||
|
|
||||||
# General settings
|
# General settings
|
||||||
|
|
||||||
# Use a slug or not ('public mode')
|
# Use a password or not ('public mode')
|
||||||
self.public_mode_checkbox = QtWidgets.QCheckBox()
|
self.public_mode_checkbox = QtWidgets.QCheckBox()
|
||||||
self.public_mode_checkbox.setCheckState(QtCore.Qt.Unchecked)
|
self.public_mode_checkbox.setCheckState(QtCore.Qt.Unchecked)
|
||||||
self.public_mode_checkbox.setText(strings._("gui_settings_public_mode_checkbox"))
|
self.public_mode_checkbox.setText(strings._("gui_settings_public_mode_checkbox"))
|
||||||
@ -968,12 +968,12 @@ class SettingsDialog(QtWidgets.QDialog):
|
|||||||
if self.save_private_key_checkbox.isChecked():
|
if self.save_private_key_checkbox.isChecked():
|
||||||
settings.set('save_private_key', True)
|
settings.set('save_private_key', True)
|
||||||
settings.set('private_key', self.old_settings.get('private_key'))
|
settings.set('private_key', self.old_settings.get('private_key'))
|
||||||
settings.set('slug', self.old_settings.get('slug'))
|
settings.set('password', self.old_settings.get('password'))
|
||||||
settings.set('hidservauth_string', self.old_settings.get('hidservauth_string'))
|
settings.set('hidservauth_string', self.old_settings.get('hidservauth_string'))
|
||||||
else:
|
else:
|
||||||
settings.set('save_private_key', False)
|
settings.set('save_private_key', False)
|
||||||
settings.set('private_key', '')
|
settings.set('private_key', '')
|
||||||
settings.set('slug', '')
|
settings.set('password', '')
|
||||||
# Also unset the HidServAuth if we are removing our reusable private key
|
# Also unset the HidServAuth if we are removing our reusable private key
|
||||||
settings.set('hidservauth_string', '')
|
settings.set('hidservauth_string', '')
|
||||||
|
|
||||||
|
@ -42,13 +42,13 @@ class OnionThread(QtCore.QThread):
|
|||||||
def run(self):
|
def run(self):
|
||||||
self.mode.common.log('OnionThread', 'run')
|
self.mode.common.log('OnionThread', 'run')
|
||||||
|
|
||||||
# Choose port and slug early, because we need them to exist in advance for scheduled shares
|
# Choose port and password early, because we need them to exist in advance for scheduled shares
|
||||||
self.mode.app.stay_open = not self.mode.common.settings.get('close_after_first_download')
|
self.mode.app.stay_open = not self.mode.common.settings.get('close_after_first_download')
|
||||||
if not self.mode.app.port:
|
if not self.mode.app.port:
|
||||||
self.mode.app.choose_port()
|
self.mode.app.choose_port()
|
||||||
if not self.mode.common.settings.get('public_mode'):
|
if not self.mode.common.settings.get('public_mode'):
|
||||||
if not self.mode.web.slug:
|
if not self.mode.web.password:
|
||||||
self.mode.web.generate_slug(self.mode.common.settings.get('slug'))
|
self.mode.web.generate_password(self.mode.common.settings.get('password'))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if self.mode.obtain_onion_early:
|
if self.mode.obtain_onion_early:
|
||||||
@ -86,7 +86,7 @@ class WebThread(QtCore.QThread):
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.mode.common.log('WebThread', 'run')
|
self.mode.common.log('WebThread', 'run')
|
||||||
self.mode.web.start(self.mode.app.port, self.mode.app.stay_open, self.mode.common.settings.get('public_mode'), self.mode.web.slug)
|
self.mode.web.start(self.mode.app.port, self.mode.app.stay_open, self.mode.common.settings.get('public_mode'), self.mode.web.password)
|
||||||
self.success.emit()
|
self.success.emit()
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"not_a_readable_file": "{0:s} is not a readable file.",
|
"not_a_readable_file": "{0:s} is not a readable file.",
|
||||||
"no_available_port": "Could not find an available port to start the onion service",
|
"no_available_port": "Could not find an available port to start the onion service",
|
||||||
"other_page_loaded": "Address loaded",
|
"other_page_loaded": "Address loaded",
|
||||||
"invalid_slug_guess": "Invalid password guess",
|
"invalid_password_guess": "Invalid password guess",
|
||||||
"close_on_autostop_timer": "Stopped because auto-stop timer ran out",
|
"close_on_autostop_timer": "Stopped because auto-stop timer ran out",
|
||||||
"closing_automatically": "Stopped because transfer is complete",
|
"closing_automatically": "Stopped because transfer is complete",
|
||||||
"large_filesize": "Warning: Sending a large share could take hours",
|
"large_filesize": "Warning: Sending a large share could take hours",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user