limits: sync streams, listings per author, inbound connections per IP

A peer may hold 4 sync streams and open 1500 a minute; banned peers get none and cannot redial. A node keeps at most 100 unexpired listings per author (--max-per-author); updates, renewals and deletions of held ones still work. At most 16 inbound connections per public IP or IPv6 /64 (--max-conns-per-ip); local and private addresses are exempt.

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-19 00:30:36 +01:00
co-authored by Claude Sonnet 5.5
parent 0b3ead4b23
commit 5ac02360c4
12 changed files with 527 additions and 23 deletions
+2
View File
@@ -511,6 +511,8 @@ func (s *server) seal(w http.ResponseWriter, r *http.Request, l *listing.Listing
fail(w, http.StatusBadRequest, strings.TrimPrefix(err.Error(), store.ErrInvalid.Error()+": "))
case errors.Is(err, store.ErrRevoked):
fail(w, http.StatusConflict, "this node's device has been revoked; run 'allmende recover'")
case errors.Is(err, store.ErrQuota):
fail(w, http.StatusConflict, "this node keeps no more listings for you; delete or let some expire first")
case errors.Is(err, context.Canceled):
fail(w, http.StatusRequestTimeout, "request cancelled")
default: