diff --git a/cmd/soundtouch-service/main.go b/cmd/soundtouch-service/main.go index 3d2ce5d..00063c1 100644 --- a/cmd/soundtouch-service/main.go +++ b/cmd/soundtouch-service/main.go @@ -485,6 +485,12 @@ func main() { if persisted.ServerURL == "" { log.Printf("Creating default settings.json in %s", sanitizeLog(config.dataDir)) + log.Printf("Data directory %s looks empty (first run). If you did NOT expect this "+ + "(e.g. after recreating a Docker container), your previous settings, datastore and "+ + "CA were not persisted; mount a persistent volume at the data dir (Docker: "+ + "-v :/app/data) so device state and the CA survive restarts. A lost CA "+ + "forces re-migrating speakers and re-trusting the new CA.", + sanitizeLog(config.dataDir)) persisted = createDefaultSettings(ds, config) } diff --git a/docs/content/docs/guides/EXTERNAL-HOST-WALKTHROUGH.md b/docs/content/docs/guides/EXTERNAL-HOST-WALKTHROUGH.md index 5de1ded..d5a2fa0 100644 --- a/docs/content/docs/guides/EXTERNAL-HOST-WALKTHROUGH.md +++ b/docs/content/docs/guides/EXTERNAL-HOST-WALKTHROUGH.md @@ -66,13 +66,28 @@ docker run -d \ --name aftertouch \ --network host \ -e SERVER_URL=http://192.0.2.10:8000 \ - -v aftertouch-data:/data \ + -v aftertouch-data:/app/data \ ghcr.io/gesellix/bose-soundtouch:latest ``` Replace `192.0.2.10` with the host machine's LAN IP. The `--network host` flag is required so AfterTouch can reach the speakers and respond to mDNS discovery. +> **Persist the data directory.** The container stores everything stateful under +> `/app/data` (`DATA_DIR`): the datastore, `settings.json`, and the service CA. +> Mount a volume there (`-v :/app/data`, as above) or this state is lost +> when the container is recreated. Losing the CA forces you to re-migrate every +> speaker and re-trust the new CA, so back this volume up before upgrading. + +> **Windows / macOS (Docker Desktop):** `--network host` does not work the same +> way as on Linux, so publish the ports explicitly instead, e.g. +> `-p 8000:8000 -p 8443:8443`. mDNS discovery across the Docker Desktop network +> boundary is unreliable; add speakers by IP in the Devices tab. If you also use +> DNS interception (so the speaker resolves Bose hostnames to AfterTouch), you +> additionally need to publish the DNS port (`-p 53:53/udp -p 53:53/tcp`) and +> make AfterTouch reachable on `:443` (the hardcoded Bose hosts are plain HTTPS), +> e.g. `-p 443:8443`. Keep the same `-v :/app/data` mount. + --- ## Step 2 — Note your host's LAN IP and open the Admin UI