front door: the editor reaches Files over LOOPBACK — pin files.<apex> on the gateway so ADR 0258's callback sources shrink to loopback alone (no public IP in the bypass) #1648

Closed
opened 2026-09-20 03:55:44 +00:00 by ben · 3 comments
Owner

What

Make the community's editor (Collabora) reach Files over loopback on the gateway, so the front door's source-bound callback list (ADR 0258) can shrink to loopback alone and drop the gateway's public IP.

Why

Today coolwsd calls https://files.<apex>; public DNS answers with the gateway's public IP, so the call leaves and re-enters and reaches Caddy from the public address (read off a kept box, #1620 run 4/7 — remote_ip 127.0.0.1 ::1 <public IP>). That is why ADR 0258's source list has to carry the public IP. Two costs:

  • On a self-hosted home line the "gateway's public IP" is the household's shared address; a hairpinned LAN device may arrive from it. Harmless today — every source-bound path is token-bearing and Nextcloud still demands the token — but it is the reason the list must stay narrow, and it is a wider source than the ruling's intent ("the community's own editor").
  • Every document open depends on public DNS resolving files.<apex> from the gateway itself — the same hazard #1597 closed for id.<apex> (GOTCHAS #249).

Sketch

Pin files.<apex> to 127.0.0.1 on the gateway (the #1597 mechanism, 487f682a), only while docs-editing is placed. coolwsd's calls then arrive at Caddy from loopback; callbackSources returns loopback only and the public IP leaves the rendered matcher.

Unproven — check before building

  • That Caddy serves the files.<apex> site correctly to a loopback caller (SNI + the real certificate — it binds all interfaces, so it should; not tested).
  • That nothing else on the gateway relies on files.<apex> resolving publicly (the rehearsal's own probes dial from outside, so they should be unaffected).
  • coolwsd's WOPI host allow-list matches on the host NAME (files\.<apex>), so the pin should not disturb it — confirm.

What it does NOT fix

  • It is still a path list (ADR 0258's known brittleness, GOTCHAS #276).
  • An editor on a DIFFERENT machine from the front door stays refused (ADR 0258's known limit) — that shape needs its own source and its own ruling.

Gate

This TIGHTENS what the bypass trusts, but it changes the front-door gate's source list, so the change goes to Ben before it lands (ADR 0258: changes to the source list need a ruling). Proof: the #1620 roles-proof drive (files + docs-editing, both roles open a document) green with loopback-only sources.

## What Make the community's editor (Collabora) reach Files over **loopback** on the gateway, so the front door's source-bound callback list (ADR 0258) can shrink to loopback alone and drop the gateway's public IP. ## Why Today coolwsd calls `https://files.<apex>`; public DNS answers with the gateway's public IP, so the call leaves and re-enters and reaches Caddy **from the public address** (read off a kept box, #1620 run 4/7 — `remote_ip 127.0.0.1 ::1 <public IP>`). That is why ADR 0258's source list has to carry the public IP. Two costs: - On a self-hosted home line the "gateway's public IP" is the household's shared address; a hairpinned LAN device may arrive from it. Harmless today — every source-bound path is token-bearing and Nextcloud still demands the token — but it is the reason the list must stay narrow, and it is a wider source than the ruling's intent ("the community's own editor"). - Every document open depends on public DNS resolving `files.<apex>` from the gateway itself — the same hazard #1597 closed for `id.<apex>` (GOTCHAS #249). ## Sketch Pin `files.<apex>` to `127.0.0.1` on the gateway (the #1597 mechanism, `487f682a`), only while docs-editing is placed. coolwsd's calls then arrive at Caddy from loopback; `callbackSources` returns loopback only and the public IP leaves the rendered matcher. ## Unproven — check before building - That Caddy serves the `files.<apex>` site correctly to a loopback caller (SNI + the real certificate — it binds all interfaces, so it should; not tested). - That nothing else on the gateway relies on `files.<apex>` resolving publicly (the rehearsal's own probes dial from outside, so they should be unaffected). - coolwsd's WOPI host allow-list matches on the host NAME (`files\.<apex>`), so the pin should not disturb it — confirm. ## What it does NOT fix - It is still a path list (ADR 0258's known brittleness, GOTCHAS #276). - An editor on a DIFFERENT machine from the front door stays refused (ADR 0258's known limit) — that shape needs its own source and its own ruling. ## Gate This TIGHTENS what the bypass trusts, but it changes the front-door gate's source list, so the change goes to Ben before it lands (ADR 0258: changes to the source list need a ruling). Proof: the #1620 roles-proof drive (files + docs-editing, both roles open a document) green with loopback-only sources.
Author
Owner

Ben's instruction (in session, 2026-09-20): build this — blocked on the updates proof drive #1614 so it is picked up automatically once that drive is green and closed. He was told it changes the front-door bypass's source list (a tightening) before saying so. This replaces the "goes to Ben before it lands" gate in the body for THIS change only.

Limits on what a worker may land under this ticket — anything past them is a new ruling, route it ready-for-human:

  • The source list may only SHRINK (to loopback). Never add a source, never add or widen a callback path (clan.FilesEditorCallbackPaths is test-pinned, ADR 0258), never move a path onto the open FilesExemptPaths list.
  • If the pin does not work (Caddy will not serve files.<apex> to a loopback caller, or something on the gateway needs the public resolution), STOP and report — do not keep the pin AND the public IP, and do not work around it by loosening the gate.
  • Keep the public IP in the list until the pin is rendered in the SAME deploy, so no community is left with an editor that cannot call home.
  • Amend ADR 0258 (sources are loopback alone once the pin is placed) and GOTCHAS in the same commit; update the architecture bullet in docs/architecture/05-identity-architecture.md.

Proof: offline tests land with the change; STATUS says seam-proven / live-unproven until a roles-proof drive (the #1620 recipe: IDSS_ROLES_PROOF=1, IDSS_ROLES_SERVICES=files, IDSS_ROLES_ADD_SERVICE=docs-editing) goes green with both roles opening a document. The worker files that drive ticket (standing-drive) when it lands the change — a swarm worker cannot run the drive itself.

**Ben's instruction (in session, 2026-09-20):** build this — blocked on the updates proof drive #1614 so it is picked up automatically once that drive is green and closed. He was told it changes the front-door bypass's source list (a tightening) before saying so. This replaces the "goes to Ben before it lands" gate in the body for THIS change only. **Limits on what a worker may land under this ticket — anything past them is a new ruling, route it `ready-for-human`:** - The source list may only SHRINK (to loopback). Never add a source, never add or widen a callback path (`clan.FilesEditorCallbackPaths` is test-pinned, ADR 0258), never move a path onto the open `FilesExemptPaths` list. - If the pin does not work (Caddy will not serve `files.<apex>` to a loopback caller, or something on the gateway needs the public resolution), STOP and report — do not keep the pin AND the public IP, and do not work around it by loosening the gate. - Keep the public IP in the list until the pin is rendered in the SAME deploy, so no community is left with an editor that cannot call home. - Amend ADR 0258 (sources are loopback alone once the pin is placed) and GOTCHAS in the same commit; update the architecture bullet in `docs/architecture/05-identity-architecture.md`. **Proof:** offline tests land with the change; STATUS says seam-proven / live-unproven until a roles-proof drive (the #1620 recipe: `IDSS_ROLES_PROOF=1`, `IDSS_ROLES_SERVICES=files`, `IDSS_ROLES_ADD_SERVICE=docs-editing`) goes green with both roles opening a document. The worker files that drive ticket (`standing-drive`) when it lands the change — a swarm worker cannot run the drive itself.

swarm-claim host=bens-mac-04 run=28579
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=bens-mac-04 run=28579 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1648 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1648,
  "status": "success",
  "commits": [
    "7434ed9a8e0a33115a97b698065c7b0b553c568a"
  ],
  "changed_files": [
    "STATUS.md",
    "docs/GOTCHAS.md",
    "docs/adr/0258-the-editors-wopi-callback-bypasses-the-front-door-gate-only-from-the-gateways-own-addresses.md",
    "docs/architecture/05-identity-architecture.md",
    "internal/clan/frontdoor.go",
    "internal/clan/frontdoor_attach.go",
    "internal/clan/frontdoor_test.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/clan/",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/provision/",
      "exit_code": 0
    },
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/clan/",
      "exit_code": 0
    },
    {
      "command": "gofmt -l internal/clan/frontdoor.go internal/clan/frontdoor_attach.go internal/clan/frontdoor_test.go",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Pin files.<apex> to loopback on the gateway only while docs-editing is placed": "internal/clan/frontdoor.go renderLoopbackPins — pins each callback route's host (files.<apex>) in networking.hosts.\"127.0.0.1\" iff a route carries CallbackPaths, on either identity path; proven by TestRenderFrontDoor_PinsCallbackRouteToLoopback / _IDIPPathFilesAlone",
    "callbackSources returns loopback only; public IP leaves the rendered matcher": "internal/clan/frontdoor_attach.go callbackSources() returns [127.0.0.1, ::1] with no sidecar read; proven by TestCallbackSources_AreLoopbackAloneNowTheEditorReachesTheDoorFromLoopback and the bypass test rendering remote_ip 127.0.0.1 ::1",
    "Source list may only SHRINK (Ben's limit): no source added, FilesEditorCallbackPaths / FilesExemptPaths untouched": "diff touches neither files.go's FilesEditorCallbackPaths/FilesExemptPaths nor deploy.go; the source list drops the public IP and adds nothing",
    "Keep the public IP until the pin is rendered in the SAME deploy": "pin (renderLoopbackPins) and the loopback-only source list both render from the same RenderFrontDoor / AttachFrontDoor module, so a deploy never has one without the other",
    "Only the callback route is pinned, not the other catalogue ports": "renderLoopbackPins pins only routes with CallbackPaths; TestRenderFrontDoor_PinsCallbackRouteToLoopback asserts code.<apex> (no callback paths) is NOT in the pin line",
    "Amend ADR 0258 and GOTCHAS in the same commit; update architecture bullet": "commit 7434ed9a changes docs/adr/0258-*.md (amendment), docs/GOTCHAS.md (#293), docs/architecture/05-identity-architecture.md in one commit",
    "Proof: the #1620 roles-proof drive green with loopback-only sources (live)": "live-unproven by design (a swarm worker cannot run a drive) — filed as standing-drive ticket #1672 carrying the IDSS_ROLES_PROOF recipe; STATUS records live-unproven"
  },
  "summary": "The front door pins files.<apex> to loopback while docs-editing is placed, so coolwsd's WOPI callback arrives over loopback and ADR 0258's callback source list shrinks to loopback alone with no gateway public IP.",
  "blockers": []
}
**close-report** for #1648 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1648, "status": "success", "commits": [ "7434ed9a8e0a33115a97b698065c7b0b553c568a" ], "changed_files": [ "STATUS.md", "docs/GOTCHAS.md", "docs/adr/0258-the-editors-wopi-callback-bypasses-the-front-door-gate-only-from-the-gateways-own-addresses.md", "docs/architecture/05-identity-architecture.md", "internal/clan/frontdoor.go", "internal/clan/frontdoor_attach.go", "internal/clan/frontdoor_test.go" ], "tests": [ { "command": "go test ./internal/clan/", "exit_code": 0 }, { "command": "go test ./internal/provision/", "exit_code": 0 }, { "command": "go build ./...", "exit_code": 0 }, { "command": "go vet ./internal/clan/", "exit_code": 0 }, { "command": "gofmt -l internal/clan/frontdoor.go internal/clan/frontdoor_attach.go internal/clan/frontdoor_test.go", "exit_code": 0 } ], "criteria": { "Pin files.<apex> to loopback on the gateway only while docs-editing is placed": "internal/clan/frontdoor.go renderLoopbackPins — pins each callback route's host (files.<apex>) in networking.hosts.\"127.0.0.1\" iff a route carries CallbackPaths, on either identity path; proven by TestRenderFrontDoor_PinsCallbackRouteToLoopback / _IDIPPathFilesAlone", "callbackSources returns loopback only; public IP leaves the rendered matcher": "internal/clan/frontdoor_attach.go callbackSources() returns [127.0.0.1, ::1] with no sidecar read; proven by TestCallbackSources_AreLoopbackAloneNowTheEditorReachesTheDoorFromLoopback and the bypass test rendering remote_ip 127.0.0.1 ::1", "Source list may only SHRINK (Ben's limit): no source added, FilesEditorCallbackPaths / FilesExemptPaths untouched": "diff touches neither files.go's FilesEditorCallbackPaths/FilesExemptPaths nor deploy.go; the source list drops the public IP and adds nothing", "Keep the public IP until the pin is rendered in the SAME deploy": "pin (renderLoopbackPins) and the loopback-only source list both render from the same RenderFrontDoor / AttachFrontDoor module, so a deploy never has one without the other", "Only the callback route is pinned, not the other catalogue ports": "renderLoopbackPins pins only routes with CallbackPaths; TestRenderFrontDoor_PinsCallbackRouteToLoopback asserts code.<apex> (no callback paths) is NOT in the pin line", "Amend ADR 0258 and GOTCHAS in the same commit; update architecture bullet": "commit 7434ed9a changes docs/adr/0258-*.md (amendment), docs/GOTCHAS.md (#293), docs/architecture/05-identity-architecture.md in one commit", "Proof: the #1620 roles-proof drive green with loopback-only sources (live)": "live-unproven by design (a swarm worker cannot run a drive) — filed as standing-drive ticket #1672 carrying the IDSS_ROLES_PROOF recipe; STATUS records live-unproven" }, "summary": "The front door pins files.<apex> to loopback while docs-editing is placed, so coolwsd's WOPI callback arrives over loopback and ADR 0258's callback source list shrinks to loopback alone with no gateway public IP.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#1648
No description provided.