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.
2.1 KiB
Nostr
strfry
The extras/strfry directory contains code to integrate strfry with
akkounts, so that notes published to the relay have to be authored by (or in
some cases just related to) local users who have verified their Nostr public
key.
It holds both Deno policies (the members relay's write policy, the member
bridge, and the manual sync tool — described below) and plain Node ESM policies
for the public submission relay and the approved-content sync. See
extras/strfry/README.md for details on the policies and their environment
variables.
Requirements
Deno needs to be installed on the machine that you run strfry on.
We provide a Docker image with recent strfry and Deno builds:
https://gitea.kosmos.org/kosmos/-/packages/container/strfry-deno/
Configuration
You can use either environment variables (see e.g. the strfry service in
docker-compose-yml) or a local .env file in the same working directory
that you place the extra files in (e.g. /opt/strfry).
In your strfry.conf, configure strfry-policy.ts as the write policy, like so:
writePolicy {
plugin = "/opt/strfry/strfry-policy.ts"
}
All dependencies will be downloaded and cached automatically when the plugin is called for the first time.
Manual tasks
You can sync all notes authored by local users (any account that has verified their Nostr pubkey with akkounts) from a remote strfry relay via negentropy sync:
deno run -A /opt/strfry/strfry-sync.ts wss://nostr.kosmos.org
Or, in the running container when using Docker Compose:
docker compose exec strfry deno run -A /opt/strfry/strfry-sync.ts wss://nostr.kosmos.org
The strfry service container also exposes the local relay on your local host
on port 4777.
nak is a helpful tool for manual Nostr tasks. Here's how you can grab a note by its event ID from a remote relay and publish it to your local strfry for example:
nak req -i 0fb010192685b86b0810b3de3706fbbf3b8c1db30b14533094a2b9700c820cdc nostr.kosmos.org | nak event ws://localhost:4777