Fossil SCM

Do not show the Robot Defense section of the security audit if the repository is completely private, and thus not subject to visit by robots.

drh 2026-08-06 16:43 UTC trunk
Commit a1e9fe364eb05888d27ecf2bb328cdeea6183437fbebd5121de3a81685e428d0
1 file changed +33 -29
--- src/security_audit.c
+++ src/security_audit.c
@@ -101,10 +101,11 @@
101101
const char *zPubPages; /* GLOB pattern for public pages */
102102
const char *zSelfCap; /* Capabilities of self-registered users */
103103
int hasSelfReg = 0; /* True if able to self-register */
104104
const char *zPublicUrl; /* Canonical access URL */
105105
const char *zVulnReport; /* The vuln-report setting */
106
+ int bCompletelyPrivate = 0;/* True only if the repo is completely private */
106107
Blob cmd;
107108
char *z;
108109
int n, i;
109110
CapabilityString *pCap;
110111
char **azCSP; /* Parsed content security policy */
@@ -168,10 +169,11 @@
168169
}else if( !hasAnyCap(zAnonCap, "jrwy234567")
169170
&& (!hasSelfReg || !hasAnyCap(zSelfCap, "jrwy234567"))
170171
&& (zPubPages==0 || zPubPages[0]==0) ){
171172
@ <li><p>This repository is <big><b>Completely PRIVATE</b></big>.
172173
@ A valid login and password is required to access any content.
174
+ bCompletelyPrivate = 1;
173175
}else{
174176
@ <li><p>This repository is <big><b>Mostly PRIVATE</b></big>.
175177
@ A valid login and password is usually required, however some
176178
@ content can be accessed either anonymously or by self-registered
177179
@ users:
@@ -712,39 +714,41 @@
712714
@ </p>
713715
table_of_public_phantoms();
714716
@ </li>
715717
}
716718
717
- @ <li><p><a href="setup_robot">Robot Defenses</a>:
718
- @ <ol type="a">
719
- switch( db_get_int("auto-hyperlink",1) ){
720
- default:
721
- @ <li> No auto-enable of hyperlinks.
722
- break;
723
- case 1:
724
- @ <li> Hyperlinks auto-enabled based on HTTP Header and Javascript.
725
- break;
726
- case 2:
727
- @ <li> Hyperlinks auto-enabled based on HTTP Header only.
728
- break;
729
- }
730
- z = db_get("max-loadavg",0);
731
- if( z && atof(z)>0.0 ){
732
- @ <li> Maximum load average for expensive requests: %h(z);
733
- }else{
734
- @ <li> No limits on the load average
735
- }
736
- z = db_get("robot-restrict",robot_restrict_default());
737
- if( z==0 || strcmp(z,"off")==0 ){
738
- @ <li> Robots are not excluded from any page.
739
- }else if( z[0]=='*' && z[1]==0 ){
740
- @ <li> Robots are excluded from all pages other than /login.
741
- }else{
742
- @ <li> Robots are excluded from pages matching: %h(z)
743
- }
744
- @ </ol>
745
-
719
+ if( !bCompletelyPrivate ){
720
+ @ <li><p><a href="setup_robot">Robot Defenses</a>:
721
+ @ <ol type="a">
722
+ switch( db_get_int("auto-hyperlink",1) ){
723
+ default:
724
+ @ <li> No auto-enable of hyperlinks.
725
+ break;
726
+ case 1:
727
+ @ <li> Hyperlinks auto-enabled based on HTTP Header and Javascript.
728
+ break;
729
+ case 2:
730
+ @ <li> Hyperlinks auto-enabled based on HTTP Header only.
731
+ break;
732
+ }
733
+ z = db_get("max-loadavg",0);
734
+ if( z && atof(z)>0.0 ){
735
+ @ <li> Maximum load average for expensive requests: %h(z);
736
+ }else{
737
+ @ <li> No limits on the load average
738
+ }
739
+ z = db_get("robot-restrict",robot_restrict_default());
740
+ if( z==0 || strcmp(z,"off")==0 ){
741
+ @ <li> Robots are not excluded from any page.
742
+ }else if( z[0]=='*' && z[1]==0 ){
743
+ @ <li> Robots are excluded from all pages other than /login.
744
+ }else{
745
+ @ <li> Robots are excluded from pages matching: %h(z)
746
+ }
747
+ @ </ol>
748
+ }
749
+
746750
blob_init(&cmd, 0, 0);
747751
for(i=0; g.argvOrig[i]!=0; i++){
748752
blob_append_escaped_arg(&cmd, g.argvOrig[i], 0);
749753
}
750754
@ <li><p>
751755
--- src/security_audit.c
+++ src/security_audit.c
@@ -101,10 +101,11 @@
101 const char *zPubPages; /* GLOB pattern for public pages */
102 const char *zSelfCap; /* Capabilities of self-registered users */
103 int hasSelfReg = 0; /* True if able to self-register */
104 const char *zPublicUrl; /* Canonical access URL */
105 const char *zVulnReport; /* The vuln-report setting */
 
