mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 01:55:22 +08:00
modules.services.gitea: disable AI web crawler prevention
This commit is contained in:
@@ -59,22 +59,22 @@ inputs:
|
|||||||
};
|
};
|
||||||
# prevent AI web crawlers
|
# prevent AI web crawlers
|
||||||
# https://her.esy.fun/posts/0031-how-i-protect-my-forgejo-instance-from-ai-web-crawlers/index.html
|
# 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 =
|
# nginx.virtualHosts."https:${gitea.hostname}".locations."/".extraConfigPre =
|
||||||
''
|
# ''
|
||||||
if ($http_user_agent ~* "git/|git-lfs/") {
|
# if ($http_user_agent ~* "git/|git-lfs/") {
|
||||||
set $bypass_cookie 1;
|
# set $bypass_cookie 1;
|
||||||
}
|
# }
|
||||||
if ($cookie_Yogsototh_opens_the_door = "1") {
|
# if ($cookie_Yogsototh_opens_the_door = "1") {
|
||||||
set $bypass_cookie 1;
|
# set $bypass_cookie 1;
|
||||||
}
|
# }
|
||||||
if ($request_method != "GET") {
|
# if ($request_method != "GET") {
|
||||||
set $bypass_cookie 1;
|
# set $bypass_cookie 1;
|
||||||
}
|
# }
|
||||||
if ($bypass_cookie != 1) {
|
# if ($bypass_cookie != 1) {
|
||||||
add_header Content-Type text/html always;
|
# add_header Content-Type text/html always;
|
||||||
return 418 '<script>document.cookie = "Yogsototh_opens_the_door=1; Path=/;"; window.location.reload();</script>';
|
# return 418 '<script>document.cookie = "Yogsototh_opens_the_door=1; Path=/;"; window.location.reload();</script>';
|
||||||
}
|
# }
|
||||||
'';
|
# '';
|
||||||
};
|
};
|
||||||
nixos =
|
nixos =
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user