55 Commits
Author SHA1 Message Date
William CasarinandClaude Opus 4.8 e5a3e472df dump-buckets: --sort tokens|age|key and --reverse
Add reordering to the dump-buckets peek. `--sort tokens` (default) keeps the
most-throttled IP on top (fewest bytes remaining first); `--sort age` leads
with the most-recently-active bucket (smallest last-refill age); `--sort key`
is lexical by IP. `--reverse` flips whichever key is chosen. Handy on a live
table of thousands of buckets to flip between "who's drained" and "who's
active right now".

Changelog-Added: dump-buckets --sort (tokens|age|key) and --reverse
Headway: headway:noteguard/climb-prosper-civil
Agentium: agentium:dad-spider-exercise
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-09-13 00:26:09 -07:00
William Casarin 85f8e35e00 readpolicy: default read_bandwidth to shared-memory enforcement
The read_bandwidth per-IP byte throttle is only authoritative when every
`noteguard read` process shares one bucket table: strfry runs one process per
read-serving thread, so an IP's reconnects fan across up to numThreads
processes and a per-process bucket enforces bytes_per_minute × N. That shared
table was opt-in via shared_state_path — so the safe, working behavior was
opt-in and the broken-for-enforcement per-process behavior was the default. We
got bitten by this in prod: the filter was enabled but shared_state_path was
unset, so enforcement silently didn't hold across processes.

Flip the default. `shared_state_path` unset now attaches to the standard tmpfs
path (DEFAULT_SHARED_STATE_PATH = /dev/shm/noteguard-read-bandwidth), so
cross-process enforcement is ON out of the box. An explicit empty string
(shared_state_path = "") is the per-process opt-out for hosts that can't use
tmpfs; a non-empty path overrides the location. Fail-open on an unattachable
file is unchanged.

Keep the tests hermetic: every read_bandwidth test config now sets
shared_state_path = "" so `cargo test` uses a fresh in-process map per test
and never creates or depends on the real /dev/shm file.

Also document the new default-on semantics in noteguard.toml and the README.

Changelog-Changed: read_bandwidth now enforces its per-IP budget across read processes by default (shared /dev/shm bucket); set shared_state_path = "" to opt out to per-process buckets
Headway: headway:noteguard/arrive-female-crane
Agentium: agentium:setup-illegal-peanut
2026-09-13 00:26:09 -07:00
William CasarinandClaude Opus 4.8 9f656006d8 readpolicy: dump-buckets CLI to inspect the read-bandwidth shm file
Add a read-only `noteguard dump-buckets [--json] [--capacity BYTES] [PATH]`
operator subcommand that peeks inside the shared per-IP read-bandwidth
byte-bucket file (default /dev/shm/noteguard-read-bandwidth). It mmaps the
file read-only, validates the header magic/version, and prints one row per
OCCUPIED slot — key (IP), bytes remaining, and last-refill age — sorted
most-throttled first. `--capacity` additionally projects each bucket refilled
to now and its percent-full; `--json` emits machine output.

The reader lives as a `dump()` accessor in readfilters/shm.rs (returning a
`Dump`/`BucketEntry`) rather than duplicating the private on-disk layout. It is
deliberately lock-free: taking a slot's spinlock would write to the mapping,
which a read-only diagnostic must not do (and a tool dying mid-hold would wedge
a live slot). An OCCUPIED slot's key is immutable after claim, and tokens/
last_refill are naturally-aligned 8-byte words, so a lock-free read is a sound
best-effort snapshot on the single-host, coherent-cache target — documented on
`dump`. It never mutates the file.

Covered by two unit tests in shm.rs: dump reads back known buckets written
through the metering paths, and rejects a non-bucket file.

Changelog-Added: noteguard dump-buckets CLI to inspect the read-bandwidth shared-memory buckets
Headway: headway:noteguard/climb-prosper-civil
Agentium: agentium:dad-spider-exercise
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-09-13 00:26:09 -07:00
William Casarin 0e082512bd readpolicy: shared-memory per-IP read-bandwidth buckets
strfry constructs its PluginReadPolicy as a per-thread local, spawning one
`noteguard read` process per read-serving thread (reqWorker + reqMonitor). Each
process kept its own in-memory ByteBucket, so an IP's reconnects — pinned to a
thread by connId % numThreads — fanned across up to N processes, making the
effective per-IP budget bytes_per_minute × N (~12x on the damus relay). The only
exact-enforcement lever was reqWorker=1/reqMonitor=1, which kills read
parallelism.

