Bug 39906: (QA follow-up) Feature needs to be enabled specifically

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 <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
This commit is contained in:
Marcel de Rooy 2025-07-30 14:45:23 +02:00 committed by Jesse Maseto
parent 2f5428cb35
commit fa080e6b00
No known key found for this signature in database
GPG Key ID: 4D16BFCF78FFFDEC
1 changed files with 5 additions and 3 deletions

View File

@ -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