diff --git a/scripts/change_url b/scripts/change_url index 972eb62..1e796e5 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -28,11 +28,7 @@ ynh_script_progression --message="Loading installation settings..." # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) - -# Add settings here as needed by your application -#db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#db_user=$db_name -#db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) +port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP diff --git a/scripts/install b/scripts/install index 09c35ec..84489e5 100644 --- a/scripts/install +++ b/scripts/install @@ -179,13 +179,14 @@ ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --lin #================================================= # 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=unprotected_uris --value="/" + # Everyone can access the app. + # The "main" permission is automatically created before the install script. + ynh_permission_update --permission="main" --add="visitors" fi #================================================= diff --git a/scripts/remove b/scripts/remove index 3fb0543..8bf492d 100644 --- a/scripts/remove +++ b/scripts/remove @@ -77,16 +77,6 @@ ynh_script_progression --message="Removing NGINX web server configuration..." # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# CLOSE A PORT -#================================================= - -if yunohost firewall list | grep -q "\- $port$" -then - ynh_script_progression --message="Closing port $port..." - ynh_exec_warn_less yunohost firewall disallow TCP $port -fi - #================================================= # SPECIFIC REMOVE #================================================= diff --git a/scripts/restore b/scripts/restore index f23531c..34e581e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -120,7 +120,7 @@ yunohost service add $app --description="$app daemon for Wiki.js" --log="/var/lo #================================================= ynh_script_progression --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="HTTP Server:" +ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="HTTP Server:" #================================================= # CREATE LDAP USER diff --git a/scripts/upgrade b/scripts/upgrade index 0c012c6..a6f35d4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -71,6 +71,13 @@ if [[ -z "$ldap_user" ]]; then yunohost user create $ldap_user --firstname "SvcWikijsLdap" --lastname "SvcWikijsLdap" --mail ${ldap_user}@$domain --password $ldap_password -q 0 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 + # Remove yarn repository ynh_secure_remove --file="/etc/apt/sources.list.d/yarn.list" @@ -203,7 +210,7 @@ ynh_add_systemd_config --others_var="ynh_node ynh_node_load_PATH" ynh_script_progression --message="Securing files and directories..." # Set permissions on app files -chown -R "$app":"$app" "$final_path" +chown -R $app: "$final_path" #================================================= # INTEGRATE SERVICE IN YUNOHOST @@ -212,18 +219,6 @@ ynh_script_progression --message="Integrating service in YunoHost..." yunohost service add $app --description="$app daemon for Wiki.js" --log="/var/log/$app/$app.log" -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." - -# 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=unprotected_uris --value="/" -fi - #================================================= # START SYSTEMD SERVICE #=================================================