PR #828 review (sonnet, two rounds): merge after one fix
From mnema-talk v3.3.13, rendered on this site.
Reviewer: a sonnet agent, read-only, given the PR number and the focus (shared links use the server's public address) and nothing else. Round one reviewed the diff at 145c63b43; round two the follow-up at b7e122c5b. It ran no tests; CI ran them.
FINDINGS
- should-fix, round one:
internal/community/name.go(PublicURL),internal/server/health.go,web/src/shared/lib/shareOrigin.ts.PUBLIC_URLdefaults tohttp://localhost:8080, sopublic_urlwas never empty. A self-hoster who kept the default and reached the app at their real address would have had every invite, message, wiki and vanity link start withhttp://localhost:8080, and a Vite dev server would have copied links to :8080. Fix (taken):GET /api/healthannounces nopublic_urlwhilePUBLIC_URLis a loopback address; a test pins it, and doc/api-stability.md says so. - note, round one: no component test showed a copied link using the public address. Accepted:
shareOriginhas a unit test and the store has a test that readspublic_urlfrom the health answer. - note, round one:
AdminOnboardingTab.vueread the hostname once at setup and would throw for an opaque origin. Fixed: a computed over the share origin. - nit, round one: import order in five components. Not changed.
Round two found nothing new and answered MERGE.
CHECKED AND FINE
- No share-link site is left on
location.originorlocation.host: the remaining uses are the WebSocket host, the trusted-types check and the service worker, none of which is a link to share. - Contract:
public_urlis additive and optional on the 200 and the 503 answer; OpenAPI, the generated types and doc/api-stability.md agree; noweb_client_apibump. - Security:
/api/healthis already public andpublic_urlis the intentionally public address. The client accepts only http(s) values and takes.origin, so ajavascript:value is ignored (tested). - Repo rules: English only, no secrets, IPs or real hostnames, no AI attribution.