Back read_bandwidth's per-IP byte buckets with a single mmap'd MAP_SHARED file
(memmap2) shared by every read process on the host: a fixed-size open-addressing
table keyed by client IP (repr(C): IP bytes + tokens f64-bits + last_refill),
FNV-1a home slot + linear probe, one per-slot spinlock guarding each bucket, and
a versioned header with a one-time CAS init handshake (first process creates +
zeroes, others attach + validate). last_refill is CLOCK_MONOTONIC nanoseconds
(std::time::Instant is process-relative and can't live in shared memory); a
future timestamp (stale from a prior boot) resets the slot. Fails open —
delivers — when a slot lock can't be taken, the table is full, the key is
over-long, or the mmap/init fails, matching the ReadFilter contract. No eviction:
the table sizes to max_ips and lives on tmpfs, so it survives strfry restarts and
resets on reboot. New config keys shared_state_path + max_ips (unset path => a
private per-process map, the old behavior). Scope is read_bandwidth only:
max_events_per_conn is keyed by connId, already pinned to one process.

Verified E2E against strfry (req-plugin-simplified, reqWorker=3 reqMonitor=3),
one IP across 8 reconnects, budget 1000 B/min, ~413 B events: with
shared_state_path set the aggregate delivered ONE budget (2 events) and every
later reconnect got CLOSED "budget exhausted" from whichever of the 6 processes
served it; with the path unset (per-process control) the same drive delivered 6
= 3 reqWorker processes × 2 — the sharding blowup, reproduced and then removed.

Changelog-Added: Shared-memory per-IP read-bandwidth buckets for accurate cross-process enforcement without reducing read thread count.
Headway: headway:noteguard/ethics-palm-remember
Agentium: agentium:swim-brother-army
2026-09-09 11:17:22 -07:00
William CasarinandClaude Opus 4.8 05d428f1d3 cloudflare: reconcile the ban list on startup so restarts recover deletes
A ban's removal previously lived only in the worker's in-memory timer, so a
restart (deploy, crash, config reload) in the window between the add and its
scheduled delete stranded the IP in the Cloudflare list forever — WAF IP lists
have no per-item TTL, so nothing ever cleaned it up.

Make the list self-describing instead: each item's comment now carries the ban's
wall-clock expiry (`noteguard-ban;until=<unix>`), and the worker runs a
reconciliation pass before its loop. It lists the noteguard-tagged items, deletes
any already past their expiry (recovering the removals a prior process never ran),
and re-schedules the still-live ones on its timer without re-adding them. The
marker scopes reconciliation to our own entries, so a shared list's other items
are never touched, and listing follows Cloudflare's pagination cursors so a large
list is fully swept rather than truncated.

This needs no local persistence — the Cloudflare list itself is the source of
truth — which also means every strfry plugin process cleans up stale entries on
its own startup. The one tradeoff: a ban *extension* updates only the in-process
timer, not the persisted stamp, so after a restart an extended ban reverts to its
original expiry (documented; a rare edge).

Verified end-to-end against a stateful mock: a process adds a ban and exits
before expiry, then a fresh process reconciles on startup and issues the recovered
GET+DELETE, emptying the list. Added unit tests for comment parsing and for
reconcile (stale removed, live rescheduled without re-adding); 32 lib tests pass.

Changelog-Added: Cloudflare edge-bans now survive a noteguard restart — the ban list is reconciled on startup, recovering removals that a prior process never ran

Headway: headway:noteguard/fluid-tonight-siren
Agentium: agentium:neck-case-fog
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-09-08 22:35:42 -07:00
William CasarinandClaude Opus 4.8 fc5a3938b3 cloudflare: escalate BanTracker IP-bans to a WAF IP list (edge block)
Add an optional, feature-gated Cloudflare integration that escalates any
write-path IP-ban to the edge. Because both the ratelimit and content filters
funnel their bans through the shared `BanTracker::strike`, that one hook is the
single choke point: when a ban trips, the offender's IP is added to a Cloudflare
WAF IP list for the ban's duration, then removed when it expires, so a banned IP
is dropped by Cloudflare before it ever reaches the relay.

A new `cloudflare` module owns a process-global background worker (std thread +
mpsc, blocking `ureq`) shared by every `BanTracker`, armed once at startup from a
top-level `[cloudflare]` config table. The worker is required because (a) HTTP
must not block the note path and (b) a banned IP never reaches noteguard again,
so the local `banned_until` can't drive cleanup — removals are scheduled on the
worker's own expiry timer instead. The Lists API is async and deletes by item
id, so removal resolves the id via `GET ?search=<ip>` then `DELETE`.

The API token comes from the CLOUDFLARE_API_TOKEN env var (never the config
file); the non-secret account_id/list_id live in `[cloudflare]`. The operator
wires the list into a zone WAF custom rule once — noteguard only manages list
membership. Entirely opt-in: with no `[cloudflare]` section, a missing token, or
the feature compiled out, `edge_ban` is a no-op and noteguard behaves as before.

Verified end-to-end against a mock Cloudflare endpoint: two spam notes trip a
content ban, POST adds the IP with the right bearer token and body, and the 2s
expiry timer fires the GET+DELETE. Worker scheduling/dedup/extend logic is
unit-tested via a mock API (30 lib tests pass); default build is unchanged.

Changelog-Added: Optional Cloudflare edge-banning (cloudflare feature): IP-bans from the ratelimit and content filters are pushed to a Cloudflare WAF IP list and removed when they expire

Headway: headway:noteguard/fluid-tonight-siren
Agentium: agentium:neck-case-fog
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-09-08 22:19:22 -07:00
William CasarinandClaude Opus 4.8 64f246e547 filters: share the IP-ban logic between ratelimit and content
Extract the per-IP strike counter + temporary IP-ban that `ratelimit` grew
into a reusable `BanTracker` (src/filters/ban.rs), embedded in a filter with
`#[serde(flatten)]` so its `ban_after` / `ban_duration_secs` / `ban_message`
knobs stay at the filter's own config level. The tracker holds state; the
filter decides what a "strike" is and how to respond while banned.

`ratelimit` keeps its consecutive-streak policy (any accepted post calls
`reset`), and now `content` reuses the same machinery with a cumulative
policy: content violations accrue per IP without a clean note resetting them,
and once they cross `ban_after` every note from that IP is silently
shadow-rejected — matching content's existing stealth stance rather than
revealing a visible reject. Banning stays opt-in; with `ban_after` unset both
filters store zero per-IP state and behave exactly as before.

Changelog-Added: Content filter can now IP-ban repeat offenders after N violations, reusing the ratelimit ban mechanism

Headway: headway:noteguard/depend-jeans-enable
Agentium: agentium:voyage-hamster-exile
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-09-08 21:59:28 -07:00
William Casarin 4b16308ff0 content: homoglyph-resistant matching via confusables skeleton
The content filter compared raw bytes with `str::contains`, so airdrop-scam
spam spoofing the phrase with Cyrillic look-alikes ("Dаmus Аirdrop", where
а/А are U+0430/U+0410) slipped straight through a "Damus Airdrop" blocklist
entry.

Fold both the note content and each blocklist term to their UTS #39
confusables skeleton (via unicode-security) and case-fold before matching, so
homoglyph and casing variants collapse to the same form. Case is folded on
both sides of the skeleton because the confusable prototypes are not
case-stable. Normalized terms are cached lazily on first use.

Also list "Damus Airdrop" in noteguard.toml so the running relay catches it.

Changelog-Changed: content filter now catches homoglyph/case spoofs of blocked phrases

Headway: headway:noteguard/copy-resource-merit
Agentium: agentium:rate-guess-visit
2026-09-08 21:49:57 -07:00
William CasarinandClaude Opus 4.8 8d39922f81 ratelimit: IP-ban after N consecutive rate-limit hits
Persistent offenders that keep hammering the write path while rate-limited
now escalate into a temporary IP-ban. The ratelimit filter tracks a per-IP
streak of consecutive rate-limit rejections; once it crosses `ban_after`,
every note from that IP is rejected for `ban_duration_secs` (default 3600,
one hour). Any accepted post resets the streak, and an expired ban clears
itself (and the streak) on the next post.

All three knobs are optional; omitting `ban_after` preserves the old
rate-limit-only behavior. Whitelisted IPs bypass banning entirely.

Changelog-Added: Ratelimit filter can now IP-ban persistent offenders that repeatedly hit the rate limit

Headway: headway:noteguard/depend-jeans-enable
Agentium: agentium:voyage-hamster-exile
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-09-08 21:35:05 -07:00
William CasarinandClaude Opus 4.8 6651dde5a4 readpolicy: CLOSED + retryMs backpressure on drained read budgets
The read throttles (read_bandwidth, max_events_per_conn) admitted every
subscription at reqOpen and silently withheld events on `req` once the
budget was spent. A client just saw a short EOSE with no signal — and for
a bounded `limit:N` query that is lossy: a silent partial delivery + EOSE
is indistinguishable from "that's all N there were", so the client stops
and never retries.

Reject an over-budget IP/conn outright at reqOpen instead, so strfry emits
a NIP-01 CLOSED with our message and a retry hint (real backpressure that
preserves eventual completeness — the client knows to come back):

- read_bandwidth: refill-then-peek the per-IP byte bucket at reqOpen; if it
  can't afford a nominal event (512 B, clamped to capacity so a fresh full
  bucket always passes), reject with retry_ms = time to refill one nominal
  event at bytes_per_minute. The next event's real size is unknown at open,
  so retry_ms is an estimate (documented on NOMINAL_EVENT_SIZE). The refill
  logic is extracted to ByteBucket::refill and shared with filter_event.
