mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
Handle errors with Tor HS configuration.
This commit is contained in:
parent
e5de76401d
commit
28cc7f14c7
@ -198,8 +198,11 @@ def get_hidden_service():
|
|||||||
if not hs_dir:
|
if not hs_dir:
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
with open(os.path.join(hs_dir, 'hostname'), 'r') as conf_file:
|
try:
|
||||||
hs_hostname = conf_file.read().strip()
|
with open(os.path.join(hs_dir, 'hostname'), 'r') as conf_file:
|
||||||
|
hs_hostname = conf_file.read().strip()
|
||||||
|
except Exception:
|
||||||
|
return 'error'
|
||||||
|
|
||||||
return hs_hostname + ' ' + ','.join(hs_ports)
|
return hs_hostname + ' ' + ','.join(hs_ports)
|
||||||
|
|
||||||
|
|||||||
@ -89,6 +89,10 @@ def get_status():
|
|||||||
hs_enabled = False
|
hs_enabled = False
|
||||||
hs_hostname = 'Not Configured'
|
hs_hostname = 'Not Configured'
|
||||||
hs_ports = ''
|
hs_ports = ''
|
||||||
|
elif output == 'error':
|
||||||
|
hs_enabled = False
|
||||||
|
hs_hostname = 'Configuration Error'
|
||||||
|
hs_ports = ''
|
||||||
else:
|
else:
|
||||||
hs_enabled = True
|
hs_enabled = True
|
||||||
hs_info = output.split()
|
hs_info = output.split()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user