abuse reports: signed reports, gossip and sync, a local hide rule, visitor tips

A report is signed by a node operator (device key and certificate) and
gossiped on one global topic. Each node decides whose reports count: the
operator's own report hides a listing on that node, one trusted report of
illegal content hides it, and --hide-after trusted scam reports hide it
(--trust-reporter names others). Hidden listings stay stored and reachable.
Visitors can tip the node's operator off with a proof-of-work request that
hides nothing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
This commit is contained in:
2026-11-18 21:18:43 +01:00
co-authored by Claude Sonnet 5.5
parent 253eb6e75c
commit 6d55222ac5
17 changed files with 1854 additions and 13 deletions
+9 -1
View File
@@ -120,6 +120,14 @@ func New(cfg Config) http.Handler {
mux.HandleFunc("GET /api/v1/listings/{id}/address", s.admin(s.getAddress))
mux.HandleFunc("DELETE /api/v1/listings/{id}/address", s.admin(s.deleteAddress))
}
// Abuse reports: anyone can read what this node makes of a listing's
// reports and tip the operator off (proof-of-work, no account); the
// operator reads the tips and signs reports.
mux.HandleFunc("GET /api/v1/reports", s.getReports)
mux.HandleFunc("POST /api/v1/signals", s.postSignal)
mux.HandleFunc("GET /api/v1/signals", s.admin(s.listSignals))
mux.HandleFunc("DELETE /api/v1/signals/{author}/{id}", s.admin(s.dismissSignals))
mux.HandleFunc("POST /api/v1/reports", s.admin(s.postReport))
mux.Handle("GET /", s.ui())
return secure(mux)
}
@@ -175,7 +183,7 @@ func (s *server) status(w http.ResponseWriter, r *http.Request) {
func (s *server) search(w http.ResponseWriter, r *http.Request) {
q := r.URL.Query()
query := store.Query{Kind: q.Get("kind"), Category: q.Get("category")}
query := store.Query{Kind: q.Get("kind"), Category: q.Get("category"), IncludeHidden: q.Get("hidden") == "1"}
if g := q.Get("geohash"); g != "" {
for _, p := range strings.Split(g, ",") {