Commit 719e2e67 authored by Paul Cammish's avatar Paul Cammish

Merge branch 'buster-testing' into 'buster'

buster-testing -> buster

Closes #271

See merge request sympl/sympl!159
parents cb3f8cd0 9b83a0bd
Pipeline #770 passed with stages
in 37 minutes and 51 seconds
CHANGELOG
---------
2019-12-16
sympl-core
* Add sympl user to relevant groups on each install.
sympl-web
* Added cron to clean up old PHP sessions.
2019-12-05
sympl-core
......
sympl-core (10.0.191216.0) stable; urgency=medium
* Add sympl user to relevant groups on each install.
-- Paul Cammish <sympl@kelduum.net> Mon, 16 Dec 2019 12:22:03 +0000
sympl-core (10.0.191205.0) stable; urgency=medium
* Updated IPv6 Only workaround.
......
......@@ -34,7 +34,7 @@ fi
shadowconfig on
#
# If there isn't a Sympl account, add it.
# If there isn't a Sympl account, add it with password/keys from root.
#
if ( ! grep ^sympl: /etc/passwd 2>/dev/null >/dev/null ); then
......@@ -54,21 +54,23 @@ if ( ! grep ^sympl: /etc/passwd 2>/dev/null >/dev/null ); then
chown sympl:sympl /home/sympl/.ssh/authorized_keys
fi
#
# If we have an adm group - which we should - add the Sympl user to it.
#
if ( getent group adm >/dev/null ); then
adduser sympl adm
fi
#
# Ensure the Sympl user is added to the www-data group too
#
if ( getent group www-data >/dev/null ); then
adduser sympl www-data
fi
#
# Check that the adm and www-data groups exist, then add the sympl user to them
# Fixes Issue #271, where the Sympl user already exists.
#
for GROUP in adm www-data ; do
if ( getent group $GROUP >/dev/null ); then
if [ $( id sympl | grep -c "($GROUP)" ) == 0 ]; then
adduser sympl $GROUP
fi
fi
fi
done
#
# Add a stat override for the /srv directory.
......
sympl-web (10.0.191216.0) stable; urgency=medium
* Added cron to clean up old PHP sessions
-- Paul Cammish <sympl@kelduum.net> Mon, 16 Dec 2019 11:45:02 +0000
sympl-web (10.0.190709.0) stable; urgency=medium
* Updated sympl-web-rotate-logs to support new ownership
......
#!/bin/sh
# Script to clean up old Sympl PHP sessions in /srv/*/php_sessions, based on stock Debian version.
session_config=$(PHP_INI_SCAN_DIR=/etc/php/${version}/${conf_dir}/conf.d/ php${version} -c /etc/php/${version}/${conf_dir}/php.ini -d "error_reporting='~E_ALL'" -r 'foreach(ini_get_all("session") as $k => $v) echo "$k=".$v["local_value"]."\n";')
gc_maxlifetime=$(($(echo "$session_config" | sed -ne 's/^session\.gc_maxlifetime=\(.*\)$/\1/p')/60))
for domain in $( find /srv/ -mindepth 2 -maxdepth 2 -type d -name php_sessions ); do
find -O3 "$domain/" -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin "+$gc_maxlifetime" -delete
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment