1.3 KiB
1.3 KiB
Security & Storage
Purpose
Explain where data lives, what is encrypted, and how keys are derived.
Prerequisites
- Box running at least once to create
box/data/
Step-by-step
- Start the box:
python3 box/main.py run
- Inspect data files:
ls -la box/data
Data layout
box/data/
├── box.json # box_id, settings, tags (plaintext)
├── state.json # resume, wifi state (plaintext)
├── media/ # audio files
└── secrets.enc # encrypted secrets (JSON inside)
What is plaintext
- box_id
- box name
- volume
- resume positions
- playback state
- media paths
- UI state
What is encrypted
- WiFi profiles
- Spotify tokens
- Server tokens (future)
Key derivation
- Key = PBKDF2-HMAC-SHA256(box_id + STATIC_SALT)
- Key is never stored on disk
- secrets.enc is not portable between boxes
Reset behavior
- WiFi reset: removes only wifi_profiles from secrets.enc
- Factory reset: delete
box/data/box.json,box/data/state.json,box/data/secrets.enc
Checklist
- ✅
secrets.encexists after WiFi/Spotify set - ✅
box.jsoncontainsbox_id - ✅ No secrets appear in
/status
Troubleshooting
- secrets.enc not created:
- Ensure you ran
wifi_add_profileorspotify_set_tokens.
- Ensure you ran
- secrets.enc unreadable after reset:
- Factory reset creates a new box_id and new key.