diff --git a/bash/yunohost_cli b/bash/yunohost_cli index 620f71d5..20ed5855 100644 --- a/bash/yunohost_cli +++ b/bash/yunohost_cli @@ -8,7 +8,7 @@ COMPREPLY=() argc=${COMP_CWORD} cur="${COMP_WORDS[argc]}" prev="${COMP_WORDS[argc-1]}" -opts=$(yunohost-cli -h | grep usage | awk -F"{" '{print $2}' | awk -F"}" '{print $1}' | tr ',' ' ') +opts=$(yunohost -h | sed -n "/usage/,/}/p" | awk -F"{" '{print $2}' | awk -F"}" '{print $1}' | tr ',' ' ') if [[ $argc = 1 ]]; then @@ -19,7 +19,7 @@ if [[ "$prev" != "--help" ]]; then if [[ $argc = 2 ]]; then - opts2=$(yunohost-cli $prev -h | grep usage | awk -F"{" '{print $2}' | awk -F"}" '{print $1}' | tr ',' ' ') + opts2=$(yunohost $prev -h | sed -n "/usage/,/}/p" | awk -F"{" '{print $2}' | awk -F"}" '{print $1}' | tr ',' ' ') COMPREPLY=( $(compgen -W "$opts2 --help" -- $cur ) ) elif [[ $argc = 3 ]]; then @@ -30,4 +30,4 @@ else fi } -complete -F _yunohost_cli yunohost-cli +complete -F _yunohost_cli yunohost diff --git a/firewall.yml b/firewall.yml index 91bd0023..3cc2dd7b 100644 --- a/firewall.yml +++ b/firewall.yml @@ -1,10 +1,10 @@ UPNP: cron: false ports: - TCP: [22, 25, 53, 80, 137, 138, 139, 443, 445, 5222, 5269, 5280, 6767, 7676] + TCP: [22, 25, 53, 80, 137, 138, 139, 443, 445, 465, 993, 5222, 5269, 5280, 6767, 7676] UDP: [53, 137, 138] ipv4: - TCP: [22, 25, 53, 80, 137, 138, 139, 443, 445, 5222, 5269, 5280, 6767, 7676] + TCP: [22, 25, 53, 80, 137, 138, 139, 443, 445, 465, 993, 5222, 5269, 5280, 6767, 7676] UDP: [53, 137, 138] ipv6: TCP: [22] diff --git a/yunohost_app.py b/yunohost_app.py index 95a4f366..a4e32318 100644 --- a/yunohost_app.py +++ b/yunohost_app.py @@ -418,6 +418,7 @@ def app_install(app, label=None, args=None): os.system('chmod -R 400 '+ app_setting_path) os.system('chown -R root: '+ app_setting_path) os.system('chown -R admin: '+ app_setting_path +'/scripts') + app_ssowatconf() win_msg(_("Installation complete")) else: #TODO: display script fail messages @@ -439,16 +440,22 @@ def app_remove(app): raise YunoHostError(22, _("App is not installed")) app_setting_path = apps_setting_path + app - os.system('chmod -R 777 '+ app_setting_path) #TODO: display fail messages from script - os.system('cp '+ app_setting_path + '/scripts/remove /tmp/yunohost_remove && chown admin: /tmp/yunohost_remove') - if hook_exec('/tmp/yunohost_remove') != 0: - os.system('chmod -hR 700 '+ app_setting_path) + try: + shutil.rmtree('/tmp/yunohost_remove') + except: pass + + os.system('cp -a '+ app_setting_path + ' /tmp/yunohost_remove && chown -hR admin: /tmp/yunohost_remove') + os.system('chown -R admin: /tmp/yunohost_remove') + os.system('chmod -R u+rX /tmp/yunohost_remove') + + if hook_exec('/tmp/yunohost_remove/scripts/remove') != 0: + pass if os.path.exists(app_setting_path): shutil.rmtree(app_setting_path) os.remove('/tmp/yunohost_remove') - + app_ssowatconf() win_msg(_("App removed: ")+ app)