Add robots.txt checking

Still needs periodic cache refresh
This commit is contained in:
2024-10-23 14:24:10 +03:00
parent c49a69728a
commit ef3f009709
12 changed files with 225 additions and 156 deletions

View File

@@ -1,22 +0,0 @@
package gemini
import "gemini-grc/logging"
var Blacklist *[]string
func InBlacklist(s *Snapshot) bool {
if Blacklist == nil {
data := ReadLines("blacklists/domains.txt")
Blacklist = &data
logging.LogInfo("Loaded %d blacklisted domains", len(*Blacklist))
}
for _, l := range *Blacklist {
if s.Host == l {
return true
}
// if strings.HasPrefix(s.URL.String(), l) {
// return true
// }
}
return false
}