Repository navigation
Releases
nostream@3.17.1
Patch Changes
-
#1242
d41c9fcThanks @Priyanshubhartistm! - fix(cli): show control characters innostream importerror messages as escapesWhen a line of an import file could not be parsed,
nostream importprinted the parser's message as it is, and that message quotes part of the file. A file with a terminal escape sequence in a malformed record could therefore change the operator's display or, where the terminal allows it, replace the clipboard. The per-line errors, the failure message and an error that quotes the input path (for example a file that does not exist) now show control characters as visible escapes (for example\x1b), so the context stays readable and nothing is sent to the terminal. -
#1284
7340237Thanks @chappie-daemon! - fix(storage): stop invoices and vanish checks from overwriting a user's admission and vanish stateCreating an admission or subscription invoice upserted its pubkey with
is_admittedandis_vanishedset to false, so it cleared both for an existing user. A renewal invoice, including the ones the relay creates itself, took a paying subscriber's admission away, so their events were refused once the admission cache expired, and an invoice anyone could request for a vanished pubkey lifted its request to vanish. An existing row now keeps the admission, vanish and terms fields the caller did not supply, and a new row created without a vanish state starts vanished when a request to vanish for the pubkey is stored. The vanish check for a pubkey without a row no longer overwrites a row another writer created in the meantime and returns that row's state. Both look for the stored request on the primary instead of a replica that may not have it yet. A deliberate limit: any undeleted stored request to vanish counts, as it already did when a user's first event created the row, so one that names only another relay also starts a new row vanished. -
#1278
85d0481Thanks @chappie-daemon! - fix(nip05): refuse a verification host that resolves to a private addressNIP-05 verification fetched the domain from an author's kind-0 profile but only checked the text of a redirect URL, so a domain whose DNS points at loopback, a private network or a cloud metadata address was still fetched, on the first request and on its redirect. Each host is now resolved and refused before connecting when any of its addresses is on the private-address blocklist the NIP-11 probe already used (now shared, with
fec0::/10added), a redirect to an IPv4 literal is checked against the same list, and the request ignoresHTTPS_PROXYandNODE_USE_ENV_PROXY, because a proxy would resolve the name itself and skip the check. A deliberate limit: a relay that reaches the internet only through a proxy can no longer verify NIP-05 identifiers. -
#1274
ddcaafdThanks @chappie-daemon! - fix(notifications): never buffer the response a notification delivery gets backA delivery is a POST whose only interesting part is the status code, but axios advertised every encoding it can decode, decompressed whatever a receiver sent back and buffered the whole result while nothing read it. A receiver answering with a small gzip body that decodes to hundreds of megabytes therefore spent the delivery worker's heap for a value nobody consumed (security issue #1257).
Deliveries now ask for
accept-encoding: identity, take the response as a stream so no body is buffered or parsed at all, and drain at most 8 KiB of it before dropping the socket. Success is the status and only the status: no response size can turn a notification the receiver accepted into aFAILEDrow the outbox then retries. The request side stays unbounded on purpose, because asettings.changedenvelope carries the changed values and a blacklist edit alone can produce a body past any small cap. -
#1270
8ee4974Thanks @Ferryx349! - fix(peering): bound the buyer invoice queueA slow wallet can no longer let a peer grow the queued kind-402 invoice promise
chain without limit. The queue is capped at 100 events or 2 MiB; exceeding
either closes the peering connection and reconnects. Pending events are
discarded on reconnect and only one wallet call can remain in flight. The
handshake barrier is a fixed sequence, so later invoices cannot postpone the
live feed, and its waiter is released when the connection closes. Invoice
dedupe and the seller's re-issued open invoice make the reconnect safe. -
#1279
0d07f6bThanks @chappie-daemon! - fix(settings): keep the rest of a default array when one of its fields is setAn array in
settings.yamlreplaces the default array as a whole. With asettings.yamlthat has nopayments.feeSchedules.admission,nostream config set payments.feeSchedules.admission[0].enabled true(also what the TUI and the admin dashboard write) savedadmission: [{ enabled: true }], so the admission fee lost its defaultamountand whitelists. Settinglimits.event.content[1].maxLengthsaved[null, { maxLength }], which no longer validated once the relay read it back, and is refused since the out-of-range index fix.PATCH /admin/settingsandnostream config setnow copy the effective array intosettings.yamlbefore writing the field, so the other entries and fields keep their values. -
#1279
6fffd86Thanks @chappie-daemon! - fix(settings): reject an out-of-range array index instead of filling the gapSetting a path such as
dvm.workers[2000000000]throughPATCH /admin/settingsornostream config setgrew the array one element at a time up to that index, inside the request and before the value was validated. A single request could hold the settings lock and fill the heap for as long as that took. A path may now name an array index only up toMAX_SETTINGS_PATH_INDEX(10,000), checked with the other path checks before the settings are read. Inside the array, a write must target an index that already exists or append one element at the end. Anything else is refused: the admin API answers with a 400 and a validation issue on the path, and the CLI prints the error. Updating an existing index and appending witharray[<length>]work as before.
nostream@3.17.0
Minor Changes
-
#1199
cce55b6Thanks @Priyanshubhartistm! - feat(nip43): publish the kind 13534 membership listWith the new
nip43.publishMembershipListsetting (off by default) the relay publishes a replaceable kind 13534 event, signed by its own key, with the NIP-70-tag and onemembertag per admitted pubkey, and refreshes it after every successful join or leave, and when a member's request to vanish is accepted, so that pubkey is taken out of it. Joins and leaves that are rejected or change nothing do not refresh it. Nothing is published wheninfo.selfdoes not match the relay's signing pubkey, since NIP-43 requires that signer. The list makes every member's pubkey public to anyone who can read the relay, which is why the setting defaults to off. It is a convenience for clients, not the source of truth for who may publish, and it holds at most the first 10,000 members. Users who asked to vanish are left out. Admissions made another way, for example a paid admission, do not refresh it. -
#1216
36ce4d5Thanks @Ferryx349! - feat(peering): show relationship state, terms and traffic split in adminThe Peering console now shows each peer's relationship state and current terms,
reconciliation and peer-request activity, and the existing budget and
held-invoice panels in one place. Relationship state follows the same access
window as the relay, so an ended period no longer appears active. -
#1169
cbc9c1dThanks @Ferryx349! - feat(peering): surface buyer invoices and budgets in the admin consoleWatches the peer's signed kind 402 invoice stream over the authenticated sync
connection, pays through LNbits or NWC, and exposes held invoices with
operator approve/reject actions, budget spend/remaining, and invoice counts. -
#1167
be2aba4Thanks @Ferryx349! - feat(peering): add the buyer invoice ledger and budget primitivesAdds the storage and decoding foundation for buying peering: a
peering_invoicesledger deduped by BOLT11 payment hash, per-peer/global
peering_budgetscounters, a narrow BOLT11 decoder, and the buyer settings
contracts. Automatic payment and admin approval ship in the follow-up slices. -
#1168
9c5917dThanks @Ferryx349! - feat(peering): enforce buyer budgets before paying peer invoicesAdds the buying-side policy: verify a peer invoice against its advertised
NIP-11 term, dedupe on the payment hash, reserve per-peer and global budget
counters atomically, pay through the configured wallet, and hold anything
outside the envelope for operator approval. -
#1233
7bbf889Thanks @Ferryx349! - feat(peering): add owner-attested peering requestsPeers can present a one-time, owner-signed request over their authenticated
NIP-42 connection. The receiving relay verifies the owner signature, the AUTH
relay key, the requested scopes, the current terms snapshot and NIP-13
proof-of-work, stores the accepted attestation, and returns a relay-signed
acceptance. Operators chooserequired,preferredorwaived; configured
peers keep working without proof-of-work by default.nostream peering request
produces and sends the request using an owner key supplied outside settings.
Operational traffic never requires the owner's key.
Patch Changes
-
#1234
bef8c4aThanks @Priyanshubhartistm! - fix(admin): record a logout in the audit history only when it ends a sessionPOST /admin/logoutis public, because it has to clear the session cookie whoever sends the request, and it wrote anadmin.logoutrecord to the audit history for every request, with or without a session. Anyone who could reach the admin routes could post to it repeatedly and fill the shared, size-limited audit history in Redis with logouts that never happened, pushing real administrator records out of it. The record is now written only by the logout that ends a session: a request with a valid session (as a cookie or a Bearer token) whose session had not been revoked yet. Revoking a session now tells the caller whether it was this call that did it, in one atomic step, so a copy of a token that was already logged out, or several logouts of the same session at once, write nothing more. Every such request still gets the cookie cleared and a 200. -
#1231
593ad2dThanks @Priyanshubhartistm! - fix(admin): the settings API cannot change the admin password hash through a parent pathPATCH /admin/settingsrefused a change toadmin.passwordHash, but it only looked at the path of the request. A request for the pathadminwith a newadminobject, alone or inside a batch of changes, replaced the object and so wrote or removedadmin.passwordHashwithout being refused. Anyone holding a valid admin session, or a copy of its token, could set a password hash they chose, or delete it, without knowing the current password, and the change outlived the session. The API now compares every write-protected value in the settings it is about to save with the stored ones and refuses the whole request when one differs (changed, added or removed), whichever path or batch caused it. Replacing theadminobject with the same hash in it, and changing any other admin setting, still work. -
#1200
49dd6f8Thanks @Priyanshubhartistm! - fix(cli): do not shadow settings.json with the defaultsnostream startandnostream setupcopy the default settings to.nostr/settings.yamlwhen that file is missing. The relay readssettings.yamlfirst and falls back to the deprecatedsettings.jsononly when there is no yaml, so on a deployment that still had only asettings.jsonthe copy replaced every override in it with the defaults: an admission policy such asnip43.enabled, payment settings and limits stopped applying, silently. The defaults are now copied only when neither file exists, so asettings.jsonkeeps working until the admin console ornostream configwrites asettings.yaml. -
#1236
1ab0404Thanks @Priyanshubhartistm! - fix(cli): keep the .env file private to its ownernostream setupandnostream config env setwrote.envwith the default file mode, which under the usual umask makes it readable by every local account that can reach the project directory. The file holdsSECRET, which signs the admin session tokens, and other credentials. The CLI now creates.envreadable by its owner only (mode 0600), including when it starts from.env.example, and restricts an existing.envto the owner whenever it writes to it. An existing.envthat setup does not need to change is left as it is. Where the permissions cannot be changed, for example on a file system without Unix permissions, the write still succeeds. -
#1237
65d5455Thanks @Priyanshubhartistm! - fix(cli): mask DB_URI and REDIS_URI innostream config envoutputnostream config env listandconfig env gethide the value of secret keys unless--show-secretsis given, but they only recognised keys with SECRET, PASSWORD, API_KEY or PRIVATE_KEY in the name.DB_URIandREDIS_URIcan carry a password (postgresql://user:password@host/db), so it was printed as it was. These two keys are now masked like the other secrets, and shown in full with--show-secrets. -
#1239
baa1c81Thanks @Priyanshubhartistm! - fix(cli): show control characters innostream infooutput as escapesnostream infoprinted the relay name, URL and other settings values as they are. These can be changed through the admin settings, so a value containing a newline or terminal escape sequence could add forged lines to the output or send commands to the operator's terminal, such as replacing the clipboard where the terminal allows it. The text output now shows control characters as visible escapes (for example\x0a).nostream info --jsonis unchanged. -
#1160 [
1267cec](1267cec935fac56b325...
nostream@3.16.0
Minor Changes
-
#1088
e1f92adThanks @Ferryx349! - feat(peering): deliver paid peering invoices and gate peer feedsConfigured peers can request their BOLT11 invoice as a signed
kind 402event
and pay it through Relay B's existing processor. FeedREQ,COUNTand NIP-77
requests are refused with a payment-required reason until a paid period is
active. Expired invoices are reissued after a cooldown, and a missed webhook is
rechecked before access is denied. -
#1087
1d5c473Thanks @Ferryx349! - feat(peering): add the paid peering billing ledger -
#1089
15de73aThanks @Ferryx349! - feat(peering): renew, lapse and expose paid peering accessThe billing worker now issues renewal invoices before a period ends, rechecks
pending payments before lapsing a peer, closes live peer sockets on lapse, and
keeps stored events and sync state for a later resume.GET /admin/peeringand
the dashboard show billing status, access end, the open invoice and the last
processor error. NEG-MSG rechecks paid access so an open NIP-77 session cannot
keep syncing after the paid period ends.
Patch Changes
-
#1145
afb381fThanks @Priyanshubhartistm! - fix(admin): revoke the session token at logout, not only its cookiePOST /admin/logoutdeleted the browser cookie but the session token itself stayed valid until it expired (24 hours by default), because the token was only<expiresAt>.<signature>and nothing on the server recorded a logout. A copy of the token kept elsewhere (aBearerclient, a log, a proxy) could restore administrator access after sign-out. The token now carries a random session id under the same signature, logout records that id in Redis until the token would have expired, and every admin request checks it, so a logout on one worker ends the session on all of them and ends only that session. If Redis cannot be read the token is refused, and a logout that cannot record the id answers 500 (and still clears the cookie).Tokens issued before this change have no session id and are refused, so every administrator signs in once more after the upgrade.
-
#1091
6b3db4dThanks @Priyanshubhartistm! - fix(cli): reject a SECRET that cannot be saved to .env and read back unchanged -
#1156
69197f7Thanks @Priyanshubhartistm! - fix(logging): do not write credential headers to debug logsDebug logging of incoming requests printed every header, so the admin session cookie, an
Authorizationbearer token, API keys and webhook signatures could be read from the logs and reused. The rate-limit middleware, the WebSocket connection log and the four payment callback controllers now log the headers with the value of every credential-bearing header replaced by[redacted]. -
#1157
8e90d9eThanks @Priyanshubhartistm! - fix(settings): reload settings when either settings.yaml or settings.json changesA worker watched only the settings file whose extension existed when it started. The loader reads
settings.yamlfirst and falls back to the deprecatedsettings.json, and the admin console and the CLI always writesettings.yaml, so a worker that started fromsettings.jsonnever reloaded after the yaml file was written. A change such as removing a pubkey from the NIP-98 admin allowlist stayed unseen by that worker until it restarted. The watcher now reloads on a change to either file. -
#1118
5c4b4f0Thanks @Ferryx349! - fix(admin): serialize every settings-file writer with the settings write lockThe lock records its owner hostname and refreshes a heartbeat, so a relay in a
container no longer steals a live CLI lock just because the host PID does not
exist in its own PID namespace. On the same host the lock checks the owner's
process start time, so a reused PID is reclaimed without ever evicting a slow
writer, and async writers keep the lock until they settle.
nostream@3.15.3
Patch Changes
-
#1130
ef017e5Thanks @dependabot! - chore(deps): bump astro from 7.4.4 to 7.4.7 -
#1092
508d8c1Thanks @Priyanshubhartistm! - fix(payments): a payment for a cheaper plan no longer downgrades a pubkey whose dearer plan is still running
nostream@3.15.2
Patch Changes
-
#1072
81edd16Thanks @chappie-daemon! - test(relay): add non-sequential socket test suite for connection and command racesAdds deterministic real-socket test cases covering racing connection states:
- Reconnect storm with immediate REQ on the open tick across multiple concurrent sockets
- Pipelined commands in a single write buffer preserving arrival order
- REQ immediately followed by CLOSE of the same subscription ID
- EVENT sent on open tick
- Binary-framed JSON commands
- Socket resilience and valid command processing following malformed JSON
nostream@3.15.1
Patch Changes
- #1075
4b4b247Thanks @chappie-daemon! - Admission now runs inside a serializable transaction.admit_user()opens withPERFORM ASSERT_SERIALIZED(), so calling it on the default read-committed connection raisedSN_NOT_SERIALIZABLEand every NIP-43 join request failed. A caller that supplies its own client (the payments path) still runs inside the transaction it passes.
nostream@3.15.0
Minor Changes
-
#1068
d6b98abThanks @aikido-autofix! - feat(web): set security headers on every web responseThe web app now sends
Strict-Transport-Security,X-Content-Type-Options: nosniff,X-Frame-Options: SAMEORIGIN,Referrer-Policy,X-DNS-Prefetch-Control,X-Permitted-Cross-Domain-Policiesand the cross-origin isolation headers through Helmet.The app's own nonce-based
Content-Security-Policyremains the single CSP on a response: Helmet's default policy is disabled, because a second CSP would intersect with the app's and block the nonce'd inline scripts the dashboard uses. Embedding the web UI in another origin is now refused byX-Frame-Options; the dashboard's own Grafana frame is unaffected.
Patch Changes
-
#1067
0832ffdThanks @Ferryx349! - fix(payments): accept LNbits 1.x callback bodiesLNbits 1.x sends the payment object as a JSON string inside the webhook body.
The callback route now allows a top-level JSON string, the controller parses it
before validation, and the body schema accepts and strips LNbits' extra payment
fields while still requiring a validpayment_hash.Non-JSON string bodies still return
400 Malformed body; the HMAC query check
and the invoice lookup from LNbits remain unchanged.
nostream@3.14.0
Minor Changes
-
#1059
dfcc967Thanks @Ferryx349! - feat(admin): account for peer on-demand requestsRecords on-demand
REQ,COUNT, andNEG-OPENrequests and the events served
for each authenticated peer pubkey in Redis. The admin console's Peering table
shows the request and event-served counts per peer, and the diagnostics export
includes the same counters. Accounting is best-effort and never fails the
request it describes.
nostream@3.13.0
Minor Changes
-
#1053
e37b284Thanks @Ferryx349! - feat(peering): rate-limit on-demand requests from authenticated peersAuthenticated peers can request events outside their standing feed with a
normalREQ,COUNT, or ad-hocNEG-OPENsession. Those requests continue to
use peer subscription and NIP-77 limits instead of client limits, and are now
bounded per peer pubkey bylimits.peer.request.rateLimits(default 300
requests/minute acrossREQ,COUNT, andNEG-OPEN).Refused
REQ/COUNTcalls receiveCLOSEDwith arate-limited:reason and
retry hint; refusedNEG-OPENsessions receiveNEG-ERR. The limiter fails
closed when its store is unavailable, and unidentified clients are unaffected.
Per-peer request/event accounting and admin-console visibility are left to the
dedicated admin-console follow-up.
Patch Changes
-
#1058
ba8691aThanks @avantikonde! - fix(cli): reject placeholder secret inherited from env or prompt in setup (#1018)Setup now rejects the default placeholder secret (
change_me_to_something_long_and_random) when read from inherited environment variables or interactive prompt input, and validates the resolved secret before persisting to.env. If a placeholder is detected, setup automatically generates a fresh cryptographically secure 64-byte random hex secret.
nostream-website@1.3.5
Patch Changes
-
#1062
5d5b5b1Thanks @chappie-daemon! - perf(website): size the hero poster to the box it paints inhero-poster.webpwas encoded at 1920×1080 for a boxHero.astrocaps at
1180×664 CSS px (min(1180px, 80vw, film-h * 16/9)), which Lighthouse's
image-delivery-insightreported as 36.9 KiB of waste on
ema.tnsor.network(#876).
The poster now encodes at 1440×810 — 1.22× that box, enough for a 1.25×
display, so it needs nodevicePixelRatiobranch — and drops from 42,926 B
to 30,878 B, a 28% reduction. SSIM against the old file at the display size
is 0.9968 at 1180×664 and 0.9964 at the larger 1359×764 layout #876 measured.The social preview is unaffected:
og:imagedefaults to the generated
social-card.pngat 1200×630 inbuild-social-card.mjs, and the hero poster
has no second consumer.scripts/build-media.mjsresizes to 1440 so the next
pnpm run mediakeeps the size instead of restoring 1920. -
#1063
771f53eThanks @chappie-daemon! - docs(website): lead with what the relay gives you, not its languageThe default meta description and the footer still introduced nostream as "a
Nostr relay written in TypeScript", which describes the implementation and not
the thing a reader gets. The<title>, theog:image:altand the repository
description already lead with owning a relay in a social network nobody can
switch off; the two stragglers now match them.The description feeds
meta[name=description],og:descriptionand
twitter:description, so the link preview changes with it. The technical
substance — PostgreSQL + Redis, Lightning admission, Tor and I2P, admin
console — is unchanged.