summary refs log blame commit diff stats
path: root/getwtxt.json
blob: b739d8c7df121f29e44b90d130201018e0474ffe (plain) (tree)
<
{
  "ListenPort": 9001,
  "StdoutLogging": true,
  "LogFile": "getwtxt.log",
  "DatabasePath": "getwtxt.db",
  "DatabasePushInterval": "5m",
  "StatusFetchInterval": "1h",
  "Instance": {
    "SiteName": "getwtxt",
    "URL": "https://twtxt.example.com",
    "OwnerName": "foo barrington",
    "Email": "foo@barrington.ext",
    "Description": "This is the twtxt registry for the tildeverse network of public unix servers."
  }
}
an> "Nickname or URL missing") return } uip := getIPFromCtx(r.Context()) out, remoteRegistry, err := registry.GetTwtxt(urls) if err != nil { log400(w, r, err.Error()) return } if remoteRegistry { remoteRegistries.Mu.Lock() remoteRegistries.List = append(remoteRegistries.List, urls) remoteRegistries.Mu.Unlock() if err := twtxtCache.CrawlRemoteRegistry(urls); err != nil { log400(w, r, err.Error()) return } log200(r) return } statuses, err := registry.ParseUserTwtxt(out, nick, urls) if err != nil { log400(w, r, err.Error()) return } if err := twtxtCache.AddUser(nick, urls, uip, statuses); err != nil { log400(w, r, err.Error()) return } log200(r) _, err = w.Write([]byte(fmt.Sprintf("200 OK\n"))) if err != nil { log.Printf("%v\n", err) } }