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

  1. should-fix, round one: internal/community/name.go (PublicURL), internal/server/health.go, web/src/shared/lib/shareOrigin.ts. PUBLIC_URL defaults to http://localhost:8080, so public_url was 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 with http://localhost:8080, and a Vite dev server would have copied links to :8080. Fix (taken): GET /api/health announces no public_url while PUBLIC_URL is a loopback address; a test pins it, and doc/api-stability.md says so.
  2. note, round one: no component test showed a copied link using the public address. Accepted: shareOrigin has a unit test and the store has a test that reads public_url from the health answer.
  3. note, round one: AdminOnboardingTab.vue read the hostname once at setup and would throw for an opaque origin. Fixed: a computed over the share origin.
  4. 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.origin or location.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_url is additive and optional on the 200 and the 503 answer; OpenAPI, the generated types and doc/api-stability.md agree; no web_client_api bump.
  • Security: /api/health is already public and public_url is the intentionally public address. The client accepts only http(s) values and takes .origin, so a javascript: value is ignored (tested).
  • Repo rules: English only, no secrets, IPs or real hostnames, no AI attribution.

Something wrong on this page? Tell us.