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.
Commit
533c2c7144ad4bc9f5b0ca8b14482d387b055cc6efa2677ba1da92465d607fd5
Parent
8d4e11432d2d54a…
1 file changed
+13
-2
+13
-2
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -1319,12 +1319,23 @@ | ||
| 1319 | 1319 | /* |
| 1320 | 1320 | ** WEBPAGE: honeypot |
| 1321 | 1321 | ** This page is a honeypot for spiders and bots. |
| 1322 | 1322 | */ |
| 1323 | 1323 | 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(); | |
| 1326 | 1337 | } |
| 1327 | 1338 | |
| 1328 | 1339 | /* |
| 1329 | 1340 | ** Webpages that encounter an error due to missing or incorrect |
| 1330 | 1341 | ** query parameters can jump to this routine to render an error |
| 1331 | 1342 |
| --- 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 |