mirror of
https://github.com/YunoHost-Apps/nextcloud_ynh.git
synced 2024-09-03 19:55:57 +02:00
Migrate legacy permissions
This commit is contained in:
parent
c415810791
commit
63b0a95419
4 changed files with 27 additions and 11 deletions
|
@ -14,7 +14,7 @@
|
||||||
"email": "apps@yunohost.org"
|
"email": "apps@yunohost.org"
|
||||||
},
|
},
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"yunohost": ">= 3.8.1"
|
"yunohost": ">= 4.1.0"
|
||||||
},
|
},
|
||||||
"multi_instance": true,
|
"multi_instance": true,
|
||||||
"services": [
|
"services": [
|
||||||
|
|
|
@ -386,3 +386,22 @@ ynh_multimedia_addaccess () {
|
||||||
groupadd -f multimedia
|
groupadd -f multimedia
|
||||||
usermod -a -G multimedia $user_name
|
usermod -a -G multimedia $user_name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ynh_legacy_permissions_exists () {
|
||||||
|
for permission in "skipped" "unprotected" "protected"
|
||||||
|
do
|
||||||
|
if ynh_permission_exists --permission="legacy_${permission}_uris"; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
ynh_legacy_permissions_delete_all () {
|
||||||
|
for permission in "skipped" "unprotected" "protected"
|
||||||
|
do
|
||||||
|
if ynh_permission_exists --permission="legacy_${permission}_uris"; then
|
||||||
|
ynh_permission_delete --permission="legacy_${permission}_uris"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
|
@ -340,8 +340,7 @@ ynh_add_fail2ban_config --logpath="/home/yunohost.app/$app/data/nextcloud.log" -
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring SSOwat..."
|
ynh_script_progression --message="Configuring SSOwat..."
|
||||||
|
|
||||||
ynh_app_setting_set --app=$app --key=skipped_regex \
|
ynh_permission_create --permission="api" --url="re:$(sed 's/[\.\-]/\%&/g' <<< $domain)/%.well%-known/.*"
|
||||||
--value="$(sed 's/[\.\-]/\%&/g' <<< $domain)/%.well%-known/.*"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
|
|
|
@ -134,6 +134,12 @@ then
|
||||||
ynh_replace_string "\('datadirectory' =>.*\)$old_app" "\1$app" "$final_path/config/config.php"
|
ynh_replace_string "\('datadirectory' =>.*\)$old_app" "\1$app" "$final_path/config/config.php"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ynh_legacy_permissions_exists; then
|
||||||
|
ynh_legacy_permissions_delete_all
|
||||||
|
|
||||||
|
ynh_permission_create --permission="api" --label="api" --url="re:$(sed 's/[\.\-]/\%&/g' <<< $domain)/%.well%-known/.*" --allowed="visitors" "all_users" --auth_header="false" --show_tile="false" --protected="true"
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPGRADE DEPENDENCIES
|
# UPGRADE DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -476,14 +482,6 @@ ynh_add_fail2ban_config --logpath="/home/yunohost.app/$app/data/nextcloud.log" -
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
|
||||||
# SETUP SSOWAT
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Upgrading SSOwat configuration..." --weight=2
|
|
||||||
|
|
||||||
ynh_app_setting_set --app=$app --key=skipped_regex \
|
|
||||||
--value="$(sed 's/[\.\-]/\%&/g' <<< $domain)/%.well%-known/.*"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue