diff --git a/homecore_controller/CHANGELOG.md b/homecore_controller/CHANGELOG.md index 845bd80..9c0a48a 100644 --- a/homecore_controller/CHANGELOG.md +++ b/homecore_controller/CHANGELOG.md @@ -1,5 +1,12 @@ # HomeCore Controller Changelog +## 0.1.7 + +- Fixes Home Assistant Supervisor token inheritance by starting HomeCore through `with-contenv`. +- Adds startup logging to confirm whether `SUPERVISOR_TOKEN` is available. +- Preserves manual per-controller update control; no automatic rollout is enabled. +- Bootstrap release required because 0.1.5 cannot call the Supervisor update API without the token. + ## 0.1.6 - First HomeCore Admin manual per-controller deployment validation release. diff --git a/homecore_controller/Dockerfile b/homecore_controller/Dockerfile index 4548e5e..6da6d36 100644 --- a/homecore_controller/Dockerfile +++ b/homecore_controller/Dockerfile @@ -7,5 +7,7 @@ ENV PATH="/opt/venv/bin:$PATH" COPY requirements.txt /tmp/requirements.txt RUN pip install --no-cache-dir -r /tmp/requirements.txt COPY app /opt/homecore +COPY run.sh /run.sh +RUN chmod a+x /run.sh WORKDIR /opt/homecore -CMD ["python", "main.py"] +CMD ["/run.sh"] diff --git a/homecore_controller/app/main.py b/homecore_controller/app/main.py index 2a5269d..bb0bb11 100644 --- a/homecore_controller/app/main.py +++ b/homecore_controller/app/main.py @@ -16,7 +16,13 @@ from cryptography.hazmat.primitives import serialization import uvicorn from updater import start_update_manager -VERSION = "0.1.6" +VERSION = "0.1.7" + +print( + "HOMECORE SUPERVISOR: token " + + ("available" if os.getenv("SUPERVISOR_TOKEN") else "missing"), + flush=True, +) DATA = Path("/config") DATA.mkdir(parents=True, exist_ok=True) diff --git a/homecore_controller/config.yaml b/homecore_controller/config.yaml index f1a1c2f..0be09ee 100644 --- a/homecore_controller/config.yaml +++ b/homecore_controller/config.yaml @@ -1,5 +1,5 @@ name: HomeCore Controller -version: "0.1.6" +version: "0.1.7" slug: homecore_controller description: HomeCore local controller agent for Home Assistant Green. url: https://homecore.home-core.co.uk diff --git a/homecore_controller/run.sh b/homecore_controller/run.sh new file mode 100755 index 0000000..eff2cdf --- /dev/null +++ b/homecore_controller/run.sh @@ -0,0 +1,3 @@ +#!/usr/bin/with-contenv sh +set -eu +exec python /opt/homecore/main.py