From 9a85a7e2ceda61219b1c84df691ce573baa34699 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 23 Sep 2024 16:53:59 +0200 Subject: [PATCH 1/2] nixos/pretix: enable log rotation This limits the amount of logs we store by default to 3 months. --- nixos/modules/services/web-apps/pretix.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nixos/modules/services/web-apps/pretix.nix b/nixos/modules/services/web-apps/pretix.nix index bcd59ce40ae7..f521c49668c8 100644 --- a/nixos/modules/services/web-apps/pretix.nix +++ b/nixos/modules/services/web-apps/pretix.nix @@ -403,6 +403,15 @@ in '') ]; + services.logrotate.settings.pretix = { + files = "${cfg.settings.pretix.logdir}/*.log"; + su = "${cfg.user} ${cfg.group}"; + frequency = "weekly"; + rotate = "12"; + copytruncate = true; + compress = true; + }; + services = { nginx = mkIf cfg.nginx.enable { enable = true; From 1d8c946fdbd247e39531a28c7287027e83478ba3 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 23 Sep 2024 16:58:52 +0200 Subject: [PATCH 2/2] nixos/pretalx: enable log rotation This limits the amount of logs we store by default to 3 months. --- nixos/modules/services/web-apps/pretalx.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nixos/modules/services/web-apps/pretalx.nix b/nixos/modules/services/web-apps/pretalx.nix index 2280d9165b40..35af8c26482c 100644 --- a/nixos/modules/services/web-apps/pretalx.nix +++ b/nixos/modules/services/web-apps/pretalx.nix @@ -294,6 +294,15 @@ in '') ]; + services.logrotate.settings.pretalx = { + files = "${cfg.settings.filesystem.logs}/*.log"; + su = "${cfg.user} ${cfg.group}"; + frequency = "weekly"; + rotate = "12"; + copytruncate = true; + compress = true; + }; + services = { nginx = lib.mkIf cfg.nginx.enable { enable = true;