mirror of
https://github.com/YunoHost-Apps/streams_ynh.git
synced 2024-09-03 20:26:20 +02:00
Merge pull request #24 from YunoHost-Apps/testing
[autopatch] Autopatch to migrate to new permission system
This commit is contained in:
commit
6be8b1abc7
5 changed files with 18 additions and 21 deletions
|
@ -12,7 +12,7 @@
|
|||
"name": ""
|
||||
},
|
||||
"requirements": {
|
||||
"yunohost": ">= 4.0.0"
|
||||
"yunohost": ">= 4.1.0"
|
||||
},
|
||||
"multi_instance": true,
|
||||
"services": [
|
||||
|
@ -26,18 +26,14 @@
|
|||
{
|
||||
"name": "domain",
|
||||
"type": "domain",
|
||||
"ask": {
|
||||
"en": "Choose a domain for your ZAP hub. ZAP must run in the root of this domain. It means no other app can be accessed/run from this domain. We advise to use a dedicated subdomain such as zap.domain.tld",
|
||||
"fr": "Indiquez un domain pour ZAP. ZAP doit être installé à la racine du domaine. Cela implique qu'aucune autre app ne pourra être installée ou accessible sur ce domain. Nous conseillons un sous-domaine dédié par exemple zap.domain.tld."
|
||||
"help": {
|
||||
"en": "ZAP must run in the root of this domain. It means no other app can be accessed/run from this domain. We advise to use a dedicated subdomain such as zap.domain.tld",
|
||||
"fr": "ZAP doit être installé à la racine du domaine. Cela implique qu'aucune autre app ne pourra être installée ou accessible sur ce domain. Nous conseillons un sous-domaine dédié par exemple zap.domain.tld."
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "admin",
|
||||
"type": "user",
|
||||
"ask": {
|
||||
"en": "Choose the ZAP administrator (must be an existing YunoHost user)",
|
||||
"fr": "Choisissez l'administrateur de ZAP (doit être un utilisateur YunoHost existant)"
|
||||
}
|
||||
"type": "user"
|
||||
},
|
||||
{
|
||||
"name": "database",
|
||||
|
|
|
@ -38,7 +38,7 @@ ynh_smart_mktemp () {
|
|||
ynh_die "Insufficient free space to continue..."
|
||||
fi
|
||||
|
||||
echo "$(sudo mktemp --directory --tmpdir="$tmpdir")"
|
||||
echo "$(mktemp --directory --tmpdir="$tmpdir")"
|
||||
}
|
||||
#=================================================
|
||||
# FUTURE OFFICIAL HELPERS
|
||||
|
|
|
@ -245,8 +245,9 @@ ynh_add_fail2ban_config --logpath="$final_path/php.log" --failregex="^.*auth\.ph
|
|||
# SETUP SSOWAT
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring SSOwat..."
|
||||
ynh_permission_update --permission="main" --add="visitors"
|
||||
# As Zap is social network and have its own permission there is no need to keep Zap behind SSO
|
||||
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
|
||||
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
|
|
|
@ -125,9 +125,6 @@ ynh_restore_file "/etc/fail2ban/jail.d/$app.conf"
|
|||
ynh_restore_file "/etc/fail2ban/filter.d/$app.conf"
|
||||
ynh_systemd_action --action=restart --service_name=fail2ban
|
||||
|
||||
# Make app public
|
||||
ynh_app_setting_set $app skipped_uris "/"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
|
|
|
@ -49,6 +49,16 @@ ynh_clean_setup () {
|
|||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# Migrate legacy permissions to new system
|
||||
#=================================================
|
||||
if ynh_legacy_permissions_exists
|
||||
then
|
||||
ynh_legacy_permissions_delete_all
|
||||
|
||||
ynh_app_setting_delete --app=$app --key=is_public
|
||||
fi
|
||||
|
||||
|
||||
#=================================================
|
||||
# STANDARD UPGRADE STEPS
|
||||
|
@ -208,13 +218,6 @@ if [ $database -eq 2 ]; then
|
|||
ynh_install_app_dependencies $pkg_dependencies
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
#=================================================
|
||||
# As Zap is social network and have its own permission there is no need to keep Zap behind SSO
|
||||
ynh_script_progression --message="Upgrading SSOwat configuration..."
|
||||
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue