Add strfry policies for the public submission relay and approved sync #267

Merged
raucao merged 4 commits from feature/submission_relay into master 2026-11-18 10:00:17 +00:00
4 Commits
Author SHA1 Message Date
raucao 023f5b39bf Fix strfry README and drop deployment specifics
CI / Test (pull_request) Successful in 43s
Release Drafter / Update release notes draft (pull_request) Successful in 3s
The new README described the directory as mostly Node ESM and called the
pre-existing Deno policies "legacy", even though ldap-policy.ts is a shared
module reused by the new member bridge and strfry-policy.ts is the members
relay's current write policy. It also baked in internal deployment details
(Chef, strfry-1, /etc/*.conf paths, the staging relay's ZeroTier IP).

Document every file with its correct runtime (Deno vs Node 24 LTS), drop the
"legacy" label, and genericize the deployment examples. Cross-link the README
from docs/dev/nostr.md, and replace the remaining internal host/IP references
in sync-policy.mjs and its test with neutral placeholders.
2026-11-18 13:51:48 +04:00
raucao 30ca91797e Make sync-policy source-verification only
CI / Test (pull_request) Successful in 42s
Drop the kind allowlist and event well-formedness checks from the
approved-content sync policy; content gating lives in the other
policies. The policy now only verifies type, sourceType, and
sourceInfo against STAGING_RELAY_URL.
2026-11-18 09:52:24 +04:00
raucao d2f410ad42 Add LDAP-only strfry policy for the member bridge
CI / Test (pull_request) Successful in 47s
The member bridge on the production relay is a strfry router stream group (dir = "down") that subscribes to the local submission relay and writes member-authored events into the production database. This policy is its pluginDown: it reuses ldap-policy.ts and accepts an event only when its author is an LDAP member (or a whitelisted pubkey).

Unlike strfry-policy.ts it does no hellthread/anti-duplication work and opens no Deno KV store, so it runs alongside the relay's own policy process without shared state.

Refs raucao/marco#97, kosmos/chef#705.
2026-11-18 00:31:39 +04:00
raucao 242577a6f6 Add strfry policies for the public submission relay and approved sync
CI / Test (pull_request) Successful in 49s
Adds the Node write policies used by the new public submission relay and by
the approved-content sync on the members relay, for raucao/marco#97.

submission-policy.mjs keeps the submission relay open to all authors while
applying the usual gates: a kind allowlist, content and tag bounds, per-IP and
per-author token buckets, a short-window content dedupe, and a hellthread
limit. It does not do membership checks or media analysis.

sync-policy.mjs is fail-closed: it accepts only events that arrived through
strfry sync from the exact staging relay URL, with an allowed kind. Everything
else, including a wrong source type or an unset STAGING_RELAY_URL, is rejected
and logged with observed-vs-expected source information.

Includes node:test coverage for both policies and a README documenting the
environment variables and how strfry invokes them. The existing Deno policies
are untouched.

Note: chef fetches these files from the live branch, so master must be merged
into live before the submission relay or approved sync is converged.
2026-11-17 14:12:19 +04:00