From 26371c3076bf38f4be18a90e184bc23f08f82001 Mon Sep 17 00:00:00 2001 From: Haonan Chen Date: Tue, 6 Jan 2026 12:44:54 +0800 Subject: [PATCH] modules.services.gitea: disable AI web crawler prevention --- modules/services/gitea.nix | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/modules/services/gitea.nix b/modules/services/gitea.nix index 39f555d7..813da5c9 100644 --- a/modules/services/gitea.nix +++ b/modules/services/gitea.nix @@ -59,22 +59,22 @@ inputs: }; # prevent AI web crawlers # https://her.esy.fun/posts/0031-how-i-protect-my-forgejo-instance-from-ai-web-crawlers/index.html - nginx.virtualHosts."https:${gitea.hostname}".locations."/".extraConfigPre = - '' - if ($http_user_agent ~* "git/|git-lfs/") { - set $bypass_cookie 1; - } - if ($cookie_Yogsototh_opens_the_door = "1") { - set $bypass_cookie 1; - } - if ($request_method != "GET") { - set $bypass_cookie 1; - } - if ($bypass_cookie != 1) { - add_header Content-Type text/html always; - return 418 ''; - } - ''; + # nginx.virtualHosts."https:${gitea.hostname}".locations."/".extraConfigPre = + # '' + # if ($http_user_agent ~* "git/|git-lfs/") { + # set $bypass_cookie 1; + # } + # if ($cookie_Yogsototh_opens_the_door = "1") { + # set $bypass_cookie 1; + # } + # if ($request_method != "GET") { + # set $bypass_cookie 1; + # } + # if ($bypass_cookie != 1) { + # add_header Content-Type text/html always; + # return 418 ''; + # } + # ''; }; nixos = {