Skip to content
Open
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
4 changes: 0 additions & 4 deletions .changeset/docs-setup-pg-version-check.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/hidden-content-cache-start-always.md

This file was deleted.

11 changes: 0 additions & 11 deletions .changeset/index-tag-filter-matching.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/nip05-verify-through-pinned-proxy.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/settings-notification-redact-nested-urls.md

This file was deleted.

4 changes: 0 additions & 4 deletions .changeset/v3-v4-schedule.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/wot-bound-graph-rebuilds.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/wot-graph-votes-and-settings-key.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/wot-lowercase-follow-pubkeys.md

This file was deleted.

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

## 3.18.0

### Minor Changes

- [#1341](https://github.com/cameri/nostream/pull/1341) [`21ddb8e`](https://github.com/cameri/nostream/commit/21ddb8e59eca732250b42d701396bd687e4b4d4f) Thanks [@Priyanshubhartistm](https://github.com/Priyanshubhartistm)! - feat(nip05): verify through an egress proxy by pinning the address that was checked (`nip05.proxy`)

NIP-05 verification connects directly and ignores `HTTPS_PROXY`, because a proxy resolves the host name itself and so skips the check that refuses private addresses. A relay that reaches the internet only through an egress proxy could therefore not verify NIP-05 identifiers at all. The new setting `nip05.proxy` (`disabled`, the default, or `pin`) gives that relay a way back. With `pin`, the relay sends the requests through the proxy in `HTTPS_PROXY`, but resolves the host itself, refuses a private, loopback or link-local address before the proxy is contacted, and asks the proxy for `CONNECT <address>:443` with the address it checked. TLS runs through the tunnel with the host name as `servername`, so the certificate is still checked against the host. A redirect target goes through the same steps. A proxy that refuses the `CONNECT` makes the verification fail with a reason naming the proxy and the host. With the setting absent or `disabled`, nothing changes.

### Patch Changes

- [#1241](https://github.com/cameri/nostream/pull/1241) [`3ac2880`](https://github.com/cameri/nostream/commit/3ac28808e46f3ec32b4991c4cda1924327c5675f) Thanks [@Priyanshubhartistm](https://github.com/Priyanshubhartistm)! - fix(nip56): start the hidden-content cache on every worker, not only when reporting is on at boot

A worker started the cache of hidden report targets only if `nip56.enabled` was true when it booted. On a relay that turned reporting and `hideActionableReports` on later, through a settings reload or a backup restore, the live-delivery check was active but the cache stayed empty, so reported pubkeys and events were still sent to open subscriptions until the next restart. The cache now starts on every worker. Each tick still reads the settings first and queries the database only while `hideActionableReports` is on, so a relay that does not use reporting pays no database cost.

- [#1287](https://github.com/cameri/nostream/pull/1287) [`4925f70`](https://github.com/cameri/nostream/commit/4925f702ec68dc559dadab75bda0f2b4991afe0c) Thanks [@chappie-daemon](https://github.com/chappie-daemon)! - fix(relay): index tag filters instead of comparing every tag with every value

Matching an event against a `#<letter>` filter compared every tag of the event with every value of the filter, and the live broadcast rebuilt each subscription's matcher for every event. One event could therefore cost tags × values comparisons per filter on the worker's event loop, with both sides chosen by clients (security issue [#1256](https://github.com/cameri/nostream/issues/1256)).

A REQ's filters are now compiled once for live delivery and once for its stored events, not per event. An event's single-letter tag values are indexed once and shared by every filter and client of a broadcast. Each tag name then costs set lookups on the smaller side, plus one binary search per `#g` prefix over values sorted once per event. A tag with no value is now skipped; before, it made `#g` prefix filters throw, which cut the broadcast short and stopped a REQ's stored events before `EOSE`.

A deliberate limit: this adds no per-connection allowance; `maxSubscriptions`, `maxFilters` and `maxFilterValues` still govern admission. `ids`, `authors` and NIP-50 `search` matching are unchanged.

- [#1295](https://github.com/cameri/nostream/pull/1295) [`df1f672`](https://github.com/cameri/nostream/commit/df1f6723a93a14386d4059f75bddda1f14f88f47) Thanks [@Priyanshubhartistm](https://github.com/Priyanshubhartistm)! - fix(admin): hide a webhook url in the settings-change notification when a parent path is replaced

The notification sent to the operator's recipients after a settings change redacts secrets by the settings path of each value. A change to a path above a webhook target, such as replacing `admin.notifications` or `admin`, carried the whole object as its value, and the redaction ran on it without that path, so the `url` of each notification target (a Discord or Slack webhook with a token in it) went out in the notification. The value of each change is now redacted with the path it was written at, so the url is replaced by `***` in the notification and in the response of the settings request.

- [#1339](https://github.com/cameri/nostream/pull/1339) [`f0a3325`](https://github.com/cameri/nostream/commit/f0a3325eca03cdf2463933de06a08fb741743e2b) Thanks [@chappie-daemon](https://github.com/chappie-daemon)! - fix(wot): bound a trust graph rebuild and space out the rebuilds contact lists trigger

A Web of Trust rebuild read follow lists one at a time with no limit on accounts, lists or follows, and every contact list (kind 3) from an account in the graph started or queued another full rebuild. A rebuild now stops at `wot.maxPubkeys`, `wot.maxFollowListReads` or `wot.maxEdges` (defaults 500000, 10000 and 2000000), logs which limit it hit, and keeps the graph built so far, which can only trust fewer accounts, never more. Follow lists are read 100 at a time, and a `p` value that is not a 64-character hex key is no longer looked up as an author prefix. Rebuilds triggered by contact lists wait `wot.minRebuildIntervalSeconds` (default 60) after the previous one ended. A deliberate limit: a follow-list change can take up to that interval longer to reach the graph.

- [#1294](https://github.com/cameri/nostream/pull/1294) [`76fa452`](https://github.com/cameri/nostream/commit/76fa4520054bd51202cefd4967501dbc361c8bc6) Thanks [@Priyanshubhartistm](https://github.com/Priyanshubhartistm)! - fix(wot): count one vote per follower and stop serving a trust graph built for other settings

Two gaps in the Web of Trust graph could grant a proof-of-work discount to an account that should not have it. A contact list (kind 3) that repeated the same `p` tag counted once per repetition towards `wot.minimumFollowers` when its follow list was read from the database, so one account could satisfy a threshold meant for several. Each follower now counts once. The built graph also stayed in use after `wot.seedPubkey`, `wot.maxDepth` or `wot.minimumFollowers` changed through a settings reload, so the old distances kept granting discounts until another event happened to trigger a rebuild. The graph now remembers the settings it was built for, is rebuilt when they change, and grants nothing while a rebuild for the new settings has not completed or has failed.

- [#1342](https://github.com/cameri/nostream/pull/1342) [`da83636`](https://github.com/cameri/nostream/commit/da83636c9a0d76a05dfdcf7fd3a722ab76714828) Thanks [@Priyanshubhartistm](https://github.com/Priyanshubhartistm)! - fix(wot): use one lowercase form for every pubkey in the trust graph and its cache

The value of a `p` tag in a contact list is any string, while an event's author is always lowercase hex. The Web of Trust graph kept a followed pubkey as it was written, so an uppercase spelling could sit in the graph and in the `wot:follows:` cache next to the lowercase form of the same account, and an account the graph had reached only through an uppercase tag did not trigger a rebuild when its own contact list changed. The graph and its cache keys now lowercase every pubkey they take in, including entries an earlier version left in the cache, and a `p` tag without a value is ignored. A `wot.seedPubkey` written in uppercase, which its pattern allows, is read as the same lowercase pubkey, so the seed is the account whose events are lowercase.

## 3.17.1

### Patch 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.1",
"version": "3.18.0",
"packageManager": "pnpm@10.33.0",
"private": true,
"description": "A Nostr relay written in Typescript.",
Expand Down
Loading