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

review example_ynh

This commit is contained in:
pp-r 2021-01-26 19:19:41 +01:00 committed by GitHub
parent 8cdd152940
commit 377c0507bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,7 +19,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path) path_url=$(ynh_app_setting_get --app=$app --key=path)
#admin=$(ynh_app_setting_get --app=$app --key=admin) #admin=$(ynh_app_setting_get --app=$app --key=admin)
is_public=$(ynh_app_setting_get --app=$app --key=is_public) #is_public=$(ynh_app_setting_get --app=$app --key=is_public)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#language=$(ynh_app_setting_get --app=$app --key=language) #language=$(ynh_app_setting_get --app=$app --key=language)
#db_name=$(ynh_app_setting_get --app=$app --key=db_name) #db_name=$(ynh_app_setting_get --app=$app --key=db_name)
@ -42,12 +42,19 @@ upgrade_type=$(ynh_check_app_version_changed)
ynh_script_progression --message="Ensuring downward compatibility..." --time --weight=1 ynh_script_progression --message="Ensuring downward compatibility..." --time --weight=1
# Fix is_public as a boolean value # Fix is_public as a boolean value
if [ "$is_public" = "Yes" ]; then #if [ "$is_public" = "Yes" ]; then
ynh_app_setting_set --app=$app --key=is_public --value=1 # ynh_app_setting_set --app=$app --key=is_public --value=1
is_public=1 # is_public=1
elif [ "$is_public" = "No" ]; then #elif [ "$is_public" = "No" ]; then
ynh_app_setting_set --app=$app --key=is_public --value=0 # ynh_app_setting_set --app=$app --key=is_public --value=0
is_public=0 # is_public=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 fi
# If db_name doesn't exist, create it # If db_name doesn't exist, create it
@ -86,7 +93,7 @@ ynh_abort_if_errors
# instead of /foo .... # instead of /foo ....
# If nobody installed your app before 2.7, then you may # If nobody installed your app before 2.7, then you may
# safely remove this line # safely remove this line
path_url=$(ynh_normalize_url_path --path_url=$path_url) #path_url=$(ynh_normalize_url_path --path_url=$path_url)
#================================================= #=================================================
# STANDARD UPGRADE STEPS # STANDARD UPGRADE STEPS
@ -112,7 +119,7 @@ fi
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Upgrading nginx web server configuration..." --time --weight=1 ynh_script_progression --message="Upgrading NGINX web server configuration..." --time --weight=1
# Create a dedicated nginx config # Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config
@ -135,7 +142,7 @@ ynh_system_user_create --username=$app
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Upgrading php-fpm configuration..." --time --weight=1 ynh_script_progression --message="Upgrading PHP-FPM configuration..." --time --weight=1
# Create a dedicated php-fpm config # Create a dedicated php-fpm config
ynh_add_fpm_config ynh_add_fpm_config
@ -192,14 +199,14 @@ chown -R $app: $final_path
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================
ynh_script_progression --message="Upgrading SSOwat configuration..." --time --weight=1 #ynh_script_progression --message="Upgrading SSOwat configuration..." --time --weight=1
# Make app public if necessary # Make app public if necessary
if [ $is_public -eq 1 ] #if [ $is_public -eq 1 ]
then #then
# unprotected_uris allows SSO credentials to be passed anyway # unprotected_uris allows SSO credentials to be passed anyway
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" #ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
fi #fi
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
@ -211,7 +218,7 @@ fi
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload