Milestone 2 of #132. Updates manage.sh to use docker-compose.yml when present:
- start/start --with-staging (copies prod DB + config to staging)
- stop [prod|staging|all]
- status shows both containers
- logs [prod|staging]
- promote (backup prod, restart with latest image)
Legacy single-container mode preserved as fallback.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Config protection: never overwrite existing config.json, warn on placeholder values
- Port mapping validation: start/restart check if container ports match Caddyfile,
offer to recreate if mismatched
- Data volume detection: detect existing DB in $HOME/meshcore-data/ or ./data/,
use bind mount instead of named volume (never hardcodes paths)
- Real health verification: wait for /api/stats response, check HTTPS if domain
configured, scan logs for MQTT errors
- Restart recreates container with correct ports when mappings changed
- Status command: shows MQTT errors, port mismatch warnings
- Update command: uses shared recreate_container helper
- Extracted helpers: get_data_mount_args, get_required_ports, check_port_match,
recreate_container, verify_health, check_config_placeholders
Backup creates a directory with meshcore.db + config.json + Caddyfile +
theme.json (if present). Restore accepts a backup directory (restores
all files) or a single .db file (DB only). Lists available backups
when called without arguments.
- State tracking (.setup-state) — resume from where you left off
- Every step checks what's already done and skips it
- Safe to Ctrl+C and re-run at any point
- Auto-generates random API key on first config creation
- HTTPS choice menu: domain (auto), Cloudflare/proxy (HTTP), or later
- DNS validation with IP comparison
- Port 80 conflict detection
- Status shows packet/node counts, DB size, per-service health
- Backup auto-creates ./backups/ dir, restore backs up current first
- Reset command (keeps data + config, removes container + image)
- .setup-state in .gitignore