1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/z-push_ynh.git synced 2024-09-03 18:05:58 +02:00

Apply last example_ynh

This commit is contained in:
yalh76 2021-04-10 02:06:00 +02:00
parent 346c3505d3
commit c65b32ae06
3 changed files with 8 additions and 11 deletions

View file

@ -69,7 +69,7 @@ ynh_install_app_dependencies $pkg_dependencies
ynh_script_progression --message="Configuring system user..." ynh_script_progression --message="Configuring system user..."
# Create a system user # Create a system user
ynh_system_user_create --username=$app ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -78,8 +78,7 @@ ynh_script_progression --message="Setting up source files..."
ynh_app_setting_set --app=$app --key=final_path --value=$final_path ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
mkdir "$final_path" mkdir -p "$final_path/tmp"
mkdir "$final_path/tmp"
ynh_setup_source --dest_dir="$final_path/tmp" ynh_setup_source --dest_dir="$final_path/tmp"
cp -a "$final_path/tmp/src/." "$final_path/." cp -a "$final_path/tmp/src/." "$final_path/."
ynh_secure_remove "$final_path/tmp" ynh_secure_remove "$final_path/tmp"
@ -233,7 +232,7 @@ ynh_script_progression --message="Configuring permissions..."
ynh_permission_update --permission="main" --add="visitors" ynh_permission_update --permission="main" --add="visitors"
domain_regex=$(echo "$domain" | sed 's@-@.@g') domain_regex=$(echo "$domain" | sed 's@-@.@g')
ynh_permission_create --permission="autodiscover" --url "re:$domain_regex/[Aa]uto[Dd]iscover/.*" --allowed="visitors" --show_tile="false" --protected="true" ynh_permission_create --permission="autodiscover" --url="re:$domain_regex/[Aa]uto[Dd]iscover/.*" --allowed="visitors" --show_tile="false" --protected="true"
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX

View file

@ -59,7 +59,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_script_progression --message="Recreating the dedicated system user..." ynh_script_progression --message="Recreating the dedicated system user..."
# Create the dedicated user (if not existing) # Create the dedicated user (if not existing)
ynh_system_user_create --username=$app ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
@ -70,15 +70,13 @@ ynh_restore_file --origin_path="$final_path"
# Restore statedir # Restore statedir
ynh_restore_file --origin_path="$statedir" --not_mandatory ynh_restore_file --origin_path="$statedir" --not_mandatory
# Restore logs, data & permissions
ynh_restore_file --origin_path="$final_logpath" --not_mandatory
mkdir -p $statedir mkdir -p $statedir
chmod 750 "$statedir" chmod 750 "$statedir"
chmod -R o-rwx "$statedir" chmod -R o-rwx "$statedir"
chown -R root:$app "$statedir" chown -R root:$app "$statedir"
# Restore logs, data & permissions
ynh_restore_file --origin_path="$final_logpath" --not_mandatory
mkdir -p $final_logpath mkdir -p $final_logpath
chmod 750 "$final_logpath" chmod 750 "$final_logpath"
chmod -R o-rwx "$final_logpath" chmod -R o-rwx "$final_logpath"

View file

@ -56,7 +56,7 @@ if ynh_legacy_permissions_exists; then
fi fi
#================================================= #=================================================
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." ynh_script_progression --message="Backing up the app before upgrading (may take a while)..."
@ -77,7 +77,7 @@ ynh_abort_if_errors
ynh_script_progression --message="Making sure dedicated system user exists..." ynh_script_progression --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing) # Create a dedicated user (if not existing)
ynh_system_user_create --username=$app ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE