Fossil SCM

Make it easier to exclude all robots by setting robot-restrict to "*" and still allowing pulls to occur and the login page to be accessed.

drh 2026-08-06 11:44 UTC trunk
Commit 35a09aea15efbe5134e95c7c07f896d752410360c883858c35a7cafd00990d11
2 files changed +13 -1 +2 -1
+13 -1
--- src/robot.c
+++ src/robot.c
@@ -422,11 +422,18 @@
422422
423423
/*
424424
** Return true if one or more of the conditions below are true.
425425
** Return false if all of the following are false:
426426
**
427
-** * The zTag is on the robot-restrict list
427
+** * The zTag is on the robot-restrict list and there exists
428
+** some tags that do not match robot-restrict or else zTag is
429
+** neither "/" or "xfer" or "login".
430
+**
431
+** The complication of the previous rule (everything after the
432
+** first "and") prevents a robot-restrict setting that contains
433
+** "*" from trying to bring up a robot-captcha for a "sync"
434
+** operation (the "/" or "xfer" page) or for the "login" page.
428435
**
429436
** * The client that submitted the HTTP request might be
430437
** a robot
431438
**
432439
** * The Request URI does not match any of the exceptions
@@ -446,10 +453,15 @@
446453
if( !robot_restrict_has_tag(zTag) ) return 0;
447454
if( !client_might_be_a_robot() ) return 0;
448455
if( robot_exception() ){
449456
robot.resultCache = KNOWN_NOT_ROBOT;
450457
return 0;
458
+ }
459
+ if( robot_restrict_has_tag("-not-a-real-tag-")
460
+ && (strcmp(zTag,"login")==0 || strcmp(zTag,"xfer")==0 || zTag[0]=='/')
461
+ ){
462
+ return 0;
451463
}
452464
return 1;
453465
}
454466
455467
/*
456468
--- src/robot.c
+++ src/robot.c
@@ -422,11 +422,18 @@
422
423 /*
424 ** Return true if one or more of the conditions below are true.
425 ** Return false if all of the following are false:
426 **
427 ** * The zTag is on the robot-restrict list
 
 
 
 
 
 
 
428 **
429 ** * The client that submitted the HTTP request might be
430 ** a robot
431 **
432 ** * The Request URI does not match any of the exceptions
@@ -446,10 +453,15 @@
446 if( !robot_restrict_has_tag(zTag) ) return 0;
447 if( !client_might_be_a_robot() ) return 0;
448 if( robot_exception() ){
449 robot.resultCache = KNOWN_NOT_ROBOT;
450 return 0;
 
 
 
 
 
451 }
452 return 1;
453 }
454
455 /*
456
--- src/robot.c
+++ src/robot.c
@@ -422,11 +422,18 @@
422
423 /*
424 ** Return true if one or more of the conditions below are true.
425 ** Return false if all of the following are false:
426 **
427 ** * The zTag is on the robot-restrict list and there exists
428 ** some tags that do not match robot-restrict or else zTag is
429 ** neither "/" or "xfer" or "login".
430 **
431 ** The complication of the previous rule (everything after the
432 ** first "and") prevents a robot-restrict setting that contains
433 ** "*" from trying to bring up a robot-captcha for a "sync"
434 ** operation (the "/" or "xfer" page) or for the "login" page.
435 **
436 ** * The client that submitted the HTTP request might be
437 ** a robot
438 **
439 ** * The Request URI does not match any of the exceptions
@@ -446,10 +453,15 @@
453 if( !robot_restrict_has_tag(zTag) ) return 0;
454 if( !client_might_be_a_robot() ) return 0;
455 if( robot_exception() ){
456 robot.resultCache = KNOWN_NOT_ROBOT;
457 return 0;
458 }
459 if( robot_restrict_has_tag("-not-a-real-tag-")
460 && (strcmp(zTag,"login")==0 || strcmp(zTag,"xfer")==0 || zTag[0]=='/')
461 ){
462 return 0;
463 }
464 return 1;
465 }
466
467 /*
468
+2 -1
--- src/setup.c
+++ src/setup.c
@@ -503,11 +503,12 @@
503503
@ then it only applies if query parameters are such that
504504
@ the page is expensive and/or unusual.
505505
@ <li> The "ext" tag covers all extensions, but a tag like
506506
@ "ext/PATH" only covers the specific extension at PATH.
507507
@ </ul>
508
- @ To disable robot restrictions, change this setting to "off".
508
+ @ Make this setting "off" to disable all robot restrictions, or "*"
509
+ @ to exclude robots from all pages other than "/login" and "/xfer".
509510
@ (Property: <a href="%R/help/robot-restrict">robot-restrict</a>)
510511
@ <br>
511512
textarea_attribute("", 2, 80,
512513
"robot-restrict", "rbrestrict", robot_restrict_default(), 0);
513514
514515
--- src/setup.c
+++ src/setup.c
@@ -503,11 +503,12 @@
503 @ then it only applies if query parameters are such that
504 @ the page is expensive and/or unusual.
505 @ <li> The "ext" tag covers all extensions, but a tag like
506 @ "ext/PATH" only covers the specific extension at PATH.
507 @ </ul>
508 @ To disable robot restrictions, change this setting to "off".
 
509 @ (Property: <a href="%R/help/robot-restrict">robot-restrict</a>)
510 @ <br>
511 textarea_attribute("", 2, 80,
512 "robot-restrict", "rbrestrict", robot_restrict_default(), 0);
513
514
--- src/setup.c
+++ src/setup.c
@@ -503,11 +503,12 @@
503 @ then it only applies if query parameters are such that
504 @ the page is expensive and/or unusual.
505 @ <li> The "ext" tag covers all extensions, but a tag like
506 @ "ext/PATH" only covers the specific extension at PATH.
507 @ </ul>
508 @ Make this setting "off" to disable all robot restrictions, or "*"
509 @ to exclude robots from all pages other than "/login" and "/xfer".
510 @ (Property: <a href="%R/help/robot-restrict">robot-restrict</a>)
511 @ <br>
512 textarea_attribute("", 2, 80,
513 "robot-restrict", "rbrestrict", robot_restrict_default(), 0);
514
515

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button