Skip to content

Commit f2c5162

Browse files
agnersclaude
andauthored
Respect SUPERVISOR_CHANNEL when fetching AppArmor profile (#173)
Align hassio-apparmor with the supervisor_scripts/common convention by using SUPERVISOR_CHANNEL (defaulting to dev) to pick the apparmor_*.txt URL. Pass the variable through the systemd unit so containerEnv reaches the service. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 779f30c commit f2c5162

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

common/rootfs_supervisor/etc/systemd/system/hassio-apparmor.service

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Before=docker.service hassio-supervisor.service
99
[Service]
1010
Type=oneshot
1111
RemainAfterExit=true
12+
PassEnvironment=SUPERVISOR_CHANNEL
1213
ExecStart=/usr/sbin/hassio-apparmor
1314

1415
[Install]

common/rootfs_supervisor/usr/sbin/hassio-apparmor

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ set -e
33

44
PROFILES_DIR="/mnt/supervisor/apparmor"
55
CACHE_DIR="${PROFILES_DIR}/cache"
6+
SUPERVISOR_CHANNEL="${SUPERVISOR_CHANNEL:-dev}"
67

78
mkdir -p "${PROFILES_DIR}"
89
mkdir -p "${CACHE_DIR}"
910

1011
# Download the hassio-supervisor profile if not present
1112
if [ ! -f "${PROFILES_DIR}/hassio-supervisor" ]; then
12-
curl -sf https://version.home-assistant.io/apparmor_stable.txt \
13+
curl -sf "https://version.home-assistant.io/apparmor_${SUPERVISOR_CHANNEL}.txt" \
1314
-o "${PROFILES_DIR}/hassio-supervisor"
1415
fi
1516

0 commit comments

Comments
 (0)