From 87e313cd411c862274f548bae2e2787fbf54d383 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 11 Apr 2021 21:09:07 +0200 Subject: [PATCH] Fix rights --- scripts/install | 18 +++++++++--------- scripts/restore | 2 +- scripts/upgrade | 18 +++++++++--------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/scripts/install b/scripts/install index a7c1f7d..fdc802b 100644 --- a/scripts/install +++ b/scripts/install @@ -107,7 +107,7 @@ ynh_setup_source --dest_dir="$final_path" chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R root:$app "$final_path" +chown -R $app:$app "$final_path" #================================================= # NGINX CONFIGURATION @@ -126,14 +126,6 @@ ynh_script_progression --message="Creating LDAP user..." yunohost user create $ldap_user --firstname "SvcWikijsLdap" --lastname "SvcWikijsLdap" --mail ${ldap_user}@$domain --password $ldap_password -q 0 -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." - -# Create a dedicated systemd config -ynh_add_systemd_config --others_var="ynh_node ynh_node_load_PATH" - #================================================= # ADD A CONFIGURATION #================================================= @@ -144,6 +136,14 @@ ynh_add_config --template="../conf/config.sample.yml" --destination="$final_path chmod 400 "$final_path/config.yml" chown $app:$app "$final_path/config.yml" +#================================================= +# SETUP SYSTEMD +#================================================= +ynh_script_progression --message="Configuring a systemd service..." + +# Create a dedicated systemd config +ynh_add_systemd_config --others_var="ynh_node ynh_node_load_PATH" + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index ef3b689..a800bff 100644 --- a/scripts/restore +++ b/scripts/restore @@ -72,7 +72,7 @@ ynh_restore_file --origin_path="$final_path" chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R root:$app "$final_path" +chown -R $app:$app "$final_path" #================================================= # SPECIFIC RESTORATION diff --git a/scripts/upgrade b/scripts/upgrade index 2ff52f4..5727f20 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -132,7 +132,7 @@ fi chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R root:$app "$final_path" +chown -R $app:$app "$final_path" #================================================= # NGINX CONFIGURATION @@ -153,14 +153,6 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= # SPECIFIC UPGRADE -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Upgrading systemd configuration..." - -# Create a dedicated systemd config -ynh_add_systemd_config --others_var="ynh_node ynh_node_load_PATH" - #================================================= # UPDATE A CONFIG FILE #================================================= @@ -171,6 +163,14 @@ ynh_add_config --template="../conf/config.sample.yml" --destination="$final_path chmod 400 "$final_path/config.yml" chown $app:$app "$final_path/config.yml" +#================================================= +# SETUP SYSTEMD +#================================================= +ynh_script_progression --message="Upgrading systemd configuration..." + +# Create a dedicated systemd config +ynh_add_systemd_config --others_var="ynh_node ynh_node_load_PATH" + #================================================= # GENERIC FINALIZATION #=================================================