Repository navigation
feat(ftw-0x-beta): let people pin FTW to Home Assistant's sidebar - #26
Conversation
Turn on ingress with a small launcher page, so the app's Info tab offers Show in sidebar. FTW refuses to be framed (frame-ancestors 'none') and its UI uses absolute paths, so the panel does not embed it: an Open FTW button opens FTW on port 8080 in a new tab. busybox httpd serves the page as uid 100 and answers only Supervisor's ingress proxy (172.30.32.2). Co-authored-by: HuggeK <[email protected]>
miravoss26
left a comment
There was a problem hiding this comment.
Adds an ingress-backed launcher panel so FTW can be pinned to HA's sidebar, since FTW itself refuses to be framed. Panel is a static page that opens FTW on port 8080 in a new tab; busybox httpd serves it, locked to Supervisor's proxy IP only.
Findings:
Home Assistant app lintis genuinely red, not flaky:'webui' should be removed, Ingress is enabled.config.yamlkeeps bothwebui: http://[HOST]:[PORT:8080]/andingress: true. The PR body doesn't mention this failure or say whether it's intentional (you note "HA prefers ingress over webui" at runtime, but the addon-linter spec still rejects having both keys set). Worth a decision: dropwebuito satisfy the linter, or confirm the combination is deliberate and the check should be waived.- Security looks solid on the parts I can check without real HA/Supervisor:
panel/httpd.confACL (A:172.30.32.2/D:*) matches the stated intent,index.htmlbuilds the URL and writes it viatextContent/hrefrather thaninnerHTML(no obvious XSS surface), andsmoke_native.shnow asserts 403 from a non-Supervisor IP and that the panel runs as uid 100:101, not root. run.sh's panel startup is non-fatal (|| printf ... >&2), so a busybox failure can't block Core — matches the PR's own stated goal.
Not tested against a real HA OS/Supervisor (noted in the PR itself), and the PR description flags this as a stopgap that conflicts with #25 — that call and the lint question both need a human. Everything else reads safe to merge from my read.
The Home Assistant app linter rejects having both keys. Open web UI now opens the ingress launcher; FTW itself stays on port 8080. Signed-off-by: Fredrik Ahlgren <[email protected]>
|
Review (Claude CLI, 2026-11-12): the sidebar launcher looks sound (ACL on 172.30.32.2 only, no XSS path, panel failure is non-fatal for Core). Two blockers are now addressed on this branch:
Will squash-merge once Check is green. Users get the sidebar on the next FTW pin, because the app version has to stay equal to the pin. |
Builds on #25's ingress commits (cherry-picked above) and on #26, which main merged since. - Drop #26's launcher page and its busybox httpd. Core now answers ingress itself on 18099, so the sidebar panel opens FTW directly. - Drop the `.ha.N` app revision from #25. Fredrik chose to ship ingress with the next beta, so the app keeps the Core version. Notes under "## Unreleased" in CHANGELOG.md now ship with the next pin instead of sitting below it. - Drop the empty translations; the app has no ports or options. - Tell people to pair the FTW app with the link or QR: the short code needs FTW's own web port, which the app closes. Refs #25 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Fredrik Ahlgren <[email protected]>
…er, name it FTW (beta) (#56) * feat: open the FTW app through Home Assistant ingress (cherry picked from commit af0b502) Signed-off-by: Fredrik Ahlgren <[email protected]> * fix: use Supervisors default admin-only ingress panel (cherry picked from commit ff21dc2) Signed-off-by: Fredrik Ahlgren <[email protected]> * docs: show the FTW sidebar option in the ingress app (cherry picked from commit d8d32d9) Signed-off-by: Fredrik Ahlgren <[email protected]> * feat(ftw-0x-beta): finish ingress on current main Builds on #25's ingress commits (cherry-picked above) and on #26, which main merged since. - Drop #26's launcher page and its busybox httpd. Core now answers ingress itself on 18099, so the sidebar panel opens FTW directly. - Drop the `.ha.N` app revision from #25. Fredrik chose to ship ingress with the next beta, so the app keeps the Core version. Notes under "## Unreleased" in CHANGELOG.md now ship with the next pin instead of sitting below it. - Drop the empty translations; the app has no ports or options. - Tell people to pair the FTW app with the link or QR: the short code needs FTW's own web port, which the app closes. Refs #25 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Fredrik Ahlgren <[email protected]> * feat(ftw-0x-beta): give Core Home Assistant's MQTT broker The app now declares `services: - mqtt:want`. At start, run.sh asks Supervisor for the broker (GET http://supervisor/services/mqtt) and passes host, port, user and password to Core in FTW_HA_MQTT_*. Core uses them while its own broker setting is empty (paired Core PR), so FTW's entities appear in Home Assistant without typing anything. No broker, a refusal, TLS only or a bad answer leaves the variables unset and logs one line; Core always starts. Only Supervisor's answer may set them: run.sh unsets any inherited values first. The image gains jq to read the answer. The smoke test now runs Core with a Supervisor that offers no broker and checks that Core starts without one. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Fredrik Ahlgren <[email protected]> * feat(ftw-0x-beta): name the app FTW (beta) Rename the store entry from "FTW (0.x beta)" to "FTW (beta)". The slug stays ftw-0x-beta, so installs keep their data. The docs now say "version 0.x" or "3.x" where the retired 3.x app, once also called FTW (beta), could be confused with this one. Start on boot is already Supervisor's default (`boot: auto`), and the app linter refuses a key that repeats a default. It also refuses the old `watchdog:` key as obsolete: Supervisor's Watchdog acts on the Docker HEALTHCHECK, which already asks Core's /api/health. So the manifest gains neither key; the docs drop the Start on boot step and keep the one Watchdog switch Supervisor leaves off by default. The README and the install steps get the My Home Assistant button that opens the add-repository dialog with this repository filled in. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Fredrik Ahlgren <[email protected]> * docs(ftw-0x-beta): name the paired Core PR Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Fredrik Ahlgren <[email protected]> * fix(ftw-0x-beta): steady smoke test; no minimum Home Assistant version - smoke_native.sh captured nothing before `grep -q`. Under pipefail, grep stops reading at its first match, the writer can die of SIGPIPE, and the line fails at random. That failed the aarch64 smoke in run 46113515200 ("MQTT broker lookup did not report"). The log, the redirect headers and the setup page are now read into a variable first. - Drop `homeassistant: "2026.10.2"` from #25. Nothing here needs it: ingress and the X-Remote-User-Id header the app relies on come from Supervisor (since 2023), which updates itself, and the floor would only turn away beta users on an older Home Assistant. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Fredrik Ahlgren <[email protected]> --------- Signed-off-by: Fredrik Ahlgren <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Note
Stopgap until #25 ships. #25 together with srcfl/ftw#1786 runs FTW itself inside Home Assistant's sidebar as an iframe, like other add-ons. #1786 sends
frame-ancestors 'self'/SAMEORIGINon ingress requests, rewrites the UI's absolute URLs underX-Ingress-Pathand trusts Supervisor-authenticated requests as the owner. #25 is blocked until a FTW beta containing #1786 is published. This PR offers the sidebar entry with today's FTW package and needs no Core change. The two PRs conflict (sameftw-0x-betafiles and the ingress slot), so close this one when #25 is ready to merge, or skip it if #25 lands soon.Lets people pin FTW to Home Assistant's sidebar. The app now turns on ingress, so its Info tab offers Show in sidebar. The sidebar entry (and Open web UI) opens a small launcher page with an Open FTW button, which opens FTW on port 8080 in a new tab.
config.yaml:ingress: true,ingress_port: 8093,panel_icon: mdi:solar-power-variant,panel_title: FTW.webui, ports and the update flow are unchanged.panel/index.html: a static page with no external assets. It builds the FTW address from the hostname used to reach HA and warns when that hostname isn't local by FTW's own rules (private/loopback IP,localhost,.local/.localhost/.home.arpa). English, plus Swedish when the browser language issv.run.sh/Dockerfile: adds Debian'sbusyboxand startsbusybox httpdas uid 100:101 before Core. If it fails to start, it logs a line and Core starts anyway.panel/httpd.conf: answers only Supervisor's ingress proxy (172.30.32.2), because the port sits on the host network.smoke_native.sh: checks that the panel runs as 100:101 and refuses 127.0.0.1 with 403.Why a launcher instead of embedding FTW in the panel
HA's ingress panel is an iframe. FTW can't run in it today:
frame-ancestors 'none'/X-Frame-Options: DENYon every response (clickjacking guard from fix(api): refuse to frame the dashboard ftw#909). It matters because, withlan_authoff, every LAN browser is an owner./api/...,/components/...,/setup), which break under/api/hassio_ingress/<token>/.An embedded panel would need FTW changes: allow
frame-ancestors 'self'only for ingress requests, support a base path fromX-Ingress-Path, and decide whether an HA-authenticated ingress request counts as an owner. srcfl/ftw#1786 makes exactly these changes; #25 is the app side.Notes for review
host_networkit must not clash with other add-ons, and 8099 (HA's default) and 8095 (Music Assistant) are common.ingress_port: 0would needhassio_apito read the assigned port, so I kept a fixed port.webui), so first setup takes one extra click.native_pin.py), and the pin bot prepends the changelog entry. This reaches users with the next FTW pin. Happy to add an entry wherever you prefer.docs/home-assistant-app.mdand the Swedish setup guide still say the app does not use ingress. feat(ha): open FTW through HA ingress without a second password ftw#1786 already rewrites them for the embedded mode.Tested
scripts/validate.py,unittest discover -s tests,native_pin.py check: pass (run inpython:3.12-slimwithscripts/requirements.txt)run.sh,healthcheck.sh,smoke_native.sh: cleanscripts/smoke_native.shagainst it: PASS. This includes cold backup/restore and "Core death ends the container" with httpd running.172.30.32.0/23), a client at172.30.32.2gets the page (200) and172.30.32.9gets 403.🤖 Generated with Claude Code