No known key found for this signature in database
GPG Key ID: AAFEEB16CFA2AE2D
9 changed files with 34 additions and 177 deletions
-
12actions.toml
-
9config_panel.toml
-
80scripts/actions/public_private
-
16scripts/actions/reset_default_app
-
3scripts/actions/reset_default_system
-
17scripts/config
-
19scripts/install
-
1scripts/restore
-
54scripts/upgrade
@ -1,80 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
|
|
||||
#================================================= |
|
||||
# GENERIC STARTING |
|
||||
#================================================= |
|
||||
# IMPORT GENERIC HELPERS |
|
||||
#================================================= |
|
||||
|
|
||||
source /usr/share/yunohost/helpers |
|
||||
|
|
||||
#================================================= |
|
||||
# MANAGE SCRIPT FAILURE |
|
||||
#================================================= |
|
||||
|
|
||||
# Exit if an error occurs during the execution of the script |
|
||||
ynh_abort_if_errors |
|
||||
|
|
||||
#================================================= |
|
||||
# RETRIEVE ARGUMENTS |
|
||||
#================================================= |
|
||||
|
|
||||
# Get is_public |
|
||||
is_public=${YNH_ACTION_IS_PUBLIC} |
|
||||
|
|
||||
app=$YNH_APP_INSTANCE_NAME |
|
||||
|
|
||||
#================================================= |
|
||||
# CHECK IF ARGUMENTS ARE CORRECT |
|
||||
#================================================= |
|
||||
|
|
||||
#================================================= |
|
||||
# CHECK IF AN ACTION HAS TO BE DONE |
|
||||
#================================================= |
|
||||
|
|
||||
is_public_old=$(ynh_app_setting_get --app=$app --key=is_public) |
|
||||
|
|
||||
if [ $is_public -eq $is_public_old ] |
|
||||
then |
|
||||
ynh_die --message="is_public is already set as $is_public." --ret_code=0 |
|
||||
fi |
|
||||
|
|
||||
#================================================= |
|
||||
# SPECIFIC ACTION |
|
||||
#================================================= |
|
||||
# MOVE TO PUBLIC OR PRIVATE |
|
||||
#================================================= |
|
||||
|
|
||||
if [ $is_public -eq 0 ]; then |
|
||||
public_private="private" |
|
||||
else |
|
||||
public_private="public" |
|
||||
fi |
|
||||
ynh_script_progression --message="Moving the application to $public_private..." --weight=3 |
|
||||
|
|
||||
if [ $is_public -eq 0 ] |
|
||||
then |
|
||||
ynh_app_setting_delete --app=$app --key=unprotected_uris |
|
||||
else |
|
||||
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" |
|
||||
fi |
|
||||
|
|
||||
ynh_script_progression --message="Upgrading SSOwat configuration..." |
|
||||
# Regen ssowat configuration |
|
||||
yunohost app ssowatconf |
|
||||
|
|
||||
# Update the config of the app |
|
||||
ynh_app_setting_set --app=$app --key=is_public --value=$is_public |
|
||||
|
|
||||
#================================================= |
|
||||
# RELOAD NGINX |
|
||||
#================================================= |
|
||||
ynh_script_progression --message="Reloading NGINX web server..." |
|
||||
|
|
||||
ynh_systemd_action --service_name=nginx --action=reload |
|
||||
|
|
||||
#================================================= |
|
||||
# END OF SCRIPT |
|
||||
#================================================= |
|
||||
|
|
||||
ynh_script_progression --message="Execution completed" --last |
|
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue