Development hosts, review V-1 to V-3: a malformed list stops the start, a trailing dot and Unicode patterns match, every send reads the store

- V-1: assertDevelopmentHosts - iapl({ developmentHosts }), mail.relay.developmentHosts and
  mailAdapter({ relay }) refuse anything but an array of non-empty host patterns, and a pattern of `*` alone
  (it would make the public site a development address). Nothing is ignored silently any more.
- V-2: one trailing dot of the host is stripped before matching; patterns are punycoded, so one written in
  Unicode matches; a `*` inside a non-ASCII label is refused.
- V-3: the 30-second memory of other hosts is gone. A dump restored into a running development site stops
  its very next e-mail.
- docs, AGENT.md, changelog draft, skills

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-11-26 10:57:32 +01:00
co-authored by Claude Fable 5.2
parent 99c73ed0ff
commit 6c4e244094
18 changed files with 135 additions and 46 deletions
+3 -1
View File
@@ -284,6 +284,7 @@ await runWithMailKind('account', () => sendWelcomeMails(payload, user))
other: **replace it** with your own patterns (`developmentHosts: ['*.preview.agency.example', 'staging.client.pl']`),
or pass **`[]`** so that no host is a development address. `mail: { relay: { developmentHosts } }` overrides the
list for the mail service alone.
- A malformed list stops the start (`assertDevelopmentHosts`): the value must be an array of non-empty host patterns — a single string, `null`, a number, an empty string, a scheme or a path are refused, and so is a pattern made of `*` alone (it would make the public site a development address). Patterns are compared as hosts are written on the wire: lowercase, punycode (a pattern may be written in Unicode), a trailing dot ignored, the port ignored.
- **By the variable.** `IAPL_NOINDEX=1` marks any other staging, preview or test copy.
- The list is about mail only: it does **not** make a development host noindex. Keeping development addresses out of search engines stays the hosting's business (Coolify) or `IAPL_NOINDEX=1`.
- The panel state (`nonPublicBy`, `nonPublicPattern`), `siteNonPublicSignal(payload)` and the doctor
@@ -316,7 +317,8 @@ await runWithMailKind('account', () => sendWelcomeMails(payload, user))
called back at that host).
- After "Connect again" a copy sends until its data is replaced.
- A development site that keeps running **on the launched database** (not a copy of it) stops sending by itself
once the real domain has enrolled; other processes notice within 30 seconds.
once the real domain has enrolled. The check reads the database at every send, so a dump restored into a running
development site stops its very next e-mail.
- **A copy that must never send:** `iapl({ mail: { relay: false } })` there, or SMTP to a catcher. That is the safe
set-up for staging; the rule above only protects until somebody presses the button.
- **`otherHosts`** changes the rule: a list (`['client.dev.agency.example']`) names hosts as this site's own — a