From eceaab85f55469bfc927ca7917f3db951efba4a0 Mon Sep 17 00:00:00 2001 From: Arya Kiran Date: Thu, 11 Apr 2024 13:07:47 +0530 Subject: [PATCH] move logging to def --- privfrontends/templates/Caddyfile.j2 | 56 ++++++++++++++-------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/privfrontends/templates/Caddyfile.j2 b/privfrontends/templates/Caddyfile.j2 index dd743b1..764ad4a 100644 --- a/privfrontends/templates/Caddyfile.j2 +++ b/privfrontends/templates/Caddyfile.j2 @@ -1,32 +1,4 @@ { -log { - # Anonymised IPs, User-Agents, and Cookies, also removed the URI as mentionned in the privacy policy. - # Subject to change, if we find any missing config we haven't filtered, it will be added. - output file /var/log/caddy/caddy.log - format filter { - wrap json - fields { - request>remote_ip ip_mask { - ipv4 16 - ipv6 64 - } - request>client_ip ip_mask { - ipv4 16 - ipv6 64 - } - request>headers>X-Forwarded-For ip_mask { - ipv4 16 - ipv6 64 - } - request>headers>Cookie cookie { - replace session REDACTED - delete secret - } - request>headers>User-Agent delete - request>uri delete - } - } -} order rate_limit before basicauth } @@ -76,6 +48,34 @@ log { defer } + log { + # Anonymised IPs, User-Agents, and Cookies, also removed the URI as mentionned in the privacy policy. + # Subject to change, if we find any missing config we haven't filtered, it will be added. + output file /var/log/caddy/caddy.log + format filter { + wrap json + fields { + request>remote_ip ip_mask { + ipv4 16 + ipv6 64 + } + request>client_ip ip_mask { + ipv4 16 + ipv6 64 + } + request>headers>X-Forwarded-For ip_mask { + ipv4 16 + ipv6 64 + } + request>headers>Cookie cookie { + replace session REDACTED + delete secret + } + request>headers>User-Agent delete + request>uri delete + } + } + } import acmedns }