[fix] Allow yunohost firewall service to be run even if YunoHost is unconfigured

This commit is contained in:
kload 2015-10-31 13:58:02 +01:00
parent 813ab01e9d
commit 95cbff27a9
2 changed files with 7 additions and 0 deletions

View file

@ -1017,6 +1017,9 @@ firewall:
reload: reload:
action_help: Reload all firewall rules action_help: Reload all firewall rules
api: PUT /firewall api: PUT /firewall
configuration:
authenticate: false
lock: false
### firewall_allow() ### firewall_allow()
allow: allow:

View file

@ -199,6 +199,10 @@ def firewall_reload():
reloaded = False reloaded = False
errors = False errors = False
# Do not continue if YunoHost is not configured
try: open('/etc/yunohost/installed')
except IOError: return True
# Check if SSH port is allowed # Check if SSH port is allowed
ssh_port = _get_ssh_port() ssh_port = _get_ssh_port()
if ssh_port not in firewall_list()['opened_ports']: if ssh_port not in firewall_list()['opened_ports']: