This commit is contained in:
Striker72rus 2026-03-25 15:45:45 +03:00
parent 335b7bee5a
commit 854ed61add
4 changed files with 30 additions and 6 deletions

13
run.sh
View File

@ -17,17 +17,28 @@ export WALL_PANEL_CONFIG_PATH="$CONFIG_PATH"
export WALL_PANEL_STORAGE_DIR="$STORAGE_DIR" export WALL_PANEL_STORAGE_DIR="$STORAGE_DIR"
export WALL_PANEL_RUNTIME_MODE="$RUNTIME_MODE" export WALL_PANEL_RUNTIME_MODE="$RUNTIME_MODE"
log() {
echo "[wall_panel] $*"
}
log "starting standalone runtime on port ${PORT} (mode=${RUNTIME_MODE})"
log "config path: ${CONFIG_PATH}"
log "storage dir: ${STORAGE_DIR}"
if [ "$RUNTIME_MODE" = "addon" ]; then if [ "$RUNTIME_MODE" = "addon" ]; then
( (
i=0 i=0
while [ "$i" -lt 120 ]; do while [ "$i" -lt 120 ]; do
log "registering ingress attempt $((i + 1))/120"
if php -r 'require "/app/lib/bootstrap.php"; $config = app_load_config(); exit(app_register_ingress_url($config) ? 0 : 1);' >/dev/null 2>&1; then if php -r 'require "/app/lib/bootstrap.php"; $config = app_load_config(); exit(app_register_ingress_url($config) ? 0 : 1);' >/dev/null 2>&1; then
log "ingress registered"
exit 0 exit 0
fi fi
i=$((i + 1)) i=$((i + 1))
sleep 2 sleep 2
done done
) >/dev/null 2>&1 || true & log "ingress registration failed after retries"
) || true &
fi fi
exec php -S "0.0.0.0:${PORT}" -t "$DOCROOT" exec php -S "0.0.0.0:${PORT}" -t "$DOCROOT"

View File

@ -1,6 +1,6 @@
{ {
"active": false, "active": false,
"sensor_entity_id": "binary_sensor.doorbell_all_occupancy", "sensor_entity_id": "binary_sensor.barn_all_occupancy",
"opened_at": 1774441493, "opened_at": 1774442675,
"expires_at": null "expires_at": null
} }

View File

@ -1,6 +1,6 @@
name: Wall Panel name: Wall Panel
description: Wall Panel PHP interface as a Home Assistant add-on description: Wall Panel PHP interface as a Home Assistant add-on
version: "1.0.12" version: "1.0.13"
slug: wall_panel slug: wall_panel
url: https://git.striker72rus.ru/PHP/wallpanell.git url: https://git.striker72rus.ru/PHP/wallpanell.git
init: false init: false
@ -15,6 +15,8 @@ ingress: true
ingress_port: 8099 ingress_port: 8099
panel_title: Wall Panel panel_title: Wall Panel
panel_icon: mdi:view-dashboard panel_icon: mdi:view-dashboard
hassio_api: true
hassio_role: default
ports: ports:
8099/tcp: 8099 8099/tcp: 8099
ports_description: ports_description:

View File

@ -16,15 +16,26 @@ export WALL_PANEL_CONFIG_PATH="$CONFIG_PATH"
export WALL_PANEL_STORAGE_DIR="$STORAGE_DIR" export WALL_PANEL_STORAGE_DIR="$STORAGE_DIR"
export WALL_PANEL_RUNTIME_MODE="addon" export WALL_PANEL_RUNTIME_MODE="addon"
log() {
echo "[wall_panel] $*"
}
log "starting add-on on port ${PORT}"
log "config path: ${CONFIG_PATH}"
log "storage dir: ${STORAGE_DIR}"
( (
i=0 i=0
while [ "$i" -lt 120 ]; do while [ "$i" -lt 120 ]; do
log "registering ingress attempt $((i + 1))/120"
if php -r 'require "/app/lib/bootstrap.php"; $config = app_load_config(); exit(app_register_ingress_url($config) ? 0 : 1);' >/dev/null 2>&1; then if php -r 'require "/app/lib/bootstrap.php"; $config = app_load_config(); exit(app_register_ingress_url($config) ? 0 : 1);' >/dev/null 2>&1; then
log "ingress registered"
exit 0 exit 0
fi fi
i=$((i + 1)) i=$((i + 1))
sleep 2 sleep 2
done done
) >/dev/null 2>&1 || true & log "ingress registration failed after retries"
) || true &
exec php -S "0.0.0.0:${PORT}" -t "$DOCROOT" exec php -S "0.0.0.0:${PORT}" -t "$DOCROOT"