From 8924f6273e393f9eb443caf25d95cb6719732a32 Mon Sep 17 00:00:00 2001 From: polytan02 Date: Mon, 10 Aug 2015 15:04:45 +0100 Subject: [PATCH] Modification od base config file --- conf/config.php | 12 ++++++------ scripts/install | 25 +++++++++++++++++-------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/conf/config.php b/conf/config.php index 9b51d70..6ffc20c 100644 --- a/conf/config.php +++ b/conf/config.php @@ -48,14 +48,14 @@ define('TIMEZONE', ''); // Defines the base path on the server - define('BASE_PATH', dirname(__FILE__) . '/'); + define('BASE_PATH', dirname($_SERVER['SCRIPT_FILENAME']). '/'); // Try to set unlimited timeout define('SCRIPT_TIMEOUT', 0); // Your PHP could have a bug when base64 encoding: https://bugs.php.net/bug.php?id=68532 // NOTE: Run "php testing/testing-bug68532fixed.php" to know what value put here - define('BUG68532FIXED', true); + define('BUG68532FIXED', false); // When accessing through a proxy, the "X-Forwarded-For" header contains the original remote IP define('USE_X_FORWARDED_FOR_HEADER', false); @@ -111,7 +111,7 @@ /********************************************************************************** * Default FileStateMachine settings */ - define('STATE_DIR', '/var/lib/z-push/'); + define('STATE_DIR', 'ALIASTOCHANGE/'); /********************************************************************************** @@ -147,7 +147,7 @@ * ones, e.g. setting to LOGLEVEL_DEBUG will also output LOGLEVEL_FATAL, LOGLEVEL_ERROR, * LOGLEVEL_WARN and LOGLEVEL_INFO level entries. */ - define('LOGFILEDIR', '/var/log/z-push/'); + define('LOGFILEDIR', 'LOGTOCHANGE/'); define('LOGFILE', LOGFILEDIR . 'z-push.log'); define('LOGERRORFILE', LOGFILEDIR . 'z-push-error.log'); define('LOGLEVEL', LOGLEVEL_INFO); @@ -172,7 +172,7 @@ define('LOG_MEMORY_PROFILER', true); - define('LOG_MEMORY_PROFILER_FILE', '/var/log/z-push/memory_profile'); + define('LOG_MEMORY_PROFILER_FILE', 'LOGTOCHANGE/memory_profile'); /********************************************************************************** * Mobile settings @@ -276,7 +276,7 @@ * Backend settings */ // the backend data provider - define('BACKEND_PROVIDER', ''); + define('BACKEND_PROVIDER', 'BACKENDTOCHANGE'); // top collector backend class name // Default is: TopCollector diff --git a/scripts/install b/scripts/install index b926fe8..ff4487e 100644 --- a/scripts/install +++ b/scripts/install @@ -14,14 +14,17 @@ fi # Prereqs sudo apt-get install php-soap php5-imap libawl-php php5-xsl -y -# Copy files to the right place +final_logpath=/var/log/$app final_path=/var/www/$app + +# Copy files to the right place sudo mkdir -p $final_path sudo cp -a ../sources/* $final_path # Configuration -sed -i "s^define('TIMEZONE', .*^define('TIMEZONE', '$(cat /etc/timezone)');^" ../conf/config*.php -sed -i "s@ALIASTOCHANGE@$final_path/@g" ../conf/config*.php +sed -i "s^define('TIMEZONE', .*^define('TIMEZONE', '$(cat /etc/timezone)');^" ../conf/config.php +sed -i "s@ALIASTOCHANGE@$final_path@g" ../conf/config.php +sed -i "s@LOGTOCHANGE@$final_logpath@g" ../conf/config.php # Enable caldav carddav support sudo yunohost app list -f baikal --json | grep '"installed": true' @@ -31,20 +34,26 @@ if [ "$?" -eq 0 ]; then caldavpath=$(sudo yunohost app setting baikal path) caldavpath=${caldavpath%/} + # Configuration of backend + sed -i "s@BACKENDTOCHANGE@BackendCombined@g" ../conf/config.php + # Configuration baikal sed -i "s@BAIKALDOMAIN@$caldavdomain@g" ../conf/backend/config*.php sed -i "s@BAIKALPATH@$caldavpath@g" ../conf/backend/config*.php sed -i "s@DOMAINTOCHANGE@$domain@g" ../conf/backend/config-imap.php # Copy config - sudo cp ../conf/config-combined.php $final_path/config.php + sudo cp ../conf/config.php $final_path/config.php sudo cp ../conf/backend/config-imap.php $final_path/backend/imap/config.php sudo cp ../conf/backend/config-carddav.php $final_path/backend/carddav/config.php sudo cp ../conf/backend/config-caldav.php $final_path/backend/caldav/config.php sudo cp ../conf/backend/config-combined.php $final_path/backend/combined/config.php else + # Configuration of backend + sed -i "s@BACKENDTOCHANGE@BackendIMAP@g" ../conf/config.php + # Copy config - sudo cp ../conf/config.php $final_path/ + sudo cp ../conf/config.php $final_path/config.php sed -i "s@DOMAINTOCHANGE@$domain@g" ../conf/backend/config-imap.php sudo cp ../conf/backend/config-imap.php $final_path/backend/imap/config.php @@ -55,9 +64,9 @@ sudo chown -R www-data: $final_path # Create log directory -sudo mkdir -p /var/log/$app -sudo chmod 750 /var/log/$app -sudo chown www-data:www-data /var/log/$app +sudo mkdir -p $final_logpath +sudo chmod 750 $final_logpath +sudo chown www-data:www-data $final_logpath #Copy XMLElement.php sudo ln -s /usr/share/awl/inc/XML* /var/www/z-push/include/