From d55f6a72fbb919a8c5f7f67be7febdee67f400a8 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 30 Jul 2025 14:45:23 +0200 Subject: [PATCH] Bug 39906: (QA follow-up) Feature needs to be enabled specifically Content-Type: text/plain; charset=utf-8 See also comment33, point 4. Test plan: cp debian/templates/apache-shared-opac-antibot.conf /etc/koha/ Test enabling/disabling by toggling the comment of the SetEnvIf line, restart apache and remove the KOHA_INIT and CGISESSID cookie. Signed-off-by: Marcel de Rooy --- debian/templates/apache-shared-opac-antibot.conf | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/debian/templates/apache-shared-opac-antibot.conf b/debian/templates/apache-shared-opac-antibot.conf index d69832b226..2134e94475 100644 --- a/debian/templates/apache-shared-opac-antibot.conf +++ b/debian/templates/apache-shared-opac-antibot.conf @@ -1,8 +1,10 @@ RewriteEngine on -#NOTE: To override this setting of ANTIBOT_DO, in the parent VirtualHost add the following: SetEnvIf Request_URI ^ ANTIBOT_OVERRIDE=true -#You can then provide your own conditions for setting the ANTIBOT_DO environmental variable -RewriteCond %{ENV:ANTIBOT_OVERRIDE} ^$ +# NOTE: To enable the antibot challenge for all instances, uncomment the next SetEnvIf line. +# Or enable it per instance by adding the next SetEnvIf line [without comment] to the corresponding virtual host file in /etc/apache2/sites-enabled. +# SetEnvIf Request_URI ^ ANTIBOT_ENABLED=1 + +RewriteCond %{ENV:ANTIBOT_ENABLED} ^(1|Y|Yes)$ RewriteCond expr "%{REQUEST_URI} =~ m#^/cgi-bin/koha/(opac-detail.pl|opac-export.pl|opac-suggestions.pl|opac-search.pl|opac-authoritiesdetail.pl|opac-ISBDdetail.pl|opac-MARCdetail.pl|opac-shelves.pl)$#" RewriteCond %{HTTP:Cookie} !(^|;\s*)CGISESSID= [NC] #NOTE: The KOHA_INIT is set by Javascript by the fast challenge webpage -- 2.39.5