From 2a057f24cf35317d79d987ee14e5ffc2be753082 Mon Sep 17 00:00:00 2001 From: Tigor Hutasuhut Date: Sun, 22 Sep 2024 16:26:19 +0700 Subject: [PATCH] redmage: disabled bot access to the site because it causes lags --- system/podman/redmage.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/system/podman/redmage.nix b/system/podman/redmage.nix index c2b8175..2af29ae 100644 --- a/system/podman/redmage.nix +++ b/system/podman/redmage.nix @@ -14,6 +14,13 @@ in { config = mkIf (podman.enable && podman.${name}.enable) { services.caddy.virtualHosts.${domain}.extraConfig = '' + @botForbidden header_regexp User-Agent "(?i)AdsBot-Google|Amazonbot|anthropic-ai|Applebot|Applebot-Extended|AwarioRssBot|AwarioSmartBot|Bytespider|CCBot|ChatGPT|ChatGPT-User|Claude-Web|ClaudeBot|cohere-ai|DataForSeoBot|Diffbot|FacebookBot|Google-Extended|GPTBot|ImagesiftBot|magpie-crawler|omgili|Omgilibot|peer39_crawler|PerplexityBot|YouBot" + + handle @botForbidden { + respond /* "Access Denied" 403 { + close + } + } reverse_proxy ${ip}:8080 '';