- commit
- 61fa41e9033a4a27579cd4617de0d000876590c9
- parent
- 5fa7a165078c20aa1033b3e6c18771abbf210ada
- author
- Dami <dami.etoile@gmail.com>
| M | docs/ | 2 | +- |
| M | relay-templates/ | 5 | +++-- |
| M | relay-templates/ | 8 | ++++++-- |
| M | src/ | 2 | +- |
| M | test/ | 2 | +- |
@@ -73,7 +73,7 @@ Three features add bounded services beside the relay feed. **Sites** is on by de
7373 7474 ### Presets7575 76-Above the rules form, one button per preset applies a template from the repository's `relay-templates/` folder: writes, reads, the directory, the features, the kind rules and the keep-for rules together. Limits, identity, people and bans stay. **Default** is what a fresh claim has. **Outbox** is only you writing, anyone reading, private kinds refused. **Inbox** takes notes, replies, reactions, comments, reports and zaps from anyone and keeps them 90 days. **Private** is only you writing and only members reading, every kind, forever. **Chat** is the members-only group: private messages, chat and threads, directory hidden. Your own profile and lists always land, whatever the kind rules say. Names are cheap, so one name per role is the way to run all four.76+Above the rules form, one button per preset applies a template from the repository's `relay-templates/` folder: writes, reads, the directory, the features, the kind rules and the keep-for rules together. Limits, identity, people and bans stay. **Default** restores open writes and reads, a public directory, every kind and indefinite retention. It leaves feature settings alone, so applying it after **Quiet** keeps the features switched off. **Outbox** is only you writing, anyone reading, private kinds refused. **Inbox** takes notes, replies, reactions, comments, reports and zaps from anyone and keeps them 90 days. **Private** is only you writing and only members reading, every kind, forever. **Chat** is the members-only group: private messages, chat and threads, directory hidden. Your own profile and lists always land, whatever the kind rules say. Names are cheap, so one name per role is the way to run all four.7777 7878 Four more presets make single-purpose names: **Media** (members upload files; the only events accepted are profiles and Blossom server lists), **Search replica** (a read-only copy of another relay's searchable kinds, refreshed every six hours), **Articles** (long-form and profiles only, mirrored daily from a source if one is given) and **DM inbox** (anyone drops gift wraps, only members read). The replica presets take a source relay URL in the field next to the buttons; applying a preset again replaces the standing pull rather than adding one, and applying a preset with no source removes it. The pull appears in the Jobs table on the Data tab.7979 @@ -1,10 +1,11 @@
1-// The rules a fresh claim starts with.1+// A rules reset: open writes and reads, every kind, kept forever.2+// Omitted feature settings stay as they are, including after Quiet.23 {34 "$schema": "https://bind.ws/relay-config.schema.json",45 "format": "bind.ws/relay-config/2",56 "template": {67 "title": "Default",7- "about": "Anyone writes, anyone reads, every kind, kept forever. The rules a fresh claim starts with."8+ "about": "Anyone writes, anyone reads, every kind, kept forever. Feature settings stay as they are."89 },910 "policy": {1011 "writes": "open",@@ -7,7 +7,7 @@ copy as the start of your own.
77 88 | Template | Choose it when |99 |---|---|10-| [default](01-default.jsonc) | you want a plain relay: anyone writes, anyone reads, everything kept. What a fresh claim has. |10+| [default](01-default.jsonc) | you want a plain relay: anyone writes, anyone reads, everything kept. Feature settings stay as they are. |1111 | [outbox](02-outbox.jsonc) | it is where your own public notes and articles live, for the world to read. |1212 | [inbox](03-inbox.jsonc) | it is where people reach you: replies, reactions, zaps and reports, kept 90 days. |1313 | [private](04-private.jsonc) | only you write and only your devices or a trusted few read: drafts, wallets, app data. |@@ -31,7 +31,11 @@ A template is a relay configuration (`$schema` names the copy served at
3131 `template` block for the title and the blurb, and the rules sections only:3232 policy, kinds and retention. People, bans and addresses are never in a3333 template, and a section a template leaves out is left alone when it is34-applied. The number in the file name is the order the console shows them in.34+applied. Default resets the write, read, directory, kind and retention rules;35+it leaves feature settings alone. Applying Default after Quiet keeps the36+features switched off. It is a rules reset, not a full relay reset.37+38+The number in the file name is the order the console shows them in.3539 3640 `npm run build:templates` folds the folder into `src/gen/templates.ts`, which3741 the relay serves as its presets; `npm run typecheck` checks every file here@@ -6,7 +6,7 @@ export const TEMPLATES: { name: string; document: unknown }[] = [
66 "format": "bind.ws/relay-config/2",77 "template": {88 "title": "Default",9- "about": "Anyone writes, anyone reads, every kind, kept forever. The rules a fresh claim starts with."9+ "about": "Anyone writes, anyone reads, every kind, kept forever. Feature settings stay as they are."1010 },1111 "policy": {1212 "writes": "open",@@ -26,7 +26,7 @@ describe("presets", () => {
2626 expect((await rpc(host, owner, "listblockedkinds")).result).toEqual([...preset.block].sort((a, b) => a - b));2727 expect((await rpc(host, owner, "listretention")).result).toEqual(preset.retention);2828 }29- // Back to default leaves no rules behind.29+ // Default clears kind and retention rules; omitted feature settings stay.3030 await rpc(host, owner, "applypreset", "chat");3131 const d = await rpc(host, owner, "applypreset", "default");3232 expect(d.result.writes).toBe("open");