From 339a25c9363779f3f28af40659acce9a0feef791 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Mon, 30 Oct 2017 10:59:00 +0100 Subject: [PATCH] Fix plugin installation and sessions --- conf/php-fpm.conf | 1 + scripts/install | 4 +++- scripts/upgrade | 18 ++++++++++-------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index cf24884..2a80b9b 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -69,3 +69,4 @@ php_value[upload_max_filesize] = 10G php_value[post_max_size] = 10G php_value[default_charset] = UTF-8 php_value[always_populate_raw_post_data] = -1 +php_value[session.save_path] = /var/www/__NAMETOCHANGE__/sessions diff --git a/scripts/install b/scripts/install index 298aad4..057a26d 100644 --- a/scripts/install +++ b/scripts/install @@ -83,6 +83,7 @@ ynh_app_setting_set "$app" mysqlpwd "$dbpass" # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source "$final_path" +mkdir -p "$final_path"/sessions/ #================================================= # NGINX CONFIGURATION @@ -137,7 +138,8 @@ ynh_mysql_connect_as "$dbuser" "$dbpass" "$dbname" < "${final_path}/app/Schema/S # Set permissions to kanboard and data directory chown -R root:root "$final_path" -chown -R "$app" "$final_path"/{data,plugins} +chown -R "$app" "$final_path"/{data,plugins,sessions} +chmod -R 700 "$final_path"/sessions #================================================= # SETUP SSOWAT diff --git a/scripts/upgrade b/scripts/upgrade index dda532d..33ced7a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -82,6 +82,7 @@ ynh_abort_if_errors mv "$final_path" "$final_path.old" ynh_setup_source "$final_path" +mkdir -p "$final_path"/sessions # restore data cp -a "$final_path.old/data" "$final_path" @@ -108,9 +109,6 @@ ynh_add_nginx_config # Create a system user ynh_system_user_create "$app" -# flush php sessions before upgrade -/usr/lib/php5/sessionclean - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -138,10 +136,13 @@ ynh_replace_string "yuno_domain" "$domain" "$config_php" # Database initialization #================================================= -# Launch database migration -"$final_path"/cli db:migrate -# Launch database migration -"$final_path"/cli plugin:upgrade +( + cd "$final_path" + # Launch database migratio + php cli db:migrate --no-interaction --verbose + # Launch plugins migration + php cli plugin:upgrade --no-interaction --verbose +) #================================================= # GENERIC FINALIZATION @@ -151,7 +152,8 @@ ynh_replace_string "yuno_domain" "$domain" "$config_php" # Set permissions to kanboard and data directory chown -R root:root "$final_path" -chown -R "$app" "$final_path"/{data,plugins} +chown -R "$app" "$final_path"/{data,plugins,sessions} +chmod -R 700 "$final_path"/sessions #================================================= # SETUP SSOWAT