|
@@ -780,21 +780,31 @@ the `sm121.checksum` label — a missing tag names the tag + hints to
|
|
|
build/push first (or fall back to `--image-source repo`). Mutually
|
|
build/push first (or fall back to `--image-source repo`). Mutually
|
|
|
exclusive with `--build-node`.
|
|
exclusive with `--build-node`.
|
|
|
|
|
|
|
|
-**The add-on image** (`docker-images/sm121-addon/`, multi-stage — sm121
|
|
|
|
|
-is compiled in-container so the binary matches the container arch):
|
|
|
|
|
-`make addon-image` → `sm121-addon:latest`; `make addon-push` →
|
|
|
|
|
|
|
+**The add-on image** (`docker-images/sm121-addon/`, THIN — the Pi is the
|
|
|
|
|
+build host): `make addon-image` → `sm121-addon:latest` (debian-slim +
|
|
|
|
|
+git/jq + the pinned Rust toolchain, ~1.2 GB, no sm121 binary); the
|
|
|
|
|
+entrypoint **compiles sm121 from the launcher repo on first boot**
|
|
|
|
|
+(`sm121_launcher_url` default git.kilork.org/sm121/sm121-launcher,
|
|
|
|
|
+`sm121_launcher_rev` default main — set a commit to pin) and caches the
|
|
|
|
|
+binary + cargo target dir in the add-on's data folder ($HOME), so a
|
|
|
|
|
+reboot with an unchanged rev is fast and a rev change recompiles once.
|
|
|
|
|
+The arch always matches (no cross-toolchain, x86_64 HA hosts work with a
|
|
|
|
|
+multi-arch image push) and the binary never goes stale. First boot is a
|
|
|
|
|
+full release build (minutes on a Pi 5, longer on a Pi 4 —
|
|
|
|
|
+`sm121_build_jobs` defaults to 2 so a Pi 4 doesn't OOM under HA). This is
|
|
|
|
|
+the HAOS path (HAOS has no Docker to build with). `make addon-push` →
|
|
|
`ghcr.io/kilork/sm121-addon:latest`; smoke test `scripts/smoke-addon.sh`
|
|
`ghcr.io/kilork/sm121-addon:latest`; smoke test `scripts/smoke-addon.sh`
|
|
|
-(entrypoint + `file://` recipe repo + `curl /api/state`). The entrypoint
|
|
|
|
|
-writes the effective config from the add-on options (env), drops the SSH
|
|
|
|
|
-key (base64 option), `sm121 repos sync`, then `sm121 web --port 3100
|
|
|
|
|
---bind 0.0.0.0` (a bearer token is required) with a background re-sync
|
|
|
|
|
-loop (`SM121_REPO_RESYNC_MINUTES`). The HA add-on manifest
|
|
|
|
|
-(`config.yaml` + README) lives in the sibling **sm121-ha-integration**
|
|
|
|
|
-repo — its `custom_components/` custom-integration prototype is
|
|
|
|
|
-superseded (entities are a phase-2 nicety over the add-on's REST API).
|
|
|
|
|
-Per-install credentials that can't be flat options (e.g. a `[mikrotik]`
|
|
|
|
|
-block with its password) go in the `sm121_config_extra` option — raw
|
|
|
|
|
-TOML appended to the generated config, kept out of the log.
|
|
|
|
|
|
|
+(entrypoint + `file://` recipe repo + `file://` launcher checkout +
|
|
|
|
|
+curl /api/state). The entrypoint writes the effective config from the
|
|
|
|
|
+add-on options (env), drops the SSH key (base64 option), `sm121 repos
|
|
|
|
|
+sync`, then `sm121 web --port 3100 --bind 0.0.0.0` (a bearer token is
|
|
|
|
|
+required) with a background re-sync loop (`SM121_REPO_RESYNC_MINUTES`).
|
|
|
|
|
+The HA add-on manifest (`config.yaml` + README) lives in the sibling
|
|
|
|
|
+**sm121-ha-integration** repo — its `custom_components/` custom-integration
|
|
|
|
|
+prototype is superseded (entities are a phase-2 nicety over the add-on's
|
|
|
|
|
+REST API). Per-install credentials that can't be flat options (e.g. a
|
|
|
|
|
+`[mikrotik]` block with its password) go in the `sm121_config_extra`
|
|
|
|
|
+option — raw TOML appended to the generated config, kept out of the log.
|
|
|
|
|
|
|
|
**Single-launcher rule** — the per-recipe run ledger (`.lock` in the
|
|
**Single-launcher rule** — the per-recipe run ledger (`.lock` in the
|
|
|
recipe repo) is the serialization point: a second launcher that serves
|
|
recipe repo) is the serialization point: a second launcher that serves
|