From 6674c2a55f78a39b72fd01c526792fe55d2837a1 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sat, 18 Dec 2021 23:52:39 +0100 Subject: [PATCH] Update config.xml in upgrade and fix its permissions --- scripts/install | 3 +++ scripts/restore | 3 +++ scripts/upgrade | 11 +++++++++++ 3 files changed, 17 insertions(+) diff --git a/scripts/install b/scripts/install index 029f01c..bd90ec2 100755 --- a/scripts/install +++ b/scripts/install @@ -134,6 +134,9 @@ chmod 750 "$data_path" chmod -R o-rwx "$data_path" chown -R $app: "$data_path" +chmod 400 "$data_path/config.xml" +chown $app:$app "$data_path/config.xml" + #================================================= # YUNOHOST MULTIMEDIA INTEGRATION #================================================= diff --git a/scripts/restore b/scripts/restore index b8e9be7..a8ee45b 100755 --- a/scripts/restore +++ b/scripts/restore @@ -83,6 +83,9 @@ chmod 750 "$data_path" chmod -R o-rwx "$data_path" chown -R $app: "$data_path" +chmod 400 "$data_path/config.xml" +chown $app:$app "$data_path/config.xml" + #================================================= # YUNOHOST MULTIMEDIA INTEGRATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 6700ffb..7912241 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,6 +22,7 @@ admin=$(ynh_app_setting_get --app=$app --key=admin) port=$(ynh_app_setting_get --app=$app --key=port) final_path=$(ynh_app_setting_get --app=$app --key=final_path) data_path=$(ynh_app_setting_get --app=$app --key=data_path) +api_key=$(ynh_app_setting_get --app=$app --key=api_key) #================================================= # CHECK VERSION @@ -131,6 +132,16 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config +#================================================= +# UPDATE A CONFIG FILE +#================================================= +ynh_script_progression --message="Updating the configuration file.." --weight=1 + +ynh_add_config --template="../conf/config.xml" --destination="$data_path/config.xml" + +chmod 400 "$data_path/config.xml" +chown $app:$app "$data_path/config.xml" + #================================================= # GENERIC FINALIZATION #=================================================