--- a/deb/apache-register-hg.bash Thu May 02 16:02:45 2024 +0300
+++ b/deb/apache-register-hg.bash Wed May 28 00:15:07 2025 +0300
@@ -53,6 +53,11 @@
Require all granted
</Directory>
+ # Discourage bots indexing HG: Python is slow and cause OOM kills...
+ <IfModule mod_headers.c>
+ Header add "X-Robots-Tag" "noindex, nofollow"
+ </IfModule>
+
ScriptAliasMatch ^/(.*) /srv/hg/hgweb.cgi/\$1
<Directory "/srv/hg/">
@@ -68,6 +73,10 @@
DocumentRoot /srv/hg
ServerName hg.defun.work
+ <IfModule mod_headers.c>
+ Header add "X-Robots-Tag" "noindex, nofollow"
+ </IfModule>
+
ScriptAliasMatch ^/(.*) /srv/hg/hgweb.cgi/\$1
<Directory "/srv/hg/">
@@ -81,4 +90,5 @@
EOF
a2ensite hg
+a2enmod headers
service apache2 reload