- max_events_per_conn: if the connId is at its lifetime cap, reject with a
  message and NO retry_ms — the cap has no refill on the same connId, so a
  same-conn retry is futile; a reconnect gets a fresh connId (its own retry).

The per-event withhold-rest-of-batch `Stop` is kept, re-scoped as overshoot
protection only (bound one in-flight batch to <= budget) — without it a
single limit:500 batch delivers the whole payload and the bucket goes deeply
negative. reqOpen reject is the primary path (covers reconnect/churn/new-
query abuse); a mid-stream drain or long-lived live sub still has only the
silent-withhold lever (no admission hook on post-EOSE `req` batches).

Verified E2E against strfry (reqWorker=1 reqMonitor=1): an IP that drained a
2000 B/min budget on its first REQ got, on the next fresh REQ,
`CLOSED s2: ERROR: read bandwidth budget exhausted (2000 bytes/min per IP)
(retry in 15360ms)`; a conn at a max=3 cap got
`CLOSED s2: ERROR: per-connection event cap reached (3 events); reconnect
for a fresh budget` (no retry hint). Unit tests cover reject-at-reqOpen for
both filters plus the still-accept and whitelist-passthrough paths.

Changelog-Added: CLOSED/retryMs backpressure for read throttles (read_bandwidth, max_events_per_conn) — an over-budget subscription is now rejected at reqOpen with a NIP-01 CLOSED + retry hint instead of a silent truncated feed
Headway: headway:noteguard/bridge-live-frame
Agentium: agentium:student-legend-hospital
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-09-08 20:22:20 -07:00
William Casarin d6c69fed9d noteguard.toml: document the readpolicy pipeline
Add a worked `[readpolicy]` example to the shipped config, alongside the
write-side filters it already documents. The read loop reads this same file, so
an operator wiring up `readPolicy { plugin = "./noteguard read" }` had nothing
in front of them but the README.

