diff --git a/deemz.org/GeoLite2-ASN.mmdb b/deemz.org/GeoLite2-ASN.mmdb new file mode 100644 index 0000000..c888792 Binary files /dev/null and b/deemz.org/GeoLite2-ASN.mmdb differ diff --git a/deemz.org/GeoLite2-City.mmdb b/deemz.org/GeoLite2-City.mmdb new file mode 100644 index 0000000..1c32cf7 Binary files /dev/null and b/deemz.org/GeoLite2-City.mmdb differ diff --git a/deemz.org/GeoLite2-Country.mmdb b/deemz.org/GeoLite2-Country.mmdb new file mode 100644 index 0000000..379e887 Binary files /dev/null and b/deemz.org/GeoLite2-Country.mmdb differ diff --git a/deemz.org/configuration.nix b/deemz.org/configuration.nix index 4d7c650..1fd2b2a 100644 --- a/deemz.org/configuration.nix +++ b/deemz.org/configuration.nix @@ -83,6 +83,25 @@ let secrets = import ../secrets.nix; in }; users.groups.icomidal = {}; + # Run goaccess script hourly + systemd.timers.goaccess = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = "hourly"; + Persistent = true; + Unit = "goaccess.service"; + }; + }; + systemd.services.goaccess = { + script = "${pkgs.gzip}/bin/zcat /var/log/nginx/access.log.*.gz | ${pkgs.goaccess}/bin/goaccess -a -o /var/log/nginx/goaccess.html --log-format=COMBINED --geoip-database=${./GeoLite2-City.mmdb} --geoip-database=${./GeoLite2-Country.mmdb} --geoip-database=${./GeoLite2-ASN.mmdb} /var/log/nginx/access.log /var/log/nginx/access.log.1 -"; + serviceConfig = { + Type = "oneshot"; + User = "nginx"; + Nice = 19; # low priority + IOSchedulingClass = "idle"; + }; + }; + services.xserver.xkb.layout = "us"; services.xserver.xkb.options = "eurosign:e"; diff --git a/flake.lock b/flake.lock index e8dd55c..682eddf 100644 --- a/flake.lock +++ b/flake.lock @@ -22,11 +22,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1758589230, - "narHash": "sha256-zMTCFGe8aVGTEr2RqUi/QzC1nOIQ0N1HRsbqB4f646k=", + "lastModified": 1761468971, + "narHash": "sha256-vY2OLVg5ZTobdroQKQQSipSIkHlxOTrIF1fsMzPh8w8=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d1d883129b193f0b495d75c148c2c3a7d95789a0", + "rev": "78e34d1667d32d8a0ffc3eba4591ff256e80576e", "type": "github" }, "original": { @@ -38,11 +38,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1758427187, - "narHash": "sha256-pHpxZ/IyCwoTQPtFIAG2QaxuSm8jWzrzBGjwQZIttJc=", + "lastModified": 1761373498, + "narHash": "sha256-Q/uhWNvd7V7k1H1ZPMy/vkx3F8C13ZcdrKjO7Jv7v0c=", "owner": "nixos", "repo": "nixpkgs", - "rev": "554be6495561ff07b6c724047bdd7e0716aa7b46", + "rev": "6a08e6bb4e46ff7fcbb53d409b253f6bad8a28ce", "type": "github" }, "original": {