warns about sending large files in CLI (#123)

This commit is contained in:
Micah Lee 2014-09-18 00:20:54 +00:00
parent f550f09885
commit 3f3b52c0a7
2 changed files with 7 additions and 0 deletions

View File

@ -238,6 +238,12 @@ def main():
web.set_file_info(filenames) web.set_file_info(filenames)
app.cleanup_filenames.append(web.zip_filename) app.cleanup_filenames.append(web.zip_filename)
# warn about sending large files over Tor
if web.zip_filesize >= 209715200: # 200mb
print ''
print strings._("large_filesize").format(helpers.human_readable_filesize(web.zip_filesize))
print ''
# start onionshare service in new thread # start onionshare service in new thread
t = threading.Thread(target=web.start, args=(app.port, app.stay_open)) t = threading.Thread(target=web.start, args=(app.port, app.stay_open))
t.daemon = True t.daemon = True

View File

@ -21,6 +21,7 @@
"close_on_finish": "Stop server automatically", "close_on_finish": "Stop server automatically",
"choose_file": "Choose a file to share", "choose_file": "Choose a file to share",
"closing_automatically": "Closing automatically because download finished", "closing_automatically": "Closing automatically because download finished",
"large_filesize": "You are sending a total of {0}. Transferring large files using OnionShare might take hours.",
"error_tails_invalid_port": "Invalid value, port must be an integer", "error_tails_invalid_port": "Invalid value, port must be an integer",
"error_tails_unknown_root": "Unknown error with Tails root process", "error_tails_unknown_root": "Unknown error with Tails root process",
"help_tails_port": "Tails only: port for opening firewall, starting hidden service", "help_tails_port": "Tails only: port for opening firewall, starting hidden service",