9f122f47aa
Make a fresh deploy (especially Docker) work with no manual steps and behave well on real-world hosts: - Auto-scan skips subnets larger than /20 (e.g. a docker bridge 172.17.0.0/16 = 65k hosts) so AUTO discovery no longer stalls startup or hammers the network on any host with Docker. Manual scan shares the same MIN_SCAN_PREFIX. - Docker: config.json is auto-seeded from config.json.example by a new docker-entrypoint.sh and persisted on a ./data directory mount — no more single-file bind-mount footgun, no manual cp before first run. - Config path is overridable via ADSBIT_CONFIG (defaults to ./config.json for bare metal; /app/data/config.json in the container). - New /health endpoint (status/version/receivers/flights) + Docker HEALTHCHECK. - Clean SIGTERM/SIGINT shutdown (docker stop / systemctl stop) — no traceback. - .gitignore/.dockerignore exclude the data/ config volume. - README/CLAUDE.md updated; VERSION bumped to 1.1.1. Verified: image builds, fresh `docker run` seeds config and reports healthy, oversized subnets skipped in-container, /health responds, graceful shutdown. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
17 lines
510 B
Bash
17 lines
510 B
Bash
#!/bin/sh
|
|
# Seed a config file on first run so `docker compose up` works on a fresh
|
|
# clone with no manual steps. The config lives on a mounted data volume so it
|
|
# persists across container rebuilds.
|
|
set -e
|
|
|
|
: "${ADSBIT_CONFIG:=/app/config.json}"
|
|
CONFIG_DIR=$(dirname "$ADSBIT_CONFIG")
|
|
mkdir -p "$CONFIG_DIR"
|
|
|
|
if [ ! -f "$ADSBIT_CONFIG" ]; then
|
|
echo "[entrypoint] No config at $ADSBIT_CONFIG — seeding from config.json.example"
|
|
cp /app/config.json.example "$ADSBIT_CONFIG"
|
|
fi
|
|
|
|
exec python3 server.py
|