clone

nostr relays on demand at <name>.bind.ws: claim one with your key, pay in zaps past the free allowance

relay-templates: the README is a catalog, one line per template on when to choose it, and the build fails when a file has no row

Dami committed 8ee3e8f
commit
8ee3e8f0fa3398cc3223fedb6e61d9e9cdfd0d7f
parent
1f64d5812d21b55c458bc995fb3e3d0b1d8e769b
author
Dami <dami.etoile@gmail.com>
2 files changed, +38 -8
Mrelay-templates/README.md39++++++++++++++++++++++++------
Mscripts/build/build-templates.mjs7+++++
M relay-templates/README.md +31 -8
@@ -1,18 +1,41 @@
11 # Relay templates22 3-One file per template, in the order the console shows them. Each is a relay4-configuration (`relay-config.schema.json`) with a `template` block for the5-title and the blurb, and the rules sections only: policy, kinds and6-retention. People, bans and addresses are never in a template, and a section7-a template leaves out is left alone when it is applied.3+A relay does not have to do everything. Names are cheap, so pick the template4+for the job and give each job its own name. The console offers these as5+presets, in this order; each is also a file you can apply from a script or6+copy as the start of your own.7+8+| Template | Choose it when |9+|---|---|10+| [default](01-default.jsonc) | you want a plain relay: anyone writes, anyone reads, everything kept. What a fresh claim has. |11+| [outbox](02-outbox.jsonc) | it is where your own public notes and articles live, for the world to read. |12+| [inbox](03-inbox.jsonc) | it is where people reach you: replies, reactions, zaps and reports, kept 90 days. |13+| [private](04-private.jsonc) | only you write and only your devices or a trusted few read: drafts, wallets, app data. |14+| [chat](05-chat.jsonc) | a group of members talks here: messages and the group's chat, directory hidden. |15+| [media](06-media.jsonc) | it is a file host and nothing else: members upload, anyone fetches. |16+| [search](07-search.jsonc) | you want a searchable copy of another relay's prose, refreshed every six hours. Needs a source. |17+| [articles](08-articles.jsonc) | long-form only, yours or mirrored daily from a source. |18+| [dm](09-dm.jsonc) | it is a drop box for private messages: anyone leaves a gift wrap, only members read. |19+| [quiet](10-quiet.jsonc) | it should cost nothing and announce nothing: members only, every optional feature off, switched on one at a time as needed. |20+21+Each file says more in its comment: what the template does, which Haven relay22+it mirrors, and why its kinds are what they are.23+24+## The files25+26+A template is a relay configuration (`../relay-config.schema.json`) with a27+`template` block for the title and the blurb, and the rules sections only:28+policy, kinds and retention. People, bans and addresses are never in a29+template, and a section a template leaves out is left alone when it is30+applied. The number in the file name is the order the console shows them in.831 932 `npm run build:templates` folds the folder into `src/gen/templates.ts`, which1033 the relay serves as its presets; `npm run typecheck` checks every file here11-against the schema and the relay's parser, and fails when the generated12-module is stale.34+against the schema and the relay's parser, fails when the generated module35+is stale, and fails when a file is missing from the table above.1336 1437 To try one on a relay without applying it:1538 1639 ```17-node scripts/ops/relay.mjs plan relay-templates/10-quiet.jsonc wss://<name>.bind.ws40+node ../scripts/ops/relay.mjs plan 10-quiet.jsonc wss://<name>.bind.ws1841 ```
M scripts/build/build-templates.mjs +7 -0