From 4095e9f848431444609c375f4f1f428627e1cfaa Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 28 Nov 2021 10:38:01 +0100 Subject: [PATCH] Fix --- conf/app.src | 4 ++-- manifest.json | 2 +- scripts/install | 8 ++++++-- scripts/restore | 20 +++++++++++--------- scripts/upgrade | 2 +- 5 files changed, 21 insertions(+), 15 deletions(-) diff --git a/conf/app.src b/conf/app.src index e3289c9..41b11ef 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/ampache/ampache/archive/5.0.0.tar.gz -SOURCE_SUM=ed1deea622385b81e3d4078e7152f5b35489dcb148e64ee6e4a8a1289fc5c950 +SOURCE_URL=https://github.com/ampache/ampache/archive/5.1.1.tar.gz +SOURCE_SUM=7052e47d87df3289e45f759269ca7933e4a8fc49b4d873b60fe63721652beddd SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 4048899..6b4514b 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Web based audio/video streaming application", "fr": "Application de streaming audio et vidéo" }, - "version": "5.0.0~ynh1", + "version": "5.1.1~ynh1", "url": "http://ampache.org", "license": "AGPL-3.0", "maintainer": { diff --git a/scripts/install b/scripts/install index 590f245..4e0a2de 100644 --- a/scripts/install +++ b/scripts/install @@ -24,6 +24,7 @@ domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH admin_ampache=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC +phpversion=$YNH_PHP_VERSION app=$YNH_APP_INSTANCE_NAME @@ -46,6 +47,7 @@ ynh_script_progression --message="Storing installation settings..." --weight=2 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=admin --value=$admin_ampache +ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion #================================================= # STANDARD MODIFICATIONS @@ -72,7 +74,7 @@ ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name ynh_script_progression --message="Configuring 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 @@ -168,7 +170,9 @@ ynh_secure_remove --file=/tmp/admin.sql ynh_script_progression --message="Securing files and directories..." # Set permissions to ampache directory -chown -R $app:$app $final_path +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" chmod 600 $final_path/config/ampache.cfg.php #================================================= diff --git a/scripts/restore b/scripts/restore index bf2cddb..07b62d8 100644 --- a/scripts/restore +++ b/scripts/restore @@ -45,6 +45,14 @@ ynh_script_progression --message="Restoring the NGINX configuration..." ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +#================================================= +# RECREATE THE DEDICATED USER +#================================================= +ynh_script_progression --message="Recreating the dedicated system user..." --weight=3 + +# Create the dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -52,21 +60,15 @@ ynh_script_progression --message="Restoring the app main directory..." ynh_restore_file --origin_path="$final_path" -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=3 - -# Create the dedicated user (if not existing) -ynh_system_user_create --username=$app - #================================================= # RESTORE USER RIGHTS #================================================= ynh_script_progression --message="Restoring user rights..." # Restore permissions on app files -chown -R $app:$app $final_path +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" chmod 600 $final_path/config/ampache.cfg.php #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 1a9ddd5..a31538e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -83,7 +83,7 @@ fi ynh_script_progression --message="Making sure dedicated system user exists..." # 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