mirror of
https://github.com/onionshare/onionshare.git
synced 2025-03-20 04:46:09 -04:00
force tails users to run as root (#42)
This commit is contained in:
parent
c2ab0206dd
commit
28b9140afd
@ -64,6 +64,9 @@ def get_platform():
|
||||
p = 'Tails'
|
||||
return p
|
||||
|
||||
def is_root():
|
||||
return os.geteuid() == 0
|
||||
|
||||
def get_hidden_service_dir(port):
|
||||
if get_platform() == "Windows":
|
||||
if 'Temp' in os.environ:
|
||||
@ -154,6 +157,11 @@ def start_hidden_service(port):
|
||||
def main():
|
||||
load_strings()
|
||||
|
||||
# check for root in Tails
|
||||
if get_platform() == 'Tails' and not is_root():
|
||||
sys.exit(strings["tails_requires_root"])
|
||||
|
||||
# parse arguments
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--local-only', action='store_true', dest='local_only', help='Do not attempt to use tor: for development only')
|
||||
parser.add_argument('filename', nargs=1)
|
||||
|
@ -13,7 +13,8 @@
|
||||
"download_page_loaded": "Download page loaded",
|
||||
"download_started": "Download started",
|
||||
"download_finished": "Download finished",
|
||||
"other_page_loaded": "Other page has been loaded"
|
||||
"other_page_loaded": "Other page has been loaded",
|
||||
"tails_requires_root": "You must run OnionShare as root in Tails"
|
||||
}, "no": {
|
||||
"punching_a_hole": "Åpner port i brannmuren.",
|
||||
"closing_hole": "Lukker port i brannmuren.",
|
||||
|
Loading…
x
Reference in New Issue
Block a user