1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/discourse_ynh.git synced 2024-09-03 18:26:18 +02:00

Set new permissions

This commit is contained in:
ericgaspar 2021-03-12 21:13:21 +01:00
parent ad64fbbfd6
commit 6dc5200b39
No known key found for this signature in database
GPG key ID: 574F281483054D44
2 changed files with 9 additions and 16 deletions

View file

@ -53,7 +53,6 @@ ynh_script_progression --message="Storing installation settings..."
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
#=================================================
# STANDARD MODIFICATIONS
@ -352,13 +351,13 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="$final_path/
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Configuring SSOwat..."
ynh_script_progression --message="Configuring permissions..."
# Make app public if necessary
if [ $is_public -eq 1 ]
then
# unprotected_uris allows SSO credentials to be passed anyway.
ynh_app_setting_set --app=$app --key=skipped_uris --value="/"
ynh_permission_update --permission="main" --add="visitors"
fi
#=================================================

View file

@ -19,7 +19,6 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
admin=$(ynh_app_setting_get --app=$app --key=admin)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
@ -55,6 +54,13 @@ then
ynh_app_setting_set --app=$app --key=unicorn_workers --value=$unicorn_workers
fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
@ -374,18 +380,6 @@ chown -R $app: $final_path
# Restrict rights to log directory (needed by logrotate)
chmod g-w $final_path/log
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Upgrading SSOwat configuration..."
# If app is public, add url to SSOWat conf as skipped_uris
if [ $is_public -eq 1 ]
then
# unprotected_uris allows SSO credentials to be passed anyway.
ynh_app_setting_set "$app" skipped_uris "/"
fi
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================