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.
Commit
35a09aea15efbe5134e95c7c07f896d752410360c883858c35a7cafd00990d11
Parent
e81cac374b73f1c…
2 files changed
+13
-1
+2
-1
+13
-1
| --- src/robot.c | ||
| +++ src/robot.c | ||
| @@ -422,11 +422,18 @@ | ||
| 422 | 422 | |
| 423 | 423 | /* |
| 424 | 424 | ** Return true if one or more of the conditions below are true. |
| 425 | 425 | ** Return false if all of the following are false: |
| 426 | 426 | ** |
| 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. | |
| 428 | 435 | ** |
| 429 | 436 | ** * The client that submitted the HTTP request might be |
| 430 | 437 | ** a robot |
| 431 | 438 | ** |
| 432 | 439 | ** * The Request URI does not match any of the exceptions |
| @@ -446,10 +453,15 @@ | ||
| 446 | 453 | if( !robot_restrict_has_tag(zTag) ) return 0; |
| 447 | 454 | if( !client_might_be_a_robot() ) return 0; |
| 448 | 455 | if( robot_exception() ){ |
| 449 | 456 | robot.resultCache = KNOWN_NOT_ROBOT; |
| 450 | 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; | |
| 451 | 463 | } |
| 452 | 464 | return 1; |
| 453 | 465 | } |
| 454 | 466 | |
| 455 | 467 | /* |
| 456 | 468 |
| --- 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 @@ | ||
| 503 | 503 | @ then it only applies if query parameters are such that |
| 504 | 504 | @ the page is expensive and/or unusual. |
| 505 | 505 | @ <li> The "ext" tag covers all extensions, but a tag like |
| 506 | 506 | @ "ext/PATH" only covers the specific extension at PATH. |
| 507 | 507 | @ </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". | |
| 509 | 510 | @ (Property: <a href="%R/help/robot-restrict">robot-restrict</a>) |
| 510 | 511 | @ <br> |
| 511 | 512 | textarea_attribute("", 2, 80, |
| 512 | 513 | "robot-restrict", "rbrestrict", robot_restrict_default(), 0); |
| 513 | 514 | |
| 514 | 515 |
| --- 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 |