🔧 Update configuration files 🔧
All checks were successful
release-tag / release-image (push) Successful in 15m20s

.claude/
rootfs/usr/local/bin/entrypoint.sh
This commit is contained in:
casjay
2025-12-16 15:34:40 -05:00
parent f002e3ef82
commit 1732b44480
2 changed files with 51 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
{
"permissions": {
"allow": [
"Bash(cat:*)",
"Bash(docker build:*)",
"Bash(docker run:*)",
"Bash(docker logs:*)",
"Bash(docker exec:*)",
"Bash(docker inspect:*)",
"Bash(docker stop:*)",
"Bash(time docker exec:*)"
]
}
}

View File

@@ -63,6 +63,43 @@ case "$1" in
;;
esac
# - - - - - - - - - - - - - - - - - - - - - - - - -
# Fast path for healthcheck - skip all initialization to avoid timeouts and duplicate processes
if [ "$1" = "healthcheck" ]; then
healthStatus=0
healthEnabled="${HEALTH_ENABLED:-yes}"
SERVICES_LIST="${SERVICES_LIST:-tini}"
services="$(echo "${SERVICES_LIST//,/ }")"
[ "$healthEnabled" = "yes" ] || exit 0
# Add services from /run/healthcheck directory
if [ -d "/run/healthcheck" ] && [ "$(ls -A "/run/healthcheck" 2>/dev/null | wc -l)" -ne 0 ]; then
for service in /run/healthcheck/*; do
name=$(basename -- "$service")
services+=" $name"
done
fi
services="$(echo "$services" | tr ' ' '\n' | sort -u | grep -v '^$')"
# Check if services are running
for proc in $services; do
if [ -n "$proc" ]; then
if ! pgrep -x "$proc" >/dev/null 2>&1; then
echo "$proc is not running" >&2
healthStatus=$((healthStatus + 1))
fi
fi
done
# Check endpoints if configured
for endpoint in ${HEALTH_ENDPOINTS//,/ }; do
if [ -n "$endpoint" ]; then
if ! curl -sSfkL --max-time 3 "$endpoint" >/dev/null 2>&1; then
echo "Can not connect to $endpoint" >&2
healthStatus=$((healthStatus + 1))
fi
fi
done
[ "$healthStatus" -eq 0 ] && echo "Everything seems to be running"
exit $healthStatus
fi
# - - - - - - - - - - - - - - - - - - - - - - - - -
# Create the default env files
__create_env_file "/config/env/default.sh" "/root/env.sh" &>/dev/null
# - - - - - - - - - - - - - - - - - - - - - - - - -