Add: goaccess for blog
This commit is contained in:
parent
4eb2698dac
commit
9017181db2
4 changed files with 63 additions and 52 deletions
38
modules/services/goaccess.nix
Normal file
38
modules/services/goaccess.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{ pkgs, ... }: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
goaccess
|
||||
];
|
||||
|
||||
# Service pour générer le rapport statique GoAccess
|
||||
systemd.services.goaccess-report = {
|
||||
description = "Generate GoAccess HTML report";
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.goaccess}/bin/goaccess /var/log/caddy/access-levr.porzh.me.log --log-format=CADDY -o /var/www/goaccess/index.html";
|
||||
};
|
||||
};
|
||||
|
||||
# Timer pour régénérer le rapport toutes les heures
|
||||
systemd.timers.goaccess-report = {
|
||||
description = "Hourly GoAccess report generation";
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnCalendar = "hourly";
|
||||
Persistent = true;
|
||||
};
|
||||
};
|
||||
services.caddy = {
|
||||
virtualHosts = {
|
||||
"koum.porzh.me" = {
|
||||
extraConfig = ''
|
||||
root * /var/www/goaccess
|
||||
file_server browse
|
||||
try_files {path} {path}/ /index.html
|
||||
|
||||
${builtins.readFile ../../secrets/admin-passwd}
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue