From 3422afb7da974277a50d26c9b6eb07f6c156728f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 18 Jan 2023 09:27:54 +0100 Subject: [PATCH] Fix --- conf/.env.production | 2 +- scripts/install | 1 - scripts/remove | 12 ++++++------ scripts/upgrade | 6 ++++++ 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/conf/.env.production b/conf/.env.production index 56bac8d..a4abbd8 100644 --- a/conf/.env.production +++ b/conf/.env.production @@ -1,7 +1,7 @@ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY="__KEY__" -# SECURITY WARNING: don 't run with debug turned on in production! +# SECURITY WARNING: don't run with debug turned on in production! DEBUG=false USE_HTTPS=true diff --git a/scripts/install b/scripts/install index 03b297e..defe995 100755 --- a/scripts/install +++ b/scripts/install @@ -40,7 +40,6 @@ key=$(ynh_string_random --length=32) #================================================= ynh_script_progression --message="Validating installation parameters..." --weight=1 - final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" diff --git a/scripts/remove b/scripts/remove index 3f2e27b..7eb1731 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -39,7 +39,7 @@ fi #================================================= # STOP AND REMOVE SERVICE #================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 +ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 ynh_systemd_action --service_name="${app}-beat" --action="stop" --log_path="systemd" --line_match="Stopped $app" ynh_systemd_action --service_name="${app}-server" --action="stop" --log_path="systemd" --line_match="Stopped $app" @@ -55,7 +55,7 @@ ynh_secure_remove --file="/etc/systemd/system/$app.target" #================================================= # REMOVE LOGROTATE CONFIGURATION #================================================= -ynh_script_progression --message="Removing logrotate configuration..." --weight=1 +ynh_script_progression --message="Removing logrotate configuration..." --weight=1 # Remove the app-specific logrotate config ynh_remove_logrotate @@ -71,7 +71,7 @@ ynh_psql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --weight=1 +ynh_script_progression --message="Removing app main directory..." --weight=1 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -83,14 +83,14 @@ ynh_secure_remove --file="$final_path" # Remove the data directory if --purge option is used if [ "${YNH_APP_PURGE:-0}" -eq 1 ] then - ynh_script_progression --message="Removing app data directory..." --weight=1 + ynh_script_progression --message="Removing app data directory..." --weight=1 ynh_secure_remove --file="$datadir" fi #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 +ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 # Remove the dedicated NGINX config ynh_remove_nginx_config diff --git a/scripts/upgrade b/scripts/upgrade index f941db4..f9d2ad2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -99,6 +99,12 @@ mkdir "$final_path/venv" python3 -m venv "$final_path/venv" $final_path/venv/bin/pip3 install -r "$final_path/requirements.txt" +#================================================= +# SET PERMISSIONS ON BOOKWYRM DIRECTORY +#================================================= + +chown -R $app:www-data $final_path + #================================================= # NGINX CONFIGURATION #=================================================