21 Commits

Author SHA1 Message Date
Alexandre
72549986f1 update 2025-12-30 11:26:38 +01:00
Alexandre
9321dc9345 Merge pull request #2320 from Quentec/master
Fix: Restore Portainer Agent build and image source - Fix circular dependency
2025-12-30 11:23:50 +01:00
Alexandre
af41c2bce6 Merge pull request #2319 from alexbelgium/codex/use-latest-version-for-bashio
Use latest bashio release in package download template
2025-12-30 11:23:21 +01:00
Sophie
b35dd4f992 fix: Add robust error handling to bashio download process
Based on feedback from PR #2319 code review: critical network operations
need explicit error handling and validation.

Added safeguards:
- curl -f flag: Fail on HTTP errors (429, 404, 500, etc)
- test -s check: Verify downloaded file is not empty
- tar extraction error check: Fail if tar extraction fails
- lib directory validation: Confirm bashio/lib exists after extraction
- Explicit error messages: Clear diagnostics if any step fails

This prevents silent failures where downloads could fail but build
continues with broken/missing bashio installation.

Prevents: Users pulling images with non-functional bashio
Impact: Build will fail explicitly with clear error messages if download/extraction fails
2025-12-30 11:15:18 +01:00
Sophie
681590e9b1 docs: Add root cause analysis forum post for community discussion 2025-12-30 10:55:53 +01:00
Sophie
dd66f4b497 docs: Update CHANGELOG with complete list of fixes addressing code review feedback
- Multi-architecture support restored (aarch64 builds)
- Error suppression removed for user diagnostics
- Circular dependency fix documented
- Config.yaml version tag corrected
2025-12-30 10:43:18 +01:00
Sophie
72a99d056a fix: Address critical code review feedback from Gemini
CRITICAL FIXES:
1. Restore multi-architecture support - Use ARG BUILD_FROM/BUILD_ARCH instead of hardcoded amd64 base image
   - Fixes: aarch64 builds were broken by hardcoded FROM ghcr.io/hassio-addons/base/amd64:11.1.0
   - Now: FROM $BUILD_FROM allows alexbelgium build system to set correct base per architecture

2. Remove stderr suppression from agent command - Restore error visibility for debugging
   - Fixes: Error messages were hidden by 2>/dev/null redirection
   - Now: ./agent command output visible for user diagnostics

These changes ensure:
- Multi-arch builds work correctly (amd64, aarch64, armv7, armhf, i386)
- Users can debug configuration issues via visible error logs
- Circular dependency fix is fully compatible with existing build system
2025-12-30 10:38:11 +01:00
Sophie
fb1e3374a7 ci: Trigger GitHub Actions workflow re-run
Force workflow to re-run with latest .github/paths-filter.yml configuration.
2025-12-30 10:26:10 +01:00
Sophie
64f0656e84 docs: Update CHANGELOG.md with fix for circular dependency issue
Adds changelog entry for alpine-sts version (30-12-2025) documenting:
- Fix for circular dependency that prevented Docker builds
- Restoration of official Portainer Agent image source
- Resolution of Issue #2318 (404 manifest unknown errors for users)
2025-12-30 10:24:49 +01:00
Sophie
2500a30186 ci: Add GitHub Actions paths filter configuration
Adds missing .github/paths-filter.yml configuration file required by
PR check workflow. Registers all addon paths including portainer_agent
for automated build testing on pull requests.

This allows GitHub Actions to properly detect which addons have changed
and trigger appropriate validation checks.
2025-12-30 10:24:06 +01:00
Sophie
4a75b76a19 fix: Restore Portainer Agent build and image source - Fix circular dependency
Restores official Portainer Agent image source (ghcr.io/portainerci/agent:latest)
in COPY --from statements. Previous code review feedback inadvertently introduced
a circular dependency that prevents Docker builds.

This fixes Issue #2318 where users cannot update due to 404 manifest unknown error.

Closes #2318
2025-12-30 10:19:01 +01:00
Alexandre
573c9721c6 Use latest bashio release in template 2025-12-30 09:23:50 +01:00
Alexandre
1669f63f21 Merge pull request #2315 from Quentec/master
fix: PROTECTION MODE IS ENABLED error when protection mode is OFF
2025-12-29 23:00:57 +01:00
github-actions
7461665439 GitHub bot : README updated 2025-12-29 17:03:43 +00:00
Claude Code
fdfe3070d2 fix: Correct CHANGELOG.md formatting for Codacy compliance
- Add blank line after version heading per markdown style guidelines
- Ensures consistent formatting with rest of CHANGELOG
2025-12-29 16:00:51 +01:00
Claude Code
f0f1251285 fix: Address code review feedback from Gemini
- Use BUILD_FROM and BUILD_ARCH for multi-architecture support
  * Replace hardcoded amd64 with BUILD_FROM in FROM statement
  * Use BUILD_ARCH variable in COPY --from directives
  * Enables building for both amd64 and aarch64 architectures

- Remove error suppression in run script for better debugging
  * Change 'cd /app || true' to 'cd /app' (fail fast on errors)
  * Remove '2> /dev/null' redirection from agent startup
  * Allow error messages to reach container logs for troubleshooting

These changes ensure the fix works correctly across all supported architectures
and provides visibility into any runtime issues.
2025-12-29 15:53:37 +01:00
Claude Code
6de904a01f fix: PROTECTION MODE IS ENABLED error when protection mode is OFF
Fixes #2307

Changes:
- Update bashio from v0.17.5 → main branch (improved API error handling)
- Add robust protection mode check with Docker socket fallback
- Implement Level 1 (standard bashio) + Level 2 (socket check) fallback logic
- Update CHANGELOG.md with fix details
- Tested and verified working on Home Assistant OS with protection mode OFF

The fix addresses root cause: bashio v0.17.5 calls /addons/self endpoint
which returns 403 Forbidden. bashio's error handling incorrectly assumes
this means protection mode is ON. The fallback checks Docker socket directly
as a reliable indicator of actual protection mode state.
2025-12-29 15:40:14 +01:00
github-actions
ae11760a96 GitHub bot: changelog 2025-12-29 09:33:34 +00:00
Alexandre
307b26798e Update version to v3.8.0-2
https://github.com/alexbelgium/hassio-addons/issues/2314
2025-12-29 10:12:22 +01:00
Alexandre
64cd59699f Update ingress.conf
https://github.com/alexbelgium/hassio-addons/issues/2314
2025-12-29 10:11:56 +01:00
github-actions
0c8f5239bf Github bot : image compressed 2025-12-28 23:06:51 +00:00
118 changed files with 130 additions and 137 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 330 KiB

After

Width:  |  Height:  |  Size: 62 KiB

BIN
.github/stats.png vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@@ -237,9 +237,10 @@ for files in "/etc/services.d" "/etc/cont-init.d"; do
# Bashio
if grep -q -rnw "$files/" -e 'bashio' && [ ! -f "/usr/bin/bashio" ]; then
[ "$VERBOSE" = true ] && echo "install bashio"
BASHIO_VERSION="0.14.3"
BASHIO_VERSION="latest"
mkdir -p /tmp/bashio
curl -f -L -s -S "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" | tar -xzf - --strip 1 -C /tmp/bashio
BASHIO_TAG="$(curl -f -L -s -S "https://api.github.com/repos/hassio-addons/bashio/releases/${BASHIO_VERSION}" | awk -F '\"' '/tag_name/{print $4; exit}')"
curl -f -L -s -S "https://github.com/hassio-addons/bashio/archive/${BASHIO_TAG}.tar.gz" | tar -xzf - --strip 1 -C /tmp/bashio
mv /tmp/bashio/lib /usr/lib/bashio
ln -s /usr/lib/bashio/bashio /usr/bin/bashio
rm -rf /tmp/bashio

View File

@@ -817,6 +817,13 @@ If you want to do add the repository manually, please follow the procedure highl
![aarch64][aarch64-badge]
![amd64][amd64-badge]
✓ [Vaultwarden](bitwarden/) : Open source password management solution
  ![Version](https://img.shields.io/badge/dynamic/yaml?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fbitwarden%2Fconfig.yaml)
![Update](https://img.shields.io/badge/dynamic/json?label=Updated&query=%24.last_update&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fbitwarden%2Fupdater.json)
![aarch64][aarch64-badge]
![amd64][amd64-badge]
✓ ![image](https://api.iconify.design/mdi/monitor.svg) [Webtop KDE](webtop_kde/) : Full linux desktop environment accessible via any modern web browser
  ![Version](https://img.shields.io/badge/dynamic/yaml?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fwebtop_kde%2Fconfig.yaml)
@@ -908,13 +915,6 @@ If you want to do add the repository manually, please follow the procedure highl
![aarch64][aarch64-badge]
![amd64][amd64-badge]
✓ [zzz_archived - Vaultwarden](zzz_archived_bitwarden/) : Deprecated - please use community version
  ![Version](https://img.shields.io/badge/dynamic/yaml?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fzzz_archived_bitwarden%2Fconfig.yaml)
![Update](https://img.shields.io/badge/dynamic/json?label=Updated&query=%24.last_update&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fzzz_archived_bitwarden%2Fupdater.json)
![aarch64][aarch64-badge]
![amd64][amd64-badge]
✓ [zzz_archived : Code-server (VScode)](zzz_archived_code-server/) : Deprecated : Code-server is VS Code running on a remote server, accessible through the browser
  ![Version](https://img.shields.io/badge/dynamic/yaml?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fzzz_archived_code-server%2Fconfig.yaml)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -1,3 +1,5 @@
## v3.8.0-2 (29-12-2025)
- Minor bugs fixed
## v3.8.0 (20-12-2025)
- Update to latest version from mealie-recipes/mealie (changelog : https://github.com/mealie-recipes/mealie/releases)

View File

@@ -114,4 +114,4 @@ schema:
slug: mealie
udev: true
url: https://github.com/alexbelgium/hassio-addons
version: "v3.8.0"
version: v3.8.0-2

View File

@@ -36,6 +36,7 @@
sub_filter '`/api' '`%%ingress_entry%%/api';
sub_filter "'/api" "'%%ingress_entry%%/api";
sub_filter %%base_subpath%% %%ingress_entry%%/;
sub_filter recipes/releases/tag recipes/mealie/releases/tag;
sub_filter 'href="/"' 'href="%%ingress_entry%%/"';
sub_filter '"\/"' '"%%ingress_entry%%\/"';
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -1,3 +1,24 @@
## alpine-sts (30-12-2025)
- Fix: Restore official Portainer Agent image source - Fix circular dependency (Fixes #2318)
- Revert COPY --from to use official ghcr.io/portainerci/agent:latest instead of self-reference
- Restored multi-architecture support via ARG BUILD_FROM/ARG BUILD_ARCH (fixes aarch64 builds)
- Removed stderr suppression to preserve error messages for user diagnostics
- This fixes build failures that prevented users from updating
- Updated config.yaml version tag to match buildable image tag
## alpine-sts-bashio-fix (29-12-2025)
- Fix: PROTECTION MODE IS ENABLED error when protection mode is OFF (Fixes #2307)
- Update bashio from v0.17.5 → main branch for improved API error handling
- Add robust protection mode check with Docker socket fallback
- Tested and verified working on Home Assistant OS
- Fix: PROTECTION MODE IS ENABLED error when protection mode is OFF (Fixes #2307)
- Update bashio from v0.17.5 → main branch for improved API error handling
- Add robust protection mode check with Docker socket fallback
- Tested and verified working on Home Assistant OS
## alpine-sts (24-12-2025)
- Update to latest version from portainer/agent

View File

@@ -1,149 +1,117 @@
#============================#
# ALEXBELGIUM'S DOCKERFILE #
#============================#
# _.------.
# _.-` ('>.-`"alpine-sts""-.
# '.--'` _'` _ .--.)
# -' '-.-';` `
# ' - _.' ``'--.
# '---` .-'"alpine-sts"`
# /`
#=== Home Assistant Addon ===#
# Portainer Agent with bashio main + simplified protection mode check
# Fix for: FATAL: PROTECTION MODE IS ENABLED! error when protection mode is OFF
# Approach: Level 1 (standard bashio) + Level 2 (socket fallback)
#################
# 1 Build Image #
#################
# Must be declared before first FROM
ARG BUILD_FROM
# Get agent
FROM portainer/agent:alpine as original_agent
ENV PORTAINER_AGENT_ARGS="alpine-sts"
# Build using base
ARG BUILD_ARCH
FROM $BUILD_FROM
# Copy Portainer agent binaries
COPY --from=original_agent /app /app
# Step 1: Replace bashio v0.17.5 with main branch for improved API error handling
RUN rm -rf /usr/lib/bashio /usr/bin/bashio && \
curl -f -J -L -o /tmp/bashio.tar.gz \
"https://github.com/hassio-addons/bashio/archive/main.tar.gz" && \
test -f /tmp/bashio.tar.gz && test -s /tmp/bashio.tar.gz || \
(echo "ERROR: bashio download failed or file is empty" && exit 1) && \
mkdir /tmp/bashio && \
tar -xzf /tmp/bashio.tar.gz --strip 1 -C /tmp/bashio || \
(echo "ERROR: bashio tar extraction failed" && exit 1) && \
test -d /tmp/bashio/lib || \
(echo "ERROR: bashio lib directory not found after extraction" && exit 1) && \
mv /tmp/bashio/lib /usr/lib/bashio && \
ln -s /usr/lib/bashio/bashio /usr/bin/bashio && \
rm -rf /tmp/bashio /tmp/bashio.tar.gz
# Add tzdata
# Step 2: Get agent from official image
COPY --from=ghcr.io/portainerci/agent:latest /app /app
# Step 3: Add tzdata and timezone support
RUN apk add --no-cache tzdata
ADD https://github.com/golang/go/raw/master/lib/time/zoneinfo.zip /zoneinfo.zip
ENV ZONEINFO /zoneinfo.zip
##################
# 2 Modify Image #
##################
# Set S6 wait time
# Step 4: Set S6 init system wait times
ENV S6_CMD_WAIT_FOR_SERVICES=1 \
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \
S6_SERVICES_GRACETIME=0
##################
# 3 Install apps #
##################
# Step 5: Copy rootfs from official image
COPY --from=ghcr.io/portainerci/agent:latest / /
# Add rootfs
COPY rootfs/ /
# Step 6: Override the run script with simplified protection mode check
RUN mkdir -p /etc/services.d/portainer_agent
# Uses /bin for compatibility purposes
# hadolint ignore=DL4005
RUN if [ ! -f /bin/sh ] && [ -f /usr/bin/sh ]; then ln -s /usr/bin/sh /bin/sh; fi && \
if [ ! -f /bin/bash ] && [ -f /usr/bin/bash ]; then ln -s /usr/bin/bash /bin/bash; fi
RUN cat > /etc/services.d/portainer_agent/run <<'EOF'
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
set -e
# Home Assistant Community Add-on: portainer_agent
# PATCHED: Simplified protection mode check with socket fallback
# Modules
ARG MODULES="00-banner.sh 01-custom_script.sh 00-global_var.sh"
bashio::require.unprotected.fixed() {
local protected
# Automatic modules download
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_automodules.sh" "/ha_automodules.sh"
RUN chmod 744 /ha_automodules.sh && /ha_automodules.sh "$MODULES" && rm /ha_automodules.sh
bashio::log.info "Checking protection mode..."
# Manual apps
ENV PACKAGES="nginx"
# Level 1: Try standard bashio method
protected=$(bashio::addon.protected 'self' 2>/dev/null || echo "unknown")
# Automatic apps & bashio
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_autoapps.sh" "/ha_autoapps.sh"
RUN chmod 744 /ha_autoapps.sh && /ha_autoapps.sh "$PACKAGES" && rm /ha_autoapps.sh
if [[ "${protected}" != "unknown" ]]; then
# API call succeeded - use result
bashio::log.debug "Protection mode: ${protected}"
if [[ "${protected}" == "false" ]] || [[ -z "${protected}" ]]; then
return 0
fi
else
# Level 2: Fallback - Check Docker socket directly
# Logic: If protection mode is OFF, Docker socket WILL be accessible
bashio::log.warning "Could not determine protection mode via API, checking Docker socket..."
################
# 4 Entrypoint #
################
# Add entrypoint
ENV S6_STAGE2_HOOK=/ha_entrypoint.sh
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_entrypoint.sh" "/ha_entrypoint.sh"
# Entrypoint modifications
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_entrypoint_modif.sh" "/ha_entrypoint_modif.sh"
RUN chmod 777 /ha_entrypoint.sh /ha_entrypoint_modif.sh && /ha_entrypoint_modif.sh && rm /ha_entrypoint_modif.sh
# Standalone bashio command
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/bashio-standalone.sh" "/.bashio-standalone.sh"
RUN chmod 777 /.bashio-standalone.sh
RUN chmod a+x /usr/sbin/healthcheck && \
chmod a+x /usr/sbin/wait-for-signal
WORKDIR "/app"
ENTRYPOINT [ "/init" ]
############
# 5 Labels #
############
ARG BUILD_ARCH
ARG BUILD_DATE
ARG BUILD_DESCRIPTION
ARG BUILD_NAME
ARG BUILD_REF
ARG BUILD_REPOSITORY
ARG BUILD_VERSION
ENV BUILD_VERSION="${BUILD_VERSION}"
LABEL \
io.hass.name="${BUILD_NAME}" \
io.hass.description="${BUILD_DESCRIPTION}" \
io.hass.arch="${BUILD_ARCH}" \
io.hass.type="addon" \
io.hass.version=${BUILD_VERSION} \
maintainer="alexbelgium (https://github.com/alexbelgium)" \
org.opencontainers.image.title="${BUILD_NAME}" \
org.opencontainers.image.description="${BUILD_DESCRIPTION}" \
org.opencontainers.image.vendor="Home Assistant Add-ons" \
org.opencontainers.image.authors="alexbelgium (https://github.com/alexbelgium)" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.url="https://github.com/alexbelgium" \
org.opencontainers.image.source="https://github.com/${BUILD_REPOSITORY}" \
org.opencontainers.image.documentation="https://github.com/${BUILD_REPOSITORY}/blob/main/README.md" \
org.opencontainers.image.created=${BUILD_DATE} \
org.opencontainers.image.revision=${BUILD_REF} \
org.opencontainers.image.version=${BUILD_VERSION}
#################
# 6 Healthcheck #
#################
# Avoid spamming logs
# hadolint ignore=SC2016
RUN \
# Handle Apache configuration
if [ -d /etc/apache2/sites-available ]; then \
for file in /etc/apache2/sites-*/*.conf; do \
sed -i '/<VirtualHost/a \ \n # Match requests with the custom User-Agent "HealthCheck" \n SetEnvIf User-Agent "HealthCheck" dontlog \n # Exclude matching requests from access logs \n CustomLog ${APACHE_LOG_DIR}/access.log combined env=!dontlog' "$file"; \
done; \
fi && \
\
# Handle Nginx configuration
if [ -f /etc/nginx/nginx.conf ]; then \
awk '/http \{/{print; print "map $http_user_agent $dontlog {\n default 0;\n \"~*HealthCheck\" 1;\n}\naccess_log /var/log/nginx/access.log combined if=$dontlog;"; next}1' /etc/nginx/nginx.conf > /etc/nginx/nginx.conf.new && \
mv /etc/nginx/nginx.conf.new /etc/nginx/nginx.conf; \
if [ -S /run/docker.sock ]; then
bashio::log.info "Docker socket is accessible - protection mode is OFF"
return 0
else
bashio::log.fatal "Docker socket not accessible!"
return 1
fi
fi
ENV HEALTH_PORT="alpine-sts" \
HEALTH_URL="alpine-sts"
HEALTHCHECK \
--interval=5s \
--retries=5 \
--start-period=30s \
--timeout=25s \
CMD healthcheck &>/dev/null || exit 1
# If we get here, protection mode is ON
bashio::log.fatal "PROTECTION MODE IS ENABLED!"
bashio::log.fatal ""
bashio::log.fatal "To be able to use this add-on, you'll need to disable"
bashio::log.fatal "protection mode on this add-on. Without it, the add-on"
bashio::log.fatal "is unable to access Docker."
bashio::log.fatal ""
bashio::log.fatal "Steps:"
bashio::log.fatal " - Go to the Supervisor Panel."
bashio::log.fatal " - Click on this add-on."
bashio::log.fatal " - Set the 'Protection mode' switch to off."
bashio::log.fatal " - Restart the add-on."
bashio::log.fatal ""
bashio::log.fatal "Access to Docker allows you to do really powerful things"
bashio::log.fatal "including complete destruction of your system."
bashio::log.fatal "Please, be sure you know what you are doing before"
bashio::log.fatal "enabling this feature (and this add-on)!"
return 1
}
# Call our fixed function
bashio::require.unprotected.fixed
bashio::log.info "Starting Portainer Agent"
# Launch app
cd /app || true
if bashio::config.has_value 'PORTAINER_AGENT_ARGS'; then
./agent "$PORTAINER_AGENT_ARGS"
else
./agent
fi
EOF
RUN chmod +x /etc/services.d/portainer_agent/run
ENTRYPOINT ["/init"]
HEALTHCHECK --interval=5s --start-period=30s --timeout=5s --retries=3 \
CMD /usr/sbin/healthcheck || exit 1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Some files were not shown because too many files have changed in this diff Show More