Ships as a no-op: `pipeline = []` keeps the default deliver-all behavior (every
subscription takes strfry's passthrough fast path), and the three filter tables
below it are inert until a name is listed in the pipeline — the engine only
constructs what the pipeline names. The commented-out pipeline line shows how to
turn them on. Config for all three read filters is covered:
max_events_per_conn, read_bandwidth (including the per-thread scoping caveat),
and the feature-gated nscript guest.

Verified against the built binary: the write loop still parses this file
unchanged (it ignores the unknown `readpolicy` key); the read loop loads it and
reports `pipeline: [] (3 filter configs)` with passthrough:true and delivers
everything; with the pipeline uncommented all three tables deserialize and
behave (throttles disable passthrough, a whitelisted IP is exempt, an absent
guest module fails open); and in a build without the `nscript` feature the
nscript entry is logged and skipped rather than failing.

Changelog-None:
Headway: headway:noteguard/knee-derive-worth
2026-09-08 19:27:10 -07:00
William CasarinandClaude Opus 4.8 4265d3a019 nscript: experimental wasm note filter, on both the write and read paths
Add an experimental `nscript` filter that runs a user-supplied WASM guest,
behind the `nscript` cargo feature (wasmtime), on both the write path (should
this note be stored) and the read path (should this note be delivered to this
subscriber). This is the experimental part of the plugin work — the readPolicy
trait, engine and throttles in the preceding commits stand on their own without
it, and a build without the feature skips an `nscript` pipeline entry (fail
open) rather than failing.

The ABI is an accessor interface over an opaque note handle: the guest never
parses a note buffer, it calls imported `note_*` host functions
(note_pubkey/id/kind/created_at/content, note_targets_owner, is_following, log)
to read fields. The note's byte format is thus a host implementation detail —
today backed by the serde Note; later an ndb_note with an optional zero-copy raw
fast path. Owner-relative context (the scoped npub and its follows) lives on the
host so guests stay reusable, owner-agnostic logic.

Guests are bounded by wasm fuel and a memory cap per note, and noteguard fails
open on trap/exhaustion so a broken or runaway filter can't block writes, hang
the relay, or withhold a subscriber's own authorized feed.

On the read path the subscriber (the NIP-42 authed pubkey) is the script owner,
so a per-npub feed filter runs scoped to whoever is reading. Runtime::rescope
re-binds an already-compiled guest to a different owner and follow-set by cloning
the (internally reference-counted) engine/module/linker, so the guest is
JIT-compiled once per process and a subscription costs no compile or file read on
strfry's serving thread; a failed load is logged once rather than once per
subscription. The Verdict collapses on the read path to deliver (Accept) vs
withhold (anything else) — there is no shadow concept for reads. Only this filter
calls UnparsedNote::parse(); the throttles still never deserialize a Note.

Script/follow distribution is stubbed for this phase (configured statically via
`module`/`owner`/`follows` rather than sourced from signed submission events on
the relay); the point today is the ABI + runtime wiring.

Includes three example guests: follows-only (an inbox filter, <300 bytes with no
note parser linked in), an adversarial infinite-loop guest, and mute-word (an
owner-independent content mute, convenient for exercising the read path without
AUTH). Verified end-to-end on the write path: followed->accept,
stranger->reject, off-target->accept, and the spinner is stopped by fuel in
~15ms. And on the read path against strfry (branch config): content filtering
withholds exactly the muted events, a trapping guest fails open and delivers
all; plugin logs show reqOpen(+filter) -> req(+events) -> connClose.

Changelog-Added: Experimental nscript WASM note filter (behind the `nscript` feature), on both the write path and the readPolicy delivery path
Headway: headway:noteguard/chair-kick-reopen
Headway: headway:noteguard/gloom-lucky-budget
Agentium: agentium:exhaust-bus-combine

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-09-08 17:06:13 -07:00
William Casarin a9638232a8 readpolicy: read-bandwidth-per-minute throttle (per-IP byte bucket)
Add a read-side analogue of the write-side `ratelimit` filter: meter the
bytes of events delivered per minute, keyed per client IP so a client
cannot reconnect (new connId) to reset its budget.

Byte size comes from UnparsedNote::size() — the exact streamed wire length, no
re-serialization and no Note parse, so this filter never deserializes an event.
filter_batch charges each delivered event's size against an Instant token bucket
keyed by IP (same refill shape as ratelimit.rs), withholding the rest of a batch
once the budget is spent. Because the charge lands in on_delivered, an event a
later filter withholds spends no budget. The byte buckets are never evicted on
connClose — surviving reconnect is the point.

Whitelist status and the bucket key are resolved once per connection at
reqOpen (a connection's IP, authed pubkey and whitelist status are fixed for its
life), so the per-event path is a single connId lookup with no allocation and no
whitelist rescan, and an old strfry that sends no `ip` warns once per connection
rather than per event. A bandwidth-limited sub is excluded from the passthrough
fast path so strfry keeps sending `req` to meter; a whitelisted one is
passthrough, since it does no per-event work.

Config: [readpolicy.filters.read_bandwidth] bytes_per_minute (per IP) and
whitelist (an entry matches the conn's IP or authed pubkey).

E2E-verified against a rebuilt strfry carrying the reqOpen `ip` field:
below budget delivers all, the byte cap withholds the rest, and with a
single reqWorker thread the per-IP budget survives a reconnect. Note:
strfry runs one plugin process per read-serving thread, so the budget is
scoped per-process (effective limit up to numThreads x configured) — same
per-thread scoping as the write-side ratelimit; documented in the README.

Changelog-Added: Read-bandwidth-per-minute throttle for the readPolicy plugin, metering bytes of delivered events per client IP.
Headway: headway:noteguard/muffin-column-enough
Agentium: agentium:coast-awesome-relax
2026-09-08 17:04:47 -07:00
William CasarinandClaude Opus 4.8 cad9b83241 readpolicy: strfry read-side plugin with a ReadFilter pipeline
Add a read-side counterpart to noteguard's writePolicy plugin, consuming
strfry's per-subscription REQ deliverability protocol (reqOpen / req / reqClose
/ connClose) to make per-subscriber, per-event deliver/withhold decisions.
Withholding an event never touches storage and never affects another subscriber.

Wire protocol lives in src/readmsg.rs (line-delimited JSON, monotonic reqId),
reachable via a new `noteguard read` subcommand (strfry invokes it as
`./noteguard read`). Events arrive as UnparsedNote(Box<RawValue>), kept in their
original wire form: size() is the exact streamed byte length with no
re-serialization, and parse()/id() defer any real parse to the paths that need
fields. Because RawValue only captures source bytes at the top-level
deserializer, ReadInput uses a manual Deserialize over a flat RawInput struct
rather than a derived internally-tagged enum (which buffers into a serde Content
and breaks capture).

The read path is a composable pipeline, the analogue of the write-side
NoteFilter design. The new ReadFilter trait (src/read_filter.rs) carries the
richer semantics reads need: lifecycle hooks (req_open admission + passthrough
opt-out, req_close, conn_close), a per-event verdict {Deliver, Skip, Stop}
(Stop withholds the rest of a batch), a check/commit split (filter_event checks,
on_delivered commits budget only for events delivered by the WHOLE pipeline — so
an event a later filter withholds never charges an earlier filter's counter),
shared per-connection context (the engine caches ip/authed at reqOpen since req
batches carry no IP), and a per-filter fail-open contract.

ReadPolicy (src/readpolicy.rs) is the engine: a name-keyed registry +
register_filter + a config-driven [readpolicy].pipeline, mirroring
Noteguard/register_filter/pipeline and sharing the same noteguard.toml (both
subcommands now honour $NOTEGUARD_CONFIG via noteguard::config_path).
Unknown/misconfigured pipeline entries are logged and skipped (fail open) rather
than panicking like the write side — a misconfigured read filter must not take
down a subscriber's feed.

Subscriptions that do no per-event work answer reqOpen with
{"action":"accept","passthrough":true}: strfry then skips all per-event
marshaling and delivers via its zero-copy fast path, never sending `req`
batches (it still sends reqClose/connClose so we can free state). Passthrough is
the AND of !needs_events across filters, evaluated per subscription. Reject still
wins; passthrough only rides on an accept. Emitting the field is
forward-compatible: a strfry without passthrough support ignores the extra key.

Ships one filter, max_events_per_conn (a per-connection delivery cap), which is
enough to exercise the counter/Stop/commit path; read_bandwidth and the
experimental nscript guest filter follow in their own commits.

Changelog-Added: Add strfry read-side (readPolicy) REQ plugin mode (`noteguard read`) with a composable ReadFilter pipeline
Headway: headway:noteguard/hotel-limit-bounce
Agentium: agentium:twenty-trouble-until

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-09-08 17:04:12 -07:00
William Casarin 6ac89a1626 tags: use rustytags
Signed-off-by: William Casarin <jb55@jb55.com>
2026-09-08 16:00:01 -07:00
William CasarinandGitHub 4d4d9d62d0 Merge pull request #17 from dsaxton/dsaxton/blacklist-cidr
Allow blacklisting CIDR ranges
2025-05-01 16:34:55 -07:00
Daniel Saxton 11de1ddfbb Add blacklist docs 2025-03-08 07:30:07 -06:00
Daniel Saxton 62c2aa547b Use custom deserialization 2025-03-07 21:47:48 -06:00
Daniel Saxton c22f1f0a24 Allow blacklisting CIDR ranges 2025-01-04 19:40:14 -06:00
William Casarin e6566e65f9 Merge remote-tracking branch 'dsaxton/blacklist' 2025-01-04 11:40:18 -08:00
William Casarin 2184378f0d readme: fix docs on delayed testing 2024-11-18 11:07:33 -08:00
William Casarin db9ef05d85 readme: document new rate-limit message option 2024-11-18 11:07:15 -08:00
William Casarin 778c5a053b ratelimit: reduce the number of string allocations
not a huge deal, but this is technically a bit nicer
2024-11-18 11:02:52 -08:00
Daniel SaxtonandWilliam Casarin 77c2a8906c ratelimit: make message configurable
Changelog-Added: Make ratelimit message configurable
Closes: https://github.com/damus-io/noteguard/pull/15
2024-11-18 11:02:20 -08:00
Daniel SaxtonandWilliam Casarin 3b73e9aa00 make: add linux build 2024-11-18 11:01:04 -08:00
William Casarin 4d4c9981ef forwarder: run cargo fmt 2024-11-18 11:01:04 -08:00
Daniel Saxton 690e2b0a47 Add blacklist filter 2024-09-23 22:20:51 -05:00
William Casarin 5ec7642342 Merge forwarder TLS support and content filter
Daniel D’Aquino (1):
      Add TLS support for the forwarder

William Casarin (2):
      filter: add content filter
2024-08-25 11:09:53 +03:00
Daniel D’Aquino 0c21ea0f03 Add TLS support for the forwarder
This commit configures noteguard and dependencies to be built with TLS
support, to allow it to forward notes to TLS-enabled relays.

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Closes: https://github.com/damus-io/noteguard/issues/13
2024-08-23 15:34:51 -07:00
William Casarin cae0393ed0 filter: add content filter
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-30 10:52:41 -07:00
William Casarin 8e1bb0363f test: add chatgpt generated tests
because I'm lazy

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-19 11:13:24 -07:00
William Casarin 471a70bbfa simplify main loop
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-19 11:13:02 -07:00
William Casarin 399f238865 readme: add forwarder to example config
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-11 15:02:36 -07:00
William Casarin 4704b3034f mention queue size default
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-11 14:57:16 -07:00
William Casarin 670b390096 readme: make note that forwarder is compile flag
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-11 14:56:46 -07:00
William Casarin 15e53a116a filter: add forwarder filter
Fixes: https://github.com/damus-io/noteguard/issues/10
Changelog-Added: Add forwarder filter
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-11 14:50:36 -07:00
William Casarin 794468d98a add forwarder deps
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-11 14:44:41 -07:00
William Casarin d7d62d343b improve instructions
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-11 09:22:03 -07:00
William Casarin 9af92bfca3 install instructions
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-11 09:11:18 -07:00
William Casarin c85f9cbc3d filter: add kind blacklist filter
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-09 11:05:21 -07:00
William Casarin f08e805673 filters/protected_events: fix clippy
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-09 11:05:01 -07:00
William Casarin 39d70fd179 readme: update test instructions, add static build instructions
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-09 10:35:02 -07:00
William Casarin e28454ac32 filter: add protected_events filter
This adds support for protected events

Link: https://github.com/nostr-protocol/nips/pull/1030
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-09 10:14:58 -07:00
William Casarin 20a8773631 ratelimit: rename module to match filter name
less confusion

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-09 10:04:26 -07:00
William Casarin 4b5f67d473 readme: add optional indicator to filter docs
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-09 09:55:41 -07:00
William Casarin 784d32e327 readme: show pubkey config
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-09 09:55:07 -07:00
William Casarin 051be41c53 readme: fix filter header
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-09 09:54:22 -07:00
William Casarin 74c90453b8 filter: add whitelist filter
Fixes: https://github.com/damus-io/noteguard/issues/3
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-09 09:53:36 -07:00
William Casarin bae87107ae actually use pipeline config
Fixes: https://github.com/damus-io/noteguard/issues/4
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-09 09:48:24 -07:00
William Casarin e1fe57ea87 a few tweaks 2024-07-08 14:39:32 -07:00