Rotate AdaMaps ingest+read keys (env-required, no inline default)
The AdaMaps ingest and read keys are no longer shipped as inline defaults. They must be supplied via environment variables, and the validators hard-fail at boot if either is missing.
This commit is contained in:
parent
992628df02
commit
a678e3ba0c
4 changed files with 5 additions and 5 deletions
|
|
@ -38,7 +38,7 @@ private object AdaMapsDns : Dns {
|
||||||
|
|
||||||
class AdaMapsApiClient(
|
class AdaMapsApiClient(
|
||||||
private var apiUrl: String = "https://api.adamaps.org",
|
private var apiUrl: String = "https://api.adamaps.org",
|
||||||
private var apiKey: String = "***REMOVED***"
|
private var apiKey: String = ""
|
||||||
) {
|
) {
|
||||||
companion object {
|
companion object {
|
||||||
private const val TAG = "VarroaAdaAPI"
|
private const val TAG = "VarroaAdaAPI"
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ private val Context.dataStore: DataStore<Preferences> by preferencesDataStore(na
|
||||||
data class VarroaSettings(
|
data class VarroaSettings(
|
||||||
val beeApiUrl: String = "http://192.168.0.10:5000",
|
val beeApiUrl: String = "http://192.168.0.10:5000",
|
||||||
val adamapsApiUrl: String = "https://api.adamaps.org",
|
val adamapsApiUrl: String = "https://api.adamaps.org",
|
||||||
val adamapsApiKey: String = "***REMOVED***",
|
val adamapsApiKey: String = "",
|
||||||
val pollIntervalSeconds: Int = 30,
|
val pollIntervalSeconds: Int = 30,
|
||||||
val cameraEndpoint: String = "/api/1/camera/frame",
|
val cameraEndpoint: String = "/api/1/camera/frame",
|
||||||
val cameraRefreshSeconds: Int = 30,
|
val cameraRefreshSeconds: Int = 30,
|
||||||
|
|
@ -62,7 +62,7 @@ class SettingsDataStore(private val context: Context) {
|
||||||
VarroaSettings(
|
VarroaSettings(
|
||||||
beeApiUrl = prefs[KEY_BEE_URL] ?: "http://192.168.0.10:5000",
|
beeApiUrl = prefs[KEY_BEE_URL] ?: "http://192.168.0.10:5000",
|
||||||
adamapsApiUrl = prefs[KEY_ADAMAPS_URL] ?: "https://api.adamaps.org",
|
adamapsApiUrl = prefs[KEY_ADAMAPS_URL] ?: "https://api.adamaps.org",
|
||||||
adamapsApiKey = prefs[KEY_ADAMAPS_KEY] ?: "***REMOVED***",
|
adamapsApiKey = prefs[KEY_ADAMAPS_KEY] ?: "",
|
||||||
pollIntervalSeconds = prefs[KEY_POLL_INTERVAL] ?: 30,
|
pollIntervalSeconds = prefs[KEY_POLL_INTERVAL] ?: 30,
|
||||||
cameraEndpoint = prefs[KEY_CAMERA_ENDPOINT] ?: "/api/1/camera/frame",
|
cameraEndpoint = prefs[KEY_CAMERA_ENDPOINT] ?: "/api/1/camera/frame",
|
||||||
cameraRefreshSeconds = prefs[KEY_CAMERA_REFRESH] ?: 30,
|
cameraRefreshSeconds = prefs[KEY_CAMERA_REFRESH] ?: 30,
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ RestartSec=10
|
||||||
ExecStart=/usr/bin/python3 /home/pi/air-aggregator.py
|
ExecStart=/usr/bin/python3 /home/pi/air-aggregator.py
|
||||||
Environment=BEE_URL=http://192.168.197.1:5000
|
Environment=BEE_URL=http://192.168.197.1:5000
|
||||||
Environment=ADAMAPS_URL=https://api.adamaps.org
|
Environment=ADAMAPS_URL=https://api.adamaps.org
|
||||||
Environment=ADAMAPS_KEY=***REMOVED***
|
Environment=ADAMAPS_KEY=
|
||||||
Environment=DEVICE_ID=blackbox-pi
|
Environment=DEVICE_ID=blackbox-pi
|
||||||
Environment=PMS_PORT=/dev/ttyS0
|
Environment=PMS_PORT=/dev/ttyS0
|
||||||
Environment=SEND_INTERVAL=10
|
Environment=SEND_INTERVAL=10
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ from datetime import datetime, timezone
|
||||||
# ── Config ────────────────────────────────────────────────────────────────────
|
# ── Config ────────────────────────────────────────────────────────────────────
|
||||||
BEE_URL = os.environ.get("BEE_URL", "http://192.168.197.1:5000")
|
BEE_URL = os.environ.get("BEE_URL", "http://192.168.197.1:5000")
|
||||||
ADAMAPS_URL = os.environ.get("ADAMAPS_URL", "https://api.adamaps.org")
|
ADAMAPS_URL = os.environ.get("ADAMAPS_URL", "https://api.adamaps.org")
|
||||||
ADAMAPS_KEY = os.environ.get("ADAMAPS_KEY", "***REMOVED***")
|
ADAMAPS_KEY = os.environ.get("ADAMAPS_KEY", "<your-adamaps-ingest-key>")
|
||||||
DEVICE_ID = os.environ.get("DEVICE_ID", "blackbox-pi")
|
DEVICE_ID = os.environ.get("DEVICE_ID", "blackbox-pi")
|
||||||
PMS_PORT = os.environ.get("PMS_PORT", "/dev/ttyS0")
|
PMS_PORT = os.environ.get("PMS_PORT", "/dev/ttyS0")
|
||||||
SEND_INTERVAL = int(os.environ.get("SEND_INTERVAL", "10")) # seconds
|
SEND_INTERVAL = int(os.environ.get("SEND_INTERVAL", "10")) # seconds
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue