Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .changeset/import-escape-terminal-controls.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/keep-user-admission-and-vanish-state.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/nip05-pin-resolved-address.md

This file was deleted.

9 changes: 0 additions & 9 deletions .changeset/notification-response-size-cap.md

This file was deleted.

13 changes: 0 additions & 13 deletions .changeset/peering-invoice-queue-limit.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/settings-path-default-arrays.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/settings-path-index-bound.md

This file was deleted.

40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
# nostream

## 3.17.1

### Patch Changes

- [#1242](https://github.com/cameri/nostream/pull/1242) [`d41c9fc`](https://github.com/cameri/nostream/commit/d41c9fca14048839ac65ca5358488a6d8681efd9) Thanks [@Priyanshubhartistm](https://github.com/Priyanshubhartistm)! - fix(cli): show control characters in `nostream import` error messages as escapes

When a line of an import file could not be parsed, `nostream import` printed 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](https://github.com/cameri/nostream/pull/1284) [`7340237`](https://github.com/cameri/nostream/commit/73402379618e455e1d77f829091c206af0f1491d) Thanks [@chappie-daemon](https://github.com/chappie-daemon)! - fix(storage): stop invoices and vanish checks from overwriting a user's admission and vanish state

Creating an admission or subscription invoice upserted its pubkey with `is_admitted` and `is_vanished` set 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](https://github.com/cameri/nostream/pull/1278) [`85d0481`](https://github.com/cameri/nostream/commit/85d0481d5695164bad8e4db440ebdf5e26b31b62) Thanks [@chappie-daemon](https://github.com/chappie-daemon)! - fix(nip05): refuse a verification host that resolves to a private address

NIP-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::/10` added), a redirect to an IPv4 literal is checked against the same list, and the request ignores `HTTPS_PROXY` and `NODE_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](https://github.com/cameri/nostream/pull/1274) [`ddcaafd`](https://github.com/cameri/nostream/commit/ddcaafd00315c327ef1c521066a1c07ee84ef130) Thanks [@chappie-daemon](https://github.com/chappie-daemon)! - fix(notifications): never buffer the response a notification delivery gets back

A 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](https://github.com/cameri/nostream/issues/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 a `FAILED` row the outbox then retries. The request side stays unbounded on purpose, because a `settings.changed` envelope carries the changed values and a blacklist edit alone can produce a body past any small cap.

- [#1270](https://github.com/cameri/nostream/pull/1270) [`8ee4974`](https://github.com/cameri/nostream/commit/8ee49744ad992e83d1ae794e721432b7f38bac9d) Thanks [@Ferryx349](https://github.com/Ferryx349)! - fix(peering): bound the buyer invoice queue

A 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](https://github.com/cameri/nostream/pull/1279) [`0d07f6b`](https://github.com/cameri/nostream/commit/0d07f6b439dcc85540781da7ff9c8d410a74f5b9) Thanks [@chappie-daemon](https://github.com/chappie-daemon)! - fix(settings): keep the rest of a default array when one of its fields is set

An array in `settings.yaml` replaces the default array as a whole. With a `settings.yaml` that has no `payments.feeSchedules.admission`, `nostream config set payments.feeSchedules.admission[0].enabled true` (also what the TUI and the admin dashboard write) saved `admission: [{ enabled: true }]`, so the admission fee lost its default `amount` and whitelists. Setting `limits.event.content[1].maxLength` saved `[null, { maxLength }]`, which no longer validated once the relay read it back, and is refused since the out-of-range index fix. `PATCH /admin/settings` and `nostream config set` now copy the effective array into `settings.yaml` before writing the field, so the other entries and fields keep their values.

- [#1279](https://github.com/cameri/nostream/pull/1279) [`6fffd86`](https://github.com/cameri/nostream/commit/6fffd861f67324d7afed4d2e74ce2a62286e1d54) Thanks [@chappie-daemon](https://github.com/chappie-daemon)! - fix(settings): reject an out-of-range array index instead of filling the gap

Setting a path such as `dvm.workers[2000000000]` through `PATCH /admin/settings` or `nostream config set` grew 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 to `MAX_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 with `array[<length>]` work as before.

## 3.17.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nostream",
"version": "3.17.0",
"version": "3.17.1",
"packageManager": "pnpm@10.33.0",
"private": true,
"description": "A Nostr relay written in Typescript.",
Expand Down
Loading