run goaccess periodically
This commit is contained in:
parent
81bb571537
commit
cb2edc9aeb
5 changed files with 25 additions and 6 deletions
BIN
deemz.org/GeoLite2-ASN.mmdb
Normal file
BIN
deemz.org/GeoLite2-ASN.mmdb
Normal file
Binary file not shown.
BIN
deemz.org/GeoLite2-City.mmdb
Normal file
BIN
deemz.org/GeoLite2-City.mmdb
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 59 MiB |
BIN
deemz.org/GeoLite2-Country.mmdb
Normal file
BIN
deemz.org/GeoLite2-Country.mmdb
Normal file
Binary file not shown.
|
|
@ -83,6 +83,25 @@ let secrets = import ../secrets.nix; in
|
||||||
};
|
};
|
||||||
users.groups.icomidal = {};
|
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.layout = "us";
|
||||||
services.xserver.xkb.options = "eurosign:e";
|
services.xserver.xkb.options = "eurosign:e";
|
||||||
|
|
||||||
|
|
|
||||||
12
flake.lock
generated
12
flake.lock
generated
|
|
@ -22,11 +22,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-stable": {
|
"nixpkgs-stable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1758589230,
|
"lastModified": 1761468971,
|
||||||
"narHash": "sha256-zMTCFGe8aVGTEr2RqUi/QzC1nOIQ0N1HRsbqB4f646k=",
|
"narHash": "sha256-vY2OLVg5ZTobdroQKQQSipSIkHlxOTrIF1fsMzPh8w8=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "d1d883129b193f0b495d75c148c2c3a7d95789a0",
|
"rev": "78e34d1667d32d8a0ffc3eba4591ff256e80576e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -38,11 +38,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1758427187,
|
"lastModified": 1761373498,
|
||||||
"narHash": "sha256-pHpxZ/IyCwoTQPtFIAG2QaxuSm8jWzrzBGjwQZIttJc=",
|
"narHash": "sha256-Q/uhWNvd7V7k1H1ZPMy/vkx3F8C13ZcdrKjO7Jv7v0c=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "554be6495561ff07b6c724047bdd7e0716aa7b46",
|
"rev": "6a08e6bb4e46ff7fcbb53d409b253f6bad8a28ce",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue