merge: probe ingest endpoint + Redis store [tsk_rBPr0Xuy10bz]
This commit is contained in:
@@ -55,6 +55,14 @@ func main() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// --- Probe ingest route (optional) ---
|
// --- Probe ingest route (optional) ---
|
||||||
|
// Requires:
|
||||||
|
// PROBE_SECRETS – JSON object mapping probeId → HMAC secret, e.g.
|
||||||
|
// '{"probe-sg-01":"s3cr3t1","probe-jp-01":"s3cr3t2"}'
|
||||||
|
// REDIS_ADDR – Redis address, default 127.0.0.1:6379
|
||||||
|
// REDIS_PASSWORD – Redis password (optional)
|
||||||
|
//
|
||||||
|
// If PROBE_SECRETS is empty the route is not registered and the server
|
||||||
|
// starts normally without the probe ingest endpoint.
|
||||||
probeSecretsJSON := os.Getenv("PROBE_SECRETS")
|
probeSecretsJSON := os.Getenv("PROBE_SECRETS")
|
||||||
if probeSecretsJSON != "" {
|
if probeSecretsJSON != "" {
|
||||||
redisAddr := getenvDefault("REDIS_ADDR", "127.0.0.1:6379")
|
redisAddr := getenvDefault("REDIS_ADDR", "127.0.0.1:6379")
|
||||||
|
|||||||
Reference in New Issue
Block a user