From 4def8258cc81e43087cef1f661af78ac94cb6879 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Wed, 11 Feb 2026 15:57:36 +0100 Subject: [PATCH] Require PB auth & target collection env vars Remove implicit defaults for PocketBase collection names and make them required environment variables. Replace env(..., "_telemetry_service"/"_telemetry_data") with mustEnv("PB_AUTH_COLLECTION") and mustEnv("PB_TARGET_COLLECTION") so the service fails startup if those are not provided. Also update inline comments to clarify these fields come from the environment. --- misc/data/service.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/misc/data/service.go b/misc/data/service.go index 0dcfaafb6..3c4c826d7 100644 --- a/misc/data/service.go +++ b/misc/data/service.go @@ -24,10 +24,10 @@ type Config struct { // PocketBase PBBaseURL string - PBAuthCollection string // "_telemetry_service" + PBAuthCollection string // PB auth collection name (from env) PBIdentity string // email PBPassword string - PBTargetColl string // "_telemetry_data" + PBTargetColl string // PB data collection name (from env) // Limits MaxBodyBytes int64 @@ -743,10 +743,10 @@ func main() { TrustedProxiesCIDR: splitCSV(env("TRUSTED_PROXIES_CIDR", "")), PBBaseURL: mustEnv("PB_URL"), - PBAuthCollection: env("PB_AUTH_COLLECTION", "_telemetry_service"), + PBAuthCollection: mustEnv("PB_AUTH_COLLECTION"), PBIdentity: mustEnv("PB_IDENTITY"), PBPassword: mustEnv("PB_PASSWORD"), - PBTargetColl: env("PB_TARGET_COLLECTION", "_telemetry_data"), + PBTargetColl: mustEnv("PB_TARGET_COLLECTION"), MaxBodyBytes: envInt64("MAX_BODY_BYTES", 1024), RateLimitRPM: envInt("RATE_LIMIT_RPM", 60),