summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2018-02-23 02:11:06 +0100
committerSuren A. Chilingaryan <csa@suren.me>2018-02-23 02:11:06 +0100
commitb81418759a81dd1e3064a6a5975271277d5c51c8 (patch)
tree15126dcb07609df7b75141842a4f2b3cb3dbe350
parent56bca63e5daf375f13500c0a79f2ddf2b678769d (diff)
downloadadei-b81418759a81dd1e3064a6a5975271277d5c51c8.tar.gz
adei-b81418759a81dd1e3064a6a5975271277d5c51c8.tar.bz2
adei-b81418759a81dd1e3064a6a5975271277d5c51c8.tar.xz
adei-b81418759a81dd1e3064a6a5975271277d5c51c8.zip
Save session variables in writable /tmp folder
-rw-r--r--adei/configs/adei.cron.sh81
-rw-r--r--adei/configs/adei_clean.cron.sh21
-rw-r--r--adei/configs/adei_manager.cron.sh74
-rw-r--r--adei/configs/config.actual.php22
-rwxr-xr-xadei/scripts/configure.sh1
5 files changed, 1 insertions, 198 deletions
diff --git a/adei/configs/adei.cron.sh b/adei/configs/adei.cron.sh
deleted file mode 100644
index eccb4cb..0000000
--- a/adei/configs/adei.cron.sh
+++ /dev/null
@@ -1,81 +0,0 @@
-#! /bin/bash
-
-function process_setup {
- setup="$1"
- parallel="$2"
-
- local args="-parallel $parallel"
- if [ -n "$setup" ]; then
- args="$args -setup $setup"
- else
- setup=$(php -r 'require "adei.php"; echo $ADEI_SETUP;')
- fi
-
- if [ ! -d "setups/$setup" ]; then
- echo "$setup is not existing"
- return
- fi
-
- if [ -f setups/$setup/adei.cron.sh ]; then
- setups/$setup/adei.cron.sh
- return
- fi
-
- /usr/bin/php system/cache.php $args
-}
-
-[ -f /adei/env ] && . /adei/env
-
-script=$( cd $(dirname "$0") && pwd )/$( basename "$0" )
-if [ -f /adei/sys/adei.cron.sh -a "$script" != /adei/sys/adei.cron.sh ]; then
- /adei/sys/adei.cron.sh
- exit
-fi
-
-(
- cd /srv/www/htdocs/adei
-
-# Link extra setups from docker installation
- if [ -d /adei/cfg ]; then
- for cfg in /adei/cfg/*/config.php; do
- [ -f "$cfg" ] || break
- path=$(dirname $cfg)
- setup=$(basename $path)
- if [[ ! -a "setups/$setup" ]]; then
- ln -s $path setups/$setup
- fi
- done
- fi
-
-# Find out if we need to process multiple setups
- if [ -n "$ADEI_SETUP" -o -n "$ADEI_ENABLED_SETUPS" ]; then
- if [ "$ADEI_SETUP" = "all" ]; then
- list=$(echo "$ADEI_ENABLED_SETUPS" | xargs -n 1 | sort -u)
- else
- list=$(echo "$ADEI_SETUP $ADEI_ENABLED_SETUPS" | xargs -n 1 | sort -u)
- fi
- else
- for name in setups/*; do
- if [ -f $name/.cache ]; then
- list="$list $(basename $name)"
- fi
- done
- fi
-
-# Run processing for each requested setup
- if [ -n "$list" ]; then
- for setup in $list; do
- process_setup "$setup" "$ADEI_PARALLEL" &
- pids="$pids $!"
- done
- else
- process_setup "" "$ADEI_PARALLEL" &
- pids="$!"
- fi
-
- /usr/bin/php system/downloads_check.php
-
- for pid in $pids; do
- wait $pid
- done
-)
diff --git a/adei/configs/adei_clean.cron.sh b/adei/configs/adei_clean.cron.sh
deleted file mode 100644
index e9b430f..0000000
--- a/adei/configs/adei_clean.cron.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-
-[ -f /adei/env ] && . /adei/env
-
-script=$( cd $(dirname "$0") && pwd )/$( basename "$0" )
-if [ -f /adei/sys/adei_clean.cron.sh -a "$script" != /adei/sys/adei_clean.cron.sh ]; then
- /adei/sys/adei_clean.cron.sh
- exit
-fi
-
-adei_path="/srv/www/htdocs/adei/"
-path="$adei_path/tmp/clients/"
-
-find $path -type f -atime +0 -exec rm -f '{}' \;
-find $path -type d -empty -atime +1 -mindepth 1 -delete
-
-#find $path -type f -mtime +7 -exec rm -f '{}' \;
-#find $path -type d -empty -atime +1 -mindepth 1 -print0 | xargs -0 -r rmdir
-
-path="$adei_path/tmp/log"
-find $path -type f -mtime +14 -exec rm -f '{}' \;
diff --git a/adei/configs/adei_manager.cron.sh b/adei/configs/adei_manager.cron.sh
deleted file mode 100644
index 0ba77b5..0000000
--- a/adei/configs/adei_manager.cron.sh
+++ /dev/null
@@ -1,74 +0,0 @@
-#! /bin/bash
-
-
-function process_setup {
- setup="$1"
- parallel="$2"
-
- local args="-parallel $parallel"
- if [ -n "$setup" ]; then
- args="$args -setup $setup"
- else
- setup=$(php -r 'require "adei.php"; echo $ADEI_SETUP;')
- fi
-
- if [ ! -d "setups/$setup" ]; then
- echo "$setup is not existing"
- return
- fi
-
- if [ -f setups/$setup/adei_manager.cron.sh ]; then
- setups/$setup/adei_manager.cron.sh
- return
- fi
-
- if [ -f setups/$setup/.cache_archives ]; then
- /usr/bin/php system/cache.php -archives $args
- fi
-
- if [ -f setups/$setup/.backup ]; then
- /usr/bin/php system/backup.php $args
- fi
-}
-
-[ -f /adei/env ] && . /adei/env
-
-script=$( cd $(dirname "$0") && pwd )/$( basename "$0" )
-if [ -f /adei/sys/adei_manager.cron.sh -a "$script" != /adei/sys/adei_manager.cron.sh ]; then
- /adei/sys/adei_manager.cron.sh
- exit
-fi
-
-(
- cd /srv/www/htdocs/adei
-
- if [ -n "$ADEI_SETUP" -o -n "$ADEI_ENABLED_SETUPS" ]; then
- if [ "$ADEI_SETUP" = "all" ]; then
- list=$(echo "$ADEI_ENABLED_SETUPS" | xargs -n 1 | sort -u)
- else
- list=$(echo "$ADEI_SETUP $ADEI_ENABLED_SETUPS" | xargs -n 1 | sort -u)
- fi
- else
- for name in setups/*; do
- if [ -f $name/.cache ]; then
- list="$list $(basename $name)"
- fi
- done
- fi
-
- if [ -n "$list" ]; then
- for setup in $list; do
- process_setup "$setup" "$ADEI_PARALLEL" &
- pids="$pids $!"
- done
- else
- process_setup "" "$ADEI_PARALLEL" &
- pids="$!"
- fi
-
- /usr/bin/php system/downloads_clean.php
-
- for pid in $pids; do
- wait $pid
- done
-)
diff --git a/adei/configs/config.actual.php b/adei/configs/config.actual.php
index f4f4a99..acb6c35 100644
--- a/adei/configs/config.actual.php
+++ b/adei/configs/config.actual.php
@@ -1,24 +1,2 @@
<?php
- function env($var, $default = false) {
- $env = getenv($var);
- if ($env === false) return $default;
- return $env;
- }
-
- $ADEI_SETUP = env("ADEI_SETUP", "all");
-
- $ADEI_RELEASE = filter_var(env("ADEI_RELEASE", true), FILTER_VALIDATE_BOOLEAN);
- $LOGGER_LOG_REQUESTS = filter_var(env("ADEI_WRITE_LOGS", false), FILTER_VALIDATE_BOOLEAN);
- $LOGGER_LOG_OUTPUT = filter_var(env("ADEI_WRITE_LOGS", false), FILTER_VALIDATE_BOOLEAN);
- $LOGGER_STORE_OBJECTS = filter_var(env("ADEI_DEBUG", false), FILTER_VALIDATE_BOOLEAN);
-
- $ADEI_DB = array (
- "host" => env("MYSQL_SERVER", "localhost"),
- "port" => env("MYSQL_PORT", 0),
- "database" => env("MYSQL_DATABASE", "adei"),
- "user" => env("MYSQL_USER", "adei"),
- "password" => env("MYSQL_PASSWORD", "adei")
- );
-
- $ADEI_CACHE_SCHEDULER = filter(env("ADEI_SCHEDULER", false), FILTER_VALIDATE_BOOLEAN);
?>
diff --git a/adei/scripts/configure.sh b/adei/scripts/configure.sh
index 88b48fc..cbc0033 100755
--- a/adei/scripts/configure.sh
+++ b/adei/scripts/configure.sh
@@ -7,3 +7,4 @@ sed -i'' -re 's/^.*pam_loginuid\.so.*$//' /etc/pam.d/crond
sed -i'' -re 's/APACHE_MODULES="(.*)"/APACHE_MODULES="\1 php5 rewrite proxy mod_proxy_http access_compat"/' /etc/sysconfig/apache2
sed -i'' -rf /opt/scripts/override.sed /etc/apache2/default-server.conf
sed -i'' -re 's/short_open_tag\s*=.*/short_open_tag = On/' /etc/php5/apache2/php.ini
+sed -i'' -re 's@session.save_path\s*=.*@session.save_path=/tmp@' /etc/php5/apache2/php.ini