feat: plugin fault isolation notices + NUT managed mode fixes
Plugin failures: - Track load-time failures in _FAILED_PLUGINS dict with human-readable reasons - Inject plugin_failures into all templates via context processor - Show admin-only warning banner in base.html when any plugin fails to load - Show inline failure notice per plugin card in Settings → Plugins NUT managed mode: - entrypoint.sh: make nut_setup.py failure non-fatal so the container starts even if nut_ups_host isn't set yet (allows fixing config via UI) - save_plugins: when nut_managed is enabled, auto-set nut_host=localhost so the plugin connects to the managed NUT instance without extra manual config Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+17
-8
@@ -24,22 +24,31 @@ set -e
|
||||
NUT_MANAGED_JSON="/data/nut_managed.json"
|
||||
|
||||
if [ "${NUT_MANAGED:-0}" = "1" ] || [ -f "$NUT_MANAGED_JSON" ]; then
|
||||
NUT_OK=1
|
||||
if [ -f "$NUT_MANAGED_JSON" ]; then
|
||||
echo "[entrypoint] Found $NUT_MANAGED_JSON — configuring NUT from settings..."
|
||||
python3 /app/fabledscryer/nut_setup.py --from-file "$NUT_MANAGED_JSON"
|
||||
python3 /app/fabledscryer/nut_setup.py --from-file "$NUT_MANAGED_JSON" || {
|
||||
echo "[entrypoint] Warning: NUT config failed — UPS host may not be set yet. Skipping NUT startup."
|
||||
NUT_OK=0
|
||||
}
|
||||
else
|
||||
echo "[entrypoint] NUT_MANAGED=1 — configuring NUT from environment..."
|
||||
python3 /app/fabledscryer/nut_setup.py
|
||||
python3 /app/fabledscryer/nut_setup.py || {
|
||||
echo "[entrypoint] Warning: NUT config failed — check NUT_UPS_HOST. Skipping NUT startup."
|
||||
NUT_OK=0
|
||||
}
|
||||
fi
|
||||
|
||||
echo "[entrypoint] Starting NUT driver..."
|
||||
/sbin/upsdrvctl start || echo "[entrypoint] Warning: upsdrvctl returned non-zero"
|
||||
if [ "$NUT_OK" = "1" ]; then
|
||||
echo "[entrypoint] Starting NUT driver..."
|
||||
/sbin/upsdrvctl start || echo "[entrypoint] Warning: upsdrvctl returned non-zero"
|
||||
|
||||
echo "[entrypoint] Starting NUT daemon..."
|
||||
/sbin/upsd || echo "[entrypoint] Warning: upsd returned non-zero"
|
||||
echo "[entrypoint] Starting NUT daemon..."
|
||||
/sbin/upsd || echo "[entrypoint] Warning: upsd returned non-zero"
|
||||
|
||||
sleep 1
|
||||
echo "[entrypoint] NUT ready on 127.0.0.1:3493."
|
||||
sleep 1
|
||||
echo "[entrypoint] NUT ready on 127.0.0.1:3493."
|
||||
fi
|
||||
fi
|
||||
|
||||
exec gosu app "$@"
|
||||
|
||||
Reference in New Issue
Block a user