From 8c6f0e487f20c22eb348a01deb8faa156ec910f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 22 Oct 2023 18:52:48 +0200 Subject: [PATCH] cleaning --- scripts/change_url | 13 ++++++++----- scripts/install | 2 +- scripts/upgrade | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 828f8de..e0776dd 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Stopping a systemd service..." -ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped vaultwarden Server" +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped vaultwarden Server" #================================================= # MODIFY URL IN NGINX CONF @@ -32,14 +32,17 @@ ynh_change_url_nginx_config #================================================= ynh_script_progression --message="Modifying a config file..." -config="$install_dir/live/.env" +ynh_add_config --template="vaultwarden.env" --destination="$install_dir/live/.env" -ynh_backup_if_checksum_is_different --file="$config" +chmod 400 "$install_dir/live/.env" +chown $app:$app "$install_dir/live/.env" -ynh_replace_string --match_string="DOMAIN=https://$old_domain$old_path" --replace_string="DOMAIN=https://$new_domain$new_path" --target_file="$config" +#ynh_backup_if_checksum_is_different --file="$install_dir/live/.env" + +#ynh_replace_string --match_string="DOMAIN=https://$old_domain$old_path" --replace_string="DOMAIN=https://$new_domain$new_path" --target_file="$install_dir/live/.env" # Recalculate and store the checksum of the file for the next upgrade. -ynh_store_file_checksum --file="$config" +#ynh_store_file_checksum --file="$install_dir/live/.env" #================================================= # GENERIC FINALISATION diff --git a/scripts/install b/scripts/install index 33d52f3..0dcd2ab 100644 --- a/scripts/install +++ b/scripts/install @@ -85,7 +85,7 @@ chown -R $app:$app "$install_dir" #================================================= ynh_script_progression --message="Adding a configuration file..." -ynh_add_config --template="../conf/vaultwarden.env" --destination="$install_dir/live/.env" +ynh_add_config --template="vaultwarden.env" --destination="$install_dir/live/.env" chmod 400 "$install_dir/live/.env" chown $app:$app "$install_dir/live/.env" diff --git a/scripts/upgrade b/scripts/upgrade index bcace32..916e740 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -70,7 +70,7 @@ chown -R $app:$app "$install_dir" #================================================= ynh_script_progression --message="Updating a configuration file..." -ynh_add_config --template="../conf/vaultwarden.env" --destination="$install_dir/live/.env" +ynh_add_config --template="vaultwarden.env" --destination="$install_dir/live/.env" chmod 400 "$install_dir/live/.env" chown $app:$app "$install_dir/live/.env"