106 Blob cmd;
107 char *z;
108 int n, i;
109 CapabilityString *pCap;
110 char **azCSP; /* Parsed content security policy */
@@ -168,10 +169,11 @@
168 }else if( !hasAnyCap(zAnonCap, "jrwy234567")
169 && (!hasSelfReg || !hasAnyCap(zSelfCap, "jrwy234567"))
170 && (zPubPages==0 || zPubPages[0]==0) ){
171 @ <li><p>This repository is <big><b>Completely PRIVATE</b></big>.
172 @ A valid login and password is required to access any content.
 
173 }else{
174 @ <li><p>This repository is <big><b>Mostly PRIVATE</b></big>.
175 @ A valid login and password is usually required, however some
176 @ content can be accessed either anonymously or by self-registered
177 @ users:
@@ -712,39 +714,41 @@
712 @ </p>
713 table_of_public_phantoms();
714 @ </li>
715 }
716
717 @ <li><p><a href="setup_robot">Robot Defenses</a>:
718 @ <ol type="a">
719 switch( db_get_int("auto-hyperlink",1) ){
720 default:
721 @ <li> No auto-enable of hyperlinks.
722 break;
723 case 1:
724 @ <li> Hyperlinks auto-enabled based on HTTP Header and Javascript.
725 break;
726 case 2:
727 @ <li> Hyperlinks auto-enabled based on HTTP Header only.
728 break;
729 }
730 z = db_get("max-loadavg",0);
731 if( z && atof(z)>0.0 ){
732 @ <li> Maximum load average for expensive requests: %h(z);
733 }else{
734 @ <li> No limits on the load average
735 }
736 z = db_get("robot-restrict",robot_restrict_default());
737 if( z==0 || strcmp(z,"off")==0 ){
738 @ <li> Robots are not excluded from any page.
739 }else if( z[0]=='*' && z[1]==0 ){
740 @ <li> Robots are excluded from all pages other than /login.
741 }else{
742 @ <li> Robots are excluded from pages matching: %h(z)
743 }
744 @ </ol>
745
 
 
746 blob_init(&cmd, 0, 0);
747 for(i=0; g.argvOrig[i]!=0; i++){
748 blob_append_escaped_arg(&cmd, g.argvOrig[i], 0);
749 }
750 @ <li><p>
751
--- src/security_audit.c
+++ src/security_audit.c
@@ -101,10 +101,11 @@
101 const char *zPubPages; /* GLOB pattern for public pages */
102 const char *zSelfCap; /* Capabilities of self-registered users */
103 int hasSelfReg = 0; /* True if able to self-register */
104 const char *zPublicUrl; /* Canonical access URL */
105 const char *zVulnReport; /* The vuln-report setting */
106 int bCompletelyPrivate = 0;/* True only if the repo is completely private */
107 Blob cmd;
108 char *z;
109 int n, i;
110 CapabilityString *pCap;
111 char **azCSP; /* Parsed content security policy */
@@ -168,10 +169,11 @@
169 }else if( !hasAnyCap(zAnonCap, "jrwy234567")
170 && (!hasSelfReg || !hasAnyCap(zSelfCap, "jrwy234567"))
171 && (zPubPages==0 || zPubPages[0]==0) ){
172 @ <li><p>This repository is <big><b>Completely PRIVATE</b></big>.
173 @ A valid login and password is required to access any content.
174 bCompletelyPrivate = 1;
175 }else{
176 @ <li><p>This repository is <big><b>Mostly PRIVATE</b></big>.
177 @ A valid login and password is usually required, however some
178 @ content can be accessed either anonymously or by self-registered
179 @ users:
@@ -712,39 +714,41 @@
714 @ </p>
715 table_of_public_phantoms();
716 @ </li>
717 }
718
719 if( !bCompletelyPrivate ){
720 @ <li><p><a href="setup_robot">Robot Defenses</a>:
721 @ <ol type="a">
722 switch( db_get_int("auto-hyperlink",1) ){
723 default:
724 @ <li> No auto-enable of hyperlinks.
725 break;
726 case 1:
727 @ <li> Hyperlinks auto-enabled based on HTTP Header and Javascript.
728 break;
729 case 2:
730 @ <li> Hyperlinks auto-enabled based on HTTP Header only.
731 break;
732 }
733 z = db_get("max-loadavg",0);
734 if( z && atof(z)>0.0 ){
735 @ <li> Maximum load average for expensive requests: %h(z);
736 }else{
737 @ <li> No limits on the load average
738 }
739 z = db_get("robot-restrict",robot_restrict_default());
740 if( z==0 || strcmp(z,"off")==0 ){
741 @ <li> Robots are not excluded from any page.
742 }else if( z[0]=='*' && z[1]==0 ){
743 @ <li> Robots are excluded from all pages other than /login.
744 }else{
745 @ <li> Robots are excluded from pages matching: %h(z)
746 }
747 @ </ol>
748 }
749
750 blob_init(&cmd, 0, 0);
751 for(i=0; g.argvOrig[i]!=0; i++){
752 blob_append_escaped_arg(&cmd, g.argvOrig[i], 0);
753 }
754 @ <li><p>
755

Keyboard Shortcuts

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