From d7606f928a474f41d92dc4676c2fe01f4c60b3f5 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 1 Jan 2022 21:54:34 +0100 Subject: [PATCH] 2.1.3 --- conf/app.src | 4 ++-- manifest.json | 2 +- scripts/install | 17 +++++------------ scripts/restore | 20 ++++++++++++-------- scripts/upgrade | 15 ++++----------- 5 files changed, 24 insertions(+), 34 deletions(-) diff --git a/conf/app.src b/conf/app.src index f2edea3..29386eb 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/mengshukeji/Luckysheet/archive/v2.0.0.tar.gz -SOURCE_SUM=697e79a4d033506074f8e0261ff94cee6e4360b7f0634cb9de53ae59edcec1fe +SOURCE_URL=https://github.com/mengshukeji/Luckysheet/archive/v2.1.3.tar.gz +SOURCE_SUM=7c90d5e5ab1e80fedda0f22c0f5bd52bccc26368d1fbb0c774dc4681fee7a923 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 8aaad75..93b0093 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Online spreadsheet that is powerful, simple to configure", "fr": "Feuille de calcul en ligne, puissante, simple à configurer" }, - "version": "2.0.0~ynh4", + "version": "2.1.3~ynh1", "url": "https://github.com/mengshukeji/Luckysheet", "license": "MIT", "maintainer": { diff --git a/scripts/install b/scripts/install index 3f432cc..1cc5c78 100644 --- a/scripts/install +++ b/scripts/install @@ -84,6 +84,10 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir=$final_path +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= @@ -109,7 +113,7 @@ popd # MODIFY A CONFIG FILE #================================================= -cp ../conf/config.example.js $final_path/src/config.js +ynh_add_config --template="../conf/config.example.js" --destination="$final_path/src/config.js" #================================================= # SETUP SYSTEMD @@ -117,20 +121,9 @@ cp ../conf/config.example.js $final_path/src/config.js ynh_script_progression --message="Configuring a systemd service..." --weight=1 ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service" -ynh_replace_string --match_string="__YNH_NPM__" --replace_string="$ynh_npm" --target_file="../conf/systemd.service" ynh_add_systemd_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= -ynh_script_progression --message="Securing files and directories..." --weight=1 - -# Set permissions to app files -chown -R $app: $final_path - #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= diff --git a/scripts/restore b/scripts/restore index e726e8d..1f66caa 100644 --- a/scripts/restore +++ b/scripts/restore @@ -46,20 +46,24 @@ ynh_script_progression --message="Restoring the NGINX configuration..." --weight ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# RESTORE THE APP MAIN DIR -#================================================= -ynh_script_progression --message="Restoring Luckysheet main directory..." --weight=50 - -ynh_restore_file --origin_path="$final_path" - #================================================= # RECREATE THE DEDICATED USER #================================================= ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 # 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 +#================================================= +ynh_script_progression --message="Restoring Luckysheet main directory..." --weight=5 + +ynh_restore_file --origin_path="$final_path" + +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # RESTORE USER RIGHTS diff --git a/scripts/upgrade b/scripts/upgrade index 0ffd634..f69018d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,7 +24,6 @@ port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) @@ -86,6 +85,10 @@ then ynh_setup_source --dest_dir=$final_path fi +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= @@ -128,16 +131,6 @@ ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --targ # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= -ynh_script_progression --message="Securing files and directories..." --weight=1 - -# Set permissions on app files -chown -R $app: $final_path - #================================================= # INTEGRATE SERVICE IN YUNOHOST #=================================================