Fossil SCM

Modify the /honeypot to explain the situation to human readers who might accidentally reach it, and offer them a links to the login page to prove their humanness.

drh 2022-02-12 01:01 trunk
Commit 533c2c7144ad4bc9f5b0ca8b14482d387b055cc6efa2677ba1da92465d607fd5
1 file changed +13 -2
+13 -2
--- src/style.c
+++ src/style.c
@@ -1319,12 +1319,23 @@
13191319
/*
13201320
** WEBPAGE: honeypot
13211321
** This page is a honeypot for spiders and bots.
13221322
*/
13231323
void honeypot_page(void){
1324
- cgi_set_status(403, "Forbidden");
1325
- @ <p>Please enable javascript or log in to see this content</p>
1324
+ style_header("I think you are a robot");
1325
+ @ <p>You seem like a robot.</p>
1326
+ @
1327
+ @ <p>Is this wrong? Are you really a human? If so, please prove it
1328
+ @ by <a href="%R/login">logging in</a>.
1329
+ if( g.anon.Hyperlink ){
1330
+ @ You can <a href="%R/login?anon=1">log in anonymously</a> if you
1331
+ @ prefer.
1332
+ }
1333
+ @ <p>Sorry for the inconvenience. The point of this is to prevent
1334
+ @ robots from following the countless of hyperlinks in this site and
1335
+ @ soaking up all the available CPU time and network bandwidth.
1336
+ style_finish_page();
13261337
}
13271338
13281339
/*
13291340
** Webpages that encounter an error due to missing or incorrect
13301341
** query parameters can jump to this routine to render an error
13311342
--- src/style.c
+++ src/style.c
@@ -1319,12 +1319,23 @@
1319 /*
1320 ** WEBPAGE: honeypot
1321 ** This page is a honeypot for spiders and bots.
1322 */
1323 void honeypot_page(void){
1324 cgi_set_status(403, "Forbidden");
1325 @ <p>Please enable javascript or log in to see this content</p>
 
 
 
 
 
 
 
 
 
 
 
1326 }
1327
1328 /*
1329 ** Webpages that encounter an error due to missing or incorrect
1330 ** query parameters can jump to this routine to render an error
1331
--- src/style.c
+++ src/style.c
@@ -1319,12 +1319,23 @@
1319 /*
1320 ** WEBPAGE: honeypot
1321 ** This page is a honeypot for spiders and bots.
1322 */
1323 void honeypot_page(void){
1324 style_header("I think you are a robot");
1325 @ <p>You seem like a robot.</p>
1326 @
1327 @ <p>Is this wrong? Are you really a human? If so, please prove it
1328 @ by <a href="%R/login">logging in</a>.
1329 if( g.anon.Hyperlink ){
1330 @ You can <a href="%R/login?anon=1">log in anonymously</a> if you
1331 @ prefer.
1332 }
1333 @ <p>Sorry for the inconvenience. The point of this is to prevent
1334 @ robots from following the countless of hyperlinks in this site and
1335 @ soaking up all the available CPU time and network bandwidth.
1336 style_finish_page();
1337 }
1338
1339 /*
1340 ** Webpages that encounter an error due to missing or incorrect
1341 ** query parameters can jump to this routine to render an error
1342

Keyboard Shortcuts

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