mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Merge remote-tracking branch 'upstream/dev' into test
This commit is contained in:
commit
9b47c2a416
5 changed files with 12 additions and 4 deletions
|
@ -610,7 +610,7 @@ def app_removeaccess(apps, users):
|
||||||
|
|
||||||
def app_setting(app, key, value=None, delete=False):
|
def app_setting(app, key, value=None, delete=False):
|
||||||
"""
|
"""
|
||||||
Set ou get an app setting value
|
Set or get an app setting value
|
||||||
|
|
||||||
Keyword argument:
|
Keyword argument:
|
||||||
value -- Value to set
|
value -- Value to set
|
||||||
|
|
|
@ -138,10 +138,14 @@ def firewall_reload(upnp=False):
|
||||||
|
|
||||||
add_portmapping('TCP', upnp, False, 'r')
|
add_portmapping('TCP', upnp, False, 'r')
|
||||||
add_portmapping('UDP', upnp, False, 'r')
|
add_portmapping('UDP', upnp, False, 'r')
|
||||||
|
ipv6 = False
|
||||||
|
|
||||||
if os.path.exists("/proc/net/if_inet6"):
|
if os.path.exists("/proc/net/if_inet6"):
|
||||||
add_portmapping('TCP', upnp, True, 'r')
|
add_portmapping('TCP', upnp, True, 'r')
|
||||||
add_portmapping('UDP', upnp, True, 'r')
|
add_portmapping('UDP', upnp, True, 'r')
|
||||||
|
ipv6 = True
|
||||||
|
|
||||||
|
hook_callback('post_iptable_rules', [upnp, ipv6])
|
||||||
|
|
||||||
os.system("iptables -A INPUT -i lo -j ACCEPT")
|
os.system("iptables -A INPUT -i lo -j ACCEPT")
|
||||||
os.system("iptables -A INPUT -p icmp -j ACCEPT")
|
os.system("iptables -A INPUT -p icmp -j ACCEPT")
|
||||||
|
|
|
@ -114,8 +114,8 @@ def hook_check(file):
|
||||||
raise YunoHostError(22, _("Invalid app package"))
|
raise YunoHostError(22, _("Invalid app package"))
|
||||||
|
|
||||||
action = file[file.index('scripts/') + 8:]
|
action = file[file.index('scripts/') + 8:]
|
||||||
if action in manifest["arguments"]:
|
if 'arguments' in manifest and action in manifest['arguments']:
|
||||||
return manifest["arguments"][action]
|
return manifest['arguments'][action]
|
||||||
else:
|
else:
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
|
|
@ -224,8 +224,10 @@ def tools_postinstall(domain, password, dyndns=False):
|
||||||
os.system('touch /etc/yunohost/light')
|
os.system('touch /etc/yunohost/light')
|
||||||
else:
|
else:
|
||||||
os.system('service dspam stop')
|
os.system('service dspam stop')
|
||||||
|
os.system('chmod -x /etc/cron.daily/dspam')
|
||||||
os.system('update-rc.d dspam remove')
|
os.system('update-rc.d dspam remove')
|
||||||
os.system('sed -i "s/yes/no/g" /etc/default/dspam')
|
os.system('sed -i "s/yes/no/g" /etc/default/dspam')
|
||||||
|
os.system('sed -i "s/dspam=no/dspam=yes/" /etc/yunohost/yunohost.conf')
|
||||||
os.system('apt-get install -y -qq yunohost-config-amavis')
|
os.system('apt-get install -y -qq yunohost-config-amavis')
|
||||||
os.system('service amavis start')
|
os.system('service amavis start')
|
||||||
os.system('apt-get install --reinstall -y -qq yunohost-config-postfix yunohost-config-dovecot')
|
os.system('apt-get install --reinstall -y -qq yunohost-config-postfix yunohost-config-dovecot')
|
||||||
|
|
|
@ -42,8 +42,10 @@ def http_exec(request, **kwargs):
|
||||||
|
|
||||||
# Simple HTTP auth
|
# Simple HTTP auth
|
||||||
elif installed:
|
elif installed:
|
||||||
authorized = request.getUser() == 'admin'
|
authorized = False
|
||||||
pwd = request.getPassword()
|
pwd = request.getPassword()
|
||||||
|
if request.getUser() == 'admin' and pwd != '':
|
||||||
|
authorized = True
|
||||||
if dev and 'api_key' in request.args:
|
if dev and 'api_key' in request.args:
|
||||||
pwd = request.args['api_key'][0]
|
pwd = request.args['api_key'][0]
|
||||||
authorized = True
|
authorized = True
|
||||||
|
|
Loading…
Add table
Reference in a new issue