-
-
Notifications
You must be signed in to change notification settings - Fork 0
Operations Runbook
This runbook is for day-to-day operation of a deployed Kanfei instance.
Use these checks first when diagnosing issues:
- App reachable in browser (
/) - API health by querying key endpoints:
/api/station/api/current
- Live stream functioning:
- WebSocket
/ws/live
- WebSocket
If /api/station reports disconnected, investigate the hardware connection first (serial device, network reachability, or station power).
- Ensure station connection is available:
- For serial stations: verify serial device is present
- For network stations: verify station is powered and reachable on the network
- Start logger + web stack (or
python station.py runfor single-process launch mode used in this repo workflow). - Verify
/api/stationbecomes connected. - Verify dashboard receives live updates.
python station.py status
python station.py run
python station.py dev
python station.py testsudo systemctl status kanfei-logger kanfei-web
sudo systemctl restart kanfei-logger kanfei-web
sudo journalctl -u kanfei-logger -f # tail logger logspython station.py service-status # quick status check
net stop KanfeiWeb && net stop KanfeiLogger
net start KanfeiLogger && net start KanfeiWeb
sc query KanfeiLogger # detailed Windows service state
sc query KanfeiWeb
services.msc # GUIService logs on Windows are in <repo>/logs/ (auto-rotated, 10 MB x 5 files).
Enable automatic backups in Settings > Backup or use the CLI:
python station.py backupThe built-in backup system archives the database and custom backgrounds with automatic rotation. Also back up your configuration file (.env or /etc/kanfei/kanfei.conf) separately.
See Backup and Restore Playbook for full details.
Use DB admin APIs (or Settings UI) for long-lived instances:
GET /api/db-admin/statsPOST /api/db-admin/compactDELETE /api/db-admin/purge/{table}DELETE /api/db-admin/purge-all
Always back up before purge/compact actions.
- Stop services/processes.
- Back up DB and config.
- Deploy updated code/package.
- Start services.
- Validate:
/api/station/api/current- dashboard live updates
- optional services (nowcast/uploads)
Symptoms:
- degraded responses from station endpoints
- no live sensor updates
Actions:
- Check logger process logs.
- Confirm IPC port alignment (default
6514). - For serial stations: confirm no other process owns the serial device.
- For network stations: confirm station is reachable on the network.
- Restart logger, then web app if needed.
Symptoms:
-
/api/currenttimestamp stale
Actions:
- Check station hardware connection (cable/device/power for serial; network/power for WiFi stations).
- Confirm configured connection parameters match the station.
- Use setup probe/auto-detect to validate hardware path.
- Reconnect station from setup API/UI.
Actions:
- Verify internet egress and DNS.
- Validate feature flags and credentials in config.
- Inspect relevant service logs and
/api/usage/statusfor budget gating.
- SQLite is appropriate for single-node self-host use; monitor file growth.
- Compaction and retention strategy should be part of normal operations for long-running deployments.