Commit Graph

7 Commits

Author SHA1 Message Date
Kpa-clawbot 464aa3b953 feat: manage.sh Docker Compose + staging support
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>
2026-03-26 21:07:34 -07:00
you dee4a19986 fix: simplify HTTPS setup options, allow custom HTTP port 2026-03-26 01:44:16 +00:00
you 5d3f0e5642 fix: manage.sh deployment safety improvements
- 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
2026-03-26 01:38:50 +00:00
you 78e56f064f fix: use printf instead of echo -e for portable escape code rendering
echo -e doesn't work in all shells (sh on Ubuntu ignores -e).
printf '%b\n' handles escape sequences portably.
2026-03-25 01:56:47 +00:00
you 83af808162 feat: backup/restore now includes config, Caddyfile, and theme
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.
2026-03-25 00:47:36 +00:00
you e169f9c7b2 feat: rewrite manage.sh as idempotent setup wizard
- 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
2026-03-25 00:42:04 +00:00
you eaa42ed097 feat: add manage.sh helper script for setup and management
Interactive setup: checks Docker, creates config, prompts for domain,
validates DNS, builds and runs the container.

Commands: setup, start, stop, restart, status, logs, update, backup,
restore, mqtt-test. Colored output, error handling, confirmations
for destructive operations.

Updated DEPLOYMENT.md to show manage.sh as the primary quick start.
2026-03-25 00:40:08 +00:00