OTA Update Server
Static file server for hosting Mirror OS remote APK updates. Runs on the homelab alongside workout-player on port 9091.
Endpoints
| Path | Description |
|---|---|
GET /api/mirror-os/version |
Version manifest (JSON) |
GET /mirror-os-remote.apk |
APK download |
GET /health |
Health check |
Deploy on Homelab
# Copy files to homelab
rsync -avz deploy/ota-server/ homelab:~/ota-server/
# Start the server
ssh homelab 'cd ~/ota-server && docker compose up -d'
The server runs nginx on port 9091 serving static files from public/.
Publish an Update
From the repo root:
# Build APK, bump version, copy to public/
./deploy/publish-apk.sh "Added new feature X"
# Then sync to homelab
rsync -avz deploy/ota-server/public/ homelab:~/ota-server/public/
The script:
- Builds the release APK via
flutter build apk --release - Copies the APK to
deploy/ota-server/public/mirror-os-remote.apk - Increments the version number in
version.json - Sets the changelog from the argument (or defaults to "Bug fixes and improvements")
How the App Checks for Updates
The remote app (apps/remote) has an update_provider.dart that:
- Fetches
http://192.168.86.172:9091/api/mirror-os/version - Compares the returned
versionnumber against the locally installed version - If newer, shows a prompt to download and install the APK from
downloadUrl
Version Manifest Format
{
"version": 1,
"downloadUrl": "http://192.168.86.172:9091/mirror-os-remote.apk",
"changelog": "Initial release"
}
The version field is a simple incrementing integer.