From a7c054b5358761703b622914a6d6de9d8c026dde Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Sun, 18 Sep 2016 11:09:39 +0200 Subject: [PATCH] Fix access to var directory Fix cron file EOL Fix access rights when restoring --- conf/LBCAlerte.cron | 2 +- scripts/backup | 1 - scripts/install | 12 +----------- scripts/remove | 7 ------- scripts/restore | 2 +- 5 files changed, 3 insertions(+), 21 deletions(-) diff --git a/conf/LBCAlerte.cron b/conf/LBCAlerte.cron index 0fd6ff1..20b5e57 100644 --- a/conf/LBCAlerte.cron +++ b/conf/LBCAlerte.cron @@ -1 +1 @@ -*/5 * * * * www-data /usr/bin/php -f #DESTDIR#/check.php \ No newline at end of file +*/5 * * * * www-data /usr/bin/php -f #DESTDIR#/check.php diff --git a/scripts/backup b/scripts/backup index f4e0a02..b18a2a2 100644 --- a/scripts/backup +++ b/scripts/backup @@ -10,7 +10,6 @@ app=$YNH_APP_INSTANCE_NAME source /usr/share/yunohost/helpers # Backup sources & data -# Note: the last argument is where to save this path, see the restore script. ynh_backup "/var/www/${app}" "sources" # Dump the database diff --git a/scripts/install b/scripts/install index c62bda6..73dc086 100644 --- a/scripts/install +++ b/scripts/install @@ -3,16 +3,6 @@ # Exit on command errors and treat unset variables as an error set -eu -# This is a multi-instance app, meaning it can be installed several times independently -# The id of the app as stated in the manifest is available as $YNH_APP_ID -# The instance number is available as $YNH_APP_INSTANCE_NUMBER (equals "1", "2", ...) -# The app instance name is available as $YNH_APP_INSTANCE_NAME -# - the first time the app is installed, YNH_APP_INSTANCE_NAME = ynhexample -# - the second time the app is installed, YNH_APP_INSTANCE_NAME = ynhexample__2 -# - ynhexample__{N} for the subsequent installations, with N=3,4, ... -# The app instance name is probably what you are interested the most, since this is -# guaranteed to be unique. This is a good unique identifier to define installation path, -# db names, ... app=$YNH_APP_INSTANCE_NAME # Retrieve arguments @@ -37,8 +27,8 @@ sudo mkdir -p $src_path/var sudo cp -a ../sources/. $src_path # Set permissions to app files -# you may need to make some file and/or directory writeable by www-data (nginx user) sudo chown -R root: $src_path +sudo chown -R www-data: $src_path/var # Generate MySQL password and create database dbuser=$app diff --git a/scripts/remove b/scripts/remove index 09385e5..671e5c1 100644 --- a/scripts/remove +++ b/scripts/remove @@ -1,6 +1,5 @@ #!/bin/bash -# See comments in install script app=$YNH_APP_INSTANCE_NAME # Source YunoHost helpers @@ -15,12 +14,6 @@ sudo rm -rf /var/www/$app # Remove nginx configuration file sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf -### PHP (remove if not used) ### -# If a dedicated php-fpm process is used: -# sudo rm -f /etc/php5/fpm/pool.d/$app.conf -# sudo service php5-fpm reload -### PHP end ### - # Drop MySQL database and user dbname=$app dbuser=$app diff --git a/scripts/restore b/scripts/restore index 4da8cc3..e1233b3 100644 --- a/scripts/restore +++ b/scripts/restore @@ -22,8 +22,8 @@ src_path="/var/www/${app}" sudo cp -a ./sources "$src_path" # Restore permissions to app files -# you may need to make some file and/or directory writeable by www-data (nginx user) sudo chown -R root: "$src_path" +sudo chown -R www-data: "$src_path/var" # Create and restore the database dbname=$app