mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-04-26 16:27:20 +00:00
## Summary Implements the `DISABLE_CADDY` environment variable in the Docker entrypoint, fixing #629. ## Problem The `DISABLE_CADDY` env var was documented but had no effect — the entrypoint only handled `DISABLE_MOSQUITTO`. ## Changes ### New supervisord configs - **`supervisord-go-no-caddy.conf`** — mosquitto + ingestor + server (no Caddy) - **`supervisord-go-no-mosquitto-no-caddy.conf`** — ingestor + server only ### Updated entrypoint (`docker/entrypoint-go.sh`) Handles all 4 combinations: | DISABLE_MOSQUITTO | DISABLE_CADDY | Config used | |---|---|---| | false | false | `supervisord.conf` (default) | | true | false | `supervisord-no-mosquitto.conf` | | false | true | `supervisord-no-caddy.conf` | | true | true | `supervisord-no-mosquitto-no-caddy.conf` | ### Dockerfiles Added COPY lines for the new configs in both `Dockerfile` and `Dockerfile.go`. ## Testing ```bash # Verify correct config selection docker run -e DISABLE_CADDY=true corescope # Should log: [config] Caddy reverse proxy disabled (DISABLE_CADDY=true) docker run -e DISABLE_CADDY=true -e DISABLE_MOSQUITTO=true corescope # Should log both disabled messages ``` Fixes #629 Co-authored-by: you <you@example.com>
31 lines
1.4 KiB
Bash
31 lines
1.4 KiB
Bash
#!/bin/sh
|
|
|
|
# Config lives in the data directory (bind-mounted from host)
|
|
# The Go server already searches /app/data/config.json via LoadConfig
|
|
# but the ingestor expects a direct path — symlink for compatibility
|
|
if [ -f /app/data/config.json ]; then
|
|
ln -sf /app/data/config.json /app/config.json
|
|
elif [ ! -f /app/config.json ]; then
|
|
echo "[entrypoint] No config.json found in /app/data/ — using built-in defaults"
|
|
fi
|
|
|
|
# theme.json: check data/ volume (admin-editable on host)
|
|
if [ -f /app/data/theme.json ]; then
|
|
ln -sf /app/data/theme.json /app/theme.json
|
|
fi
|
|
|
|
SUPERVISORD_CONF="/etc/supervisor/conf.d/supervisord.conf"
|
|
if [ "${DISABLE_MOSQUITTO:-false}" = "true" ] && [ "${DISABLE_CADDY:-false}" = "true" ]; then
|
|
echo "[config] internal MQTT broker disabled (DISABLE_MOSQUITTO=true)"
|
|
echo "[config] Caddy reverse proxy disabled (DISABLE_CADDY=true)"
|
|
SUPERVISORD_CONF="/etc/supervisor/conf.d/supervisord-no-mosquitto-no-caddy.conf"
|
|
elif [ "${DISABLE_MOSQUITTO:-false}" = "true" ]; then
|
|
echo "[config] internal MQTT broker disabled (DISABLE_MOSQUITTO=true)"
|
|
SUPERVISORD_CONF="/etc/supervisor/conf.d/supervisord-no-mosquitto.conf"
|
|
elif [ "${DISABLE_CADDY:-false}" = "true" ]; then
|
|
echo "[config] Caddy reverse proxy disabled (DISABLE_CADDY=true)"
|
|
SUPERVISORD_CONF="/etc/supervisor/conf.d/supervisord-no-caddy.conf"
|
|
fi
|
|
|
|
exec /usr/bin/supervisord -c "$SUPERVISORD_CONF"
|