Repository navigation
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.