]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Upgrade goaccess and adjust parsing
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 15 Jun 2020 14:00:08 +0000 (16:00 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 15 Jun 2020 14:00:08 +0000 (16:00 +0200)
modules/webapps/webstats/default.nix
modules/webapps/webstats/goaccess.conf
overlays/goaccess/default.nix

index fe5f068d410345e1f84a20e8c0d65474989260ec..7a2774112f545a8f7b4f863c24b7f12dbee849f6 100644 (file)
@@ -57,15 +57,14 @@ in {
             #!${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}";
index 49189883e4fa0b47c3ded1f41748e7a01a90c7af..c6c244a1246a9265bacc2cacb386a94b5f402e9b 100644 (file)
@@ -1,26 +1,27 @@
 time-format %H:%M:%S
 date-format %d/%b/%Y
 
-#sur immae.eu
-#log-format %v %h %^[%d:%t %^] "%r" %s %b "%R" "%u" $^
-
 log-format VCOMBINED
 #= %v:%^ %h %^[%d:%t %^] "%r" %s %b "%R" "%u"
 
 html-prefs {"theme":"bright","layout":"vertical"}
 
+# old
 exclude-ip 188.165.209.148
 exclude-ip 178.33.252.96
 exclude-ip 2001:41d0:2:9c94::1
 exclude-ip 2001:41d0:2:9c94::
+# eldiron
 exclude-ip 176.9.151.89
 exclude-ip 2a01:4f8:160:3445::
-exclude-ip 82.255.56.72
+# monitoring-1
+exclude-ip 95.216.164.150
+exclude-ip 2a01:4f9:c010:1c95::
 
 no-query-string true
 
-keep-db-files true
-load-from-disk true
+persist true
+restore true
 db-path @dbPath@
 
 ignore-panel REFERRERS
index 12b28f3bf66633f10fdea4354f0fc097af10260c..6b9758bed91e083059d79e12d5f536d21df357ee 100644 (file)
@@ -1,10 +1,10 @@
 self: super: {
   goaccess = super.goaccess.overrideAttrs(old: rec {
     name = "goaccess-${version}";
-    version = "1.3";
+    version = "1.4";
     src = self.fetchurl {
       url = "https://tar.goaccess.io/${name}.tar.gz";
-      sha256 = "16vv3pj7pbraq173wlxa89jjsd279004j4kgzlrsk1dz4if5qxwc";
+      sha256 = "1gkpjg39f3afdwm9128jqjsfap07p8s027czzlnxfmi5hpzvkyz8";
     };
     configureFlags = old.configureFlags ++ [ "--enable-tcb=btree" ];
     buildInputs = old.buildInputs ++ [ self.tokyocabinet self.bzip2 ];