From 83045191776f80f014e5bf632d139a683e867b27 Mon Sep 17 00:00:00 2001 From: mbugeia Date: Sat, 23 Jul 2016 15:41:51 +0200 Subject: [PATCH] Some fix following the use of new yunohost helpers --- conf/php-fpm.conf | 4 ++-- scripts/backup | 4 ---- scripts/install | 4 +--- scripts/remove | 1 - scripts/upgrade | 6 +++++- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index 42216d9..8b69b95 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -8,8 +8,8 @@ listen.group = www-data listen.mode = 0600 ; Unix user/group of processes. -user = #USER# -group = #GROUP# +user = www-data +group = www-data ; Choose how the process manager will control the number of child processes. pm = dynamic diff --git a/scripts/backup b/scripts/backup index 747b6f1..bdbe28f 100644 --- a/scripts/backup +++ b/scripts/backup @@ -19,10 +19,6 @@ dbpass=$(ynh_app_setting_get "$app" mysqlpwd) DESTDIR="/var/www/$app" ynh_backup "$DESTDIR" "www" -# Copy the data directory -DATADIR="/home/yunohost.app/${app}/data" -ynh_backup "$DATADIR" "data" 1 - # Copy the conf files mkdir ./conf ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "conf/nginx.conf" diff --git a/scripts/install b/scripts/install index 9cb27af..33fbb51 100644 --- a/scripts/install +++ b/scripts/install @@ -38,7 +38,7 @@ dbuser=$app # Initialize database and store mysql password for upgrade ynh_mysql_create_db "$dbname" "$dbuser" "$dbpass" -ynh_app_setting_set $app mysqlpwd $db_pwd +ynh_app_setting_set $app mysqlpwd $dbpass ynh_app_setting_set $app adminusername $admin ynh_app_setting_set $app is_public $is_public @@ -60,8 +60,6 @@ sudo chown -R www-data:www-data ${DESTDIR}/data # Copy and set php-fpm configuration phpfpm_conf="/etc/php5/fpm/pool.d/${app}.conf" -sed -i "s@#USER#@${app}@g" ../conf/php-fpm.conf -sed -i "s@#GROUP#@${app}@g" ../conf/php-fpm.conf sed -i "s@#POOLNAME#@${app}@g" ../conf/php-fpm.conf sed -i "s@#DESTDIR#@${DESTDIR}/@g" ../conf/php-fpm.conf sudo cp ../conf/php-fpm.conf "$phpfpm_conf" diff --git a/scripts/remove b/scripts/remove index 3f759da..bba4394 100644 --- a/scripts/remove +++ b/scripts/remove @@ -11,7 +11,6 @@ source /usr/share/yunohost/helpers # Drop MySQL database and user ynh_mysql_drop_db "$dbname" 2>/dev/null || true ynh_mysql_drop_user "$dbuser" 2>/dev/null || true -mysql -u root -p$root_pwd -e "DROP DATABASE $app ; DROP USER $app@localhost ;" # Retrieve domain from app settings domain=$(ynh_app_setting_get "$app" domain) diff --git a/scripts/upgrade b/scripts/upgrade index 084179b..6940eb8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -4,6 +4,10 @@ set -eu app="kanboard" +# Set app specific variables +dbname=$app +dbuser=$app + # Source app helpers source /usr/share/yunohost/helpers @@ -12,7 +16,7 @@ domain=$(ynh_app_setting_get "$app" domain) path=$(ynh_app_setting_get "$app" path) admin=$(ynh_app_setting_get "$app" adminusername) email=$(sudo yunohost user info $admin | grep mail: | sed "s/mail: //g") -db_pwd=$(ynh_app_setting_get "$app" mysqlpwd) +dbpass=$(ynh_app_setting_get "$app" mysqlpwd) is_public=$(ynh_app_setting_get "$app" is_public) if [ -z $is_public ] then # Old version doesnt have is_public settings