From de83d50a57724538889e4e821242759615f157f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 9 Jan 2024 14:14:54 +0100 Subject: [PATCH] fix --- scripts/install | 5 +++-- scripts/upgrade | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 53fd869..9e9b77a 100644 --- a/scripts/install +++ b/scripts/install @@ -13,6 +13,7 @@ source /usr/share/yunohost/helpers # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= +mail=$(ynh_user_get_info --username="$admin" --key='mail') deskey=$(ynh_string_random --length=24) ynh_app_setting_set --app=$app --key=deskey --value=$deskey @@ -24,8 +25,8 @@ ynh_script_progression --message="Setting up source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" +chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" -chmod -R 750 "$install_dir" #================================================= # SYSTEM CONFIGURATION @@ -49,6 +50,7 @@ ynh_add_config --template=".env" --destination="$install_dir/.env" # Restrict rights to aeneria user only chmod 600 "$install_dir/.env" +chown $app:$app "$install_dir/.env" #================================================= # INSTALL AENERIA @@ -59,7 +61,6 @@ ynh_script_progression --message="Installing aeneria..." --weight=1 pushd $install_dir ynh_exec_as $app php$phpversion bin/console aeneria:install "$app" -n # Create admin user - mail=$(ynh_user_get_info --username="$admin" --key='mail') ynh_exec_as $app php$phpversion bin/console aeneria:user:add "$mail" "$(ynh_string_random)" -n ynh_exec_as $app php$phpversion bin/console aeneria:user:grant "$mail" popd diff --git a/scripts/upgrade b/scripts/upgrade index 0676498..057c21f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -67,8 +67,8 @@ then ynh_secure_remove --file="$tmpdir" fi +chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" -chmod -R 750 "$install_dir" #================================================= # REAPPLY SYSTEM CONFIGURATIONS @@ -96,6 +96,7 @@ ynh_add_config --template=".env" --destination="$install_dir/.env" # Restrict rights to aeneria user only chmod 600 "$install_dir/.env" +chown $app:$app "$install_dir/.env" #================================================= # UPGRADE AENERIA