diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/webapps/webstats/default.nix | 5 | ||||
-rw-r--r-- | modules/webapps/webstats/goaccess.conf | 13 |
2 files changed, 9 insertions, 9 deletions
diff --git a/modules/webapps/webstats/default.nix b/modules/webapps/webstats/default.nix index fe5f068..7a27741 100644 --- a/modules/webapps/webstats/default.nix +++ b/modules/webapps/webstats/default.nix | |||
@@ -57,15 +57,14 @@ in { | |||
57 | #!${pkgs.stdenv.shell} | 57 | #!${pkgs.stdenv.shell} |
58 | set -e | 58 | set -e |
59 | shopt -s nullglob | 59 | shopt -s nullglob |
60 | date_regex=$(LC_ALL=C date -d yesterday +'%d\/%b\/%Y') | ||
61 | TMPFILE=$(mktemp) | 60 | TMPFILE=$(mktemp) |
62 | trap "rm -f $TMPFILE" EXIT | 61 | trap "rm -f $TMPFILE" EXIT |
63 | 62 | ||
64 | mkdir -p ${cfg.dataDir}/${domain} | 63 | mkdir -p ${cfg.dataDir}/${domain} |
65 | cat /var/log/httpd/access-${domain}.log | sed -n "/\\[$date_regex/ p" > $TMPFILE | ||
66 | for i in /var/log/httpd/access-${domain}*.gz; do | 64 | for i in /var/log/httpd/access-${domain}*.gz; do |
67 | zcat "$i" | sed -n "/\\[$date_regex/ p" >> $TMPFILE | 65 | zcat "$i" >> $TMPFILE |
68 | done | 66 | done |
67 | cat /var/log/httpd/access-${domain}.log > $TMPFILE | ||
69 | ${pkgs.goaccess}/bin/goaccess $TMPFILE --no-progress -o ${cfg.dataDir}/${domain}/index.html -p ${config} | 68 | ${pkgs.goaccess}/bin/goaccess $TMPFILE --no-progress -o ${cfg.dataDir}/${domain}/index.html -p ${config} |
70 | ''; | 69 | ''; |
71 | in "${d}/bin/stats-${domain}"; | 70 | in "${d}/bin/stats-${domain}"; |
diff --git a/modules/webapps/webstats/goaccess.conf b/modules/webapps/webstats/goaccess.conf index 4918988..c6c244a 100644 --- a/modules/webapps/webstats/goaccess.conf +++ b/modules/webapps/webstats/goaccess.conf | |||
@@ -1,26 +1,27 @@ | |||
1 | time-format %H:%M:%S | 1 | time-format %H:%M:%S |
2 | date-format %d/%b/%Y | 2 | date-format %d/%b/%Y |
3 | 3 | ||
4 | #sur immae.eu | ||
5 | #log-format %v %h %^[%d:%t %^] "%r" %s %b "%R" "%u" $^ | ||
6 | |||
7 | log-format VCOMBINED | 4 | log-format VCOMBINED |
8 | #= %v:%^ %h %^[%d:%t %^] "%r" %s %b "%R" "%u" | 5 | #= %v:%^ %h %^[%d:%t %^] "%r" %s %b "%R" "%u" |
9 | 6 | ||
10 | html-prefs {"theme":"bright","layout":"vertical"} | 7 | html-prefs {"theme":"bright","layout":"vertical"} |
11 | 8 | ||
9 | # old | ||
12 | exclude-ip 188.165.209.148 | 10 | exclude-ip 188.165.209.148 |
13 | exclude-ip 178.33.252.96 | 11 | exclude-ip 178.33.252.96 |
14 | exclude-ip 2001:41d0:2:9c94::1 | 12 | exclude-ip 2001:41d0:2:9c94::1 |
15 | exclude-ip 2001:41d0:2:9c94:: | 13 | exclude-ip 2001:41d0:2:9c94:: |
14 | # eldiron | ||
16 | exclude-ip 176.9.151.89 | 15 | exclude-ip 176.9.151.89 |
17 | exclude-ip 2a01:4f8:160:3445:: | 16 | exclude-ip 2a01:4f8:160:3445:: |
18 | exclude-ip 82.255.56.72 | 17 | # monitoring-1 |
18 | exclude-ip 95.216.164.150 | ||
19 | exclude-ip 2a01:4f9:c010:1c95:: | ||
19 | 20 | ||
20 | no-query-string true | 21 | no-query-string true |
21 | 22 | ||
22 | keep-db-files true | 23 | persist true |
23 | load-from-disk true | 24 | restore true |
24 | db-path @dbPath@ | 25 | db-path @dbPath@ |
25 | 26 | ||
26 | ignore-panel REFERRERS | 27 | ignore-panel REFERRERS |