- commit
- fd0845a273e6a4397a050a221af56c0a6e9543cb
- parent
- bd5b2a707d259af61c49da3bc7522a257015180f
- author
- Dami <dami.etoile@gmail.com>
| M | docs/ | 8 | -------- |
| M | docs/ | 2 | -- |
| M | docs/ | 11 | +++++++++-- |
@@ -67,19 +67,12 @@ Name, description, icon and contact appear in your relay's public information do
6767 6868 Banner is a wide image for the same document. Posting policy and privacy policy are links to pages you host elsewhere; both must be https. Tags, languages and countries are short lists that tell relay directories what the relay is about: topic words, language codes such as `en` or `pt-BR`, and two-letter country codes.6969 70-7170 **Your own domain** puts the relay under a hostname you control. Add the hostname; the relay registers it with the host's Cloudflare zone and shows the CNAME to create at your DNS, plus an optional TXT record that activates the hostname before you switch the CNAME. **Check** asks where it stands: the hostname is live when both the hostname and its certificate read active. **Remove** deletes the hostname and its certificate. At most three per relay. Domains are not part of the exported configuration, because they belong to this relay instance rather than to its rules.7271 73-74-75-76-7772 ### Tell your clients7873 7974 One row per list that names relays: relay list (kind 10002), DM inbox (10050), search relays (10007), Blossom servers (10063). **Check** looks for your newest copy here and on the indexers. **Add me** merges this relay into it and publishes the signed result here, to the relays the list names and to the indexers; the row shows which accepted it. **Remove me** does the reverse. Lists are never rebuilt from scratch, so what you had stays.8075 81-82-8376 ## Data8477 8578 What is here, what moves, and what leaves.@@ -93,7 +86,6 @@ What is here, what moves, and what leaves.
9386 - **Jobs** is work the relay does on its own, one round at a time, so it survives the relay sleeping. The table lists each job with its relays, filter, schedule and last result, with run-now and remove. Three forms add jobs. **Pull** copies what another relay has and this one lacks, by NIP-77 sync; running it again fetches only what is new, files come along from relays on this host, and with an interval it is a standing mirror. **Fetch my history** pulls the owner's own events from the relays in their kind 10002 stored here, or from a given list. **Rebroadcast** forwards events matching kinds and a day window to a list of relays, walking the store with a cursor so a standing rebroadcast forwards only what arrived since. Bans and kind rules apply to what arrives; the write rule does not. The other relay has to let anyone read, or write. Events that only their author may publish are never rebroadcast, and a members-only relay never rebroadcasts private kinds. Standing jobs run every hour, six hours or day, five at most. Jobs spend awake time, which fuel counts.9487 9588 - **Dumps** writes every event as one JSONL file to storage, daily or weekly, and keeps the newest few (seven by default). **Dump now** writes one on the spot. Each file lists its event count and size, with download and delete. Downloading is a signed request; the files are never public. Dumps count as files for fuel.96-- **Pull from a relay** copies what another relay has and this one lacks, by NIP-77 sync. It runs in the background and the line under it follows along. Running it again fetches only what is new. Files come along from relays on this host. Bans and kind rules apply to what arrives; the write rule does not. The other relay has to let anyone read.9789 9890 - **Fork this relay** leases a new name, copies this relay into it and reserves the claim for a key. Choose a name or take a memorable one, choose who claims it (you by default, or an npub), what to copy (everything, only your events, or a list of kinds) and whether the people come along. The result is the new console URL to hand over; the new name expires like any lease unless it is claimed. One fork an hour.9991 @@ -24,8 +24,6 @@ Traffic in and out is free and not counted. The console shows it so you can see
2424 2525 Dumps, the JSONL files the Data tab can write on a schedule, live next to uploaded files and count as files stored.2626 27-**Time awake** is how long the relay is in memory. It sleeps between messages and wakes when one arrives, so a relay nobody uses is awake for zero hours. A relay with a client connected all day is awake only while messages pass, plus a few seconds after each.28-2927 **Rows written** is database work. A note costs a few rows. Reactions and other small events cost about the same.3028 3129 ## Prices past the allowance@@ -18,7 +18,14 @@ src/
1818 settings.ts policy, members, bans, kind rules, retention, export/import1919 roles.ts who may do what: owner, moderator; one table for NIP-86 and NIP-292020 groups.ts NIP-29, one group per relay: joins, leaves, moderation events21+ presets.ts rule bundles, one click each, some with a standing pull2122 manage.ts NIP-86 methods over NIP-9823+ domains.ts custom hostnames: the Cloudflare client and the KV mapping24+ dumps.ts scheduled JSONL dumps to R225+ notify.ts NIP-17 messages from the relay to its owner26+ pages.ts notes and articles as pages, the Atom feed27+ card.ts the status card, signed and as SVG28+ qr.ts a QR encoder for the card and the console2229 fuel.ts meters, prices, receipts, LNURL2330 identity.ts relay keypair and NIP-43 roster2431 blossom.ts BUD-01/02/04/06/08/09 on R2@@ -33,7 +40,7 @@ src/
3340 landing.ts the apex, rendered from config3441 ui.ts the shared look3542 test/36- relay.test.ts fuel.test.ts adopt.test.ts lease.test.ts groups.test.ts nip11.test.ts nip43.test.ts Durable Object tests in workerd43+ *.test.ts Durable Object tests in workerd, one file per feature3744 conformance/ black-box suite for any relay URL3845 scripts/3946 dev-signer.mjs seed.mjs junk.mjs zaptest.mjs shot.mjs@@ -58,7 +65,7 @@ CI runs typecheck and the object tests on every push and pull request. `main` on
5865 5966 ## Add a management method6067 61-1. Add the name to `METHODS` in `src/manage.ts`.68+1. Add the name to `METHODS` in `src/manage.ts` and the action it needs to `METHOD_ACTIONS` in `src/roles.ts`; a method without an action is refused for everyone.6269 2. Add a `case` in the switch. Use `num(i)` and `str(i)` for parameters. Return `reply({ result })` or `reply({ error }, 400)`.6370 3. If it changes state that other code caches, update `Settings` and its in-memory sets.6471 4. If the console should call it, add the control to `dashboard.ts` and a handler in its script.