'';
};
name = lib.mkOption {
- type = lib.types.string;
+ type = lib.types.str;
description = ''
Domain name. Corresponds to the Apache file name and the
folder name in which the state will be saved.
#!${pkgs.stdenv.shell}
set -e
shopt -s nullglob
- date_regex=$(LC_ALL=C date -d yesterday +'%d\/%b\/%Y')
TMPFILE=$(mktemp)
trap "rm -f $TMPFILE" EXIT
mkdir -p ${cfg.dataDir}/${domain}
- cat /var/log/httpd/access-${domain}.log | sed -n "/\\[$date_regex/ p" > $TMPFILE
for i in /var/log/httpd/access-${domain}*.gz; do
- zcat "$i" | sed -n "/\\[$date_regex/ p" >> $TMPFILE
+ zcat "$i" >> $TMPFILE
done
+ cat /var/log/httpd/access-${domain}.log > $TMPFILE
${pkgs.goaccess}/bin/goaccess $TMPFILE --no-progress -o ${cfg.dataDir}/${domain}/index.html -p ${config}
'';
in "${d}/bin/stats-${domain}";