Skip to content

Commit 4def825

Browse files
committed
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.
1 parent 02e8e51 commit 4def825

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

misc/data/service.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ type Config struct {
2424

2525
// PocketBase
2626
PBBaseURL string
27-
PBAuthCollection string // "_telemetry_service"
27+
PBAuthCollection string // PB auth collection name (from env)
2828
PBIdentity string // email
2929
PBPassword string
30-
PBTargetColl string // "_telemetry_data"
30+
PBTargetColl string // PB data collection name (from env)
3131

3232
// Limits
3333
MaxBodyBytes int64
@@ -743,10 +743,10 @@ func main() {
743743
TrustedProxiesCIDR: splitCSV(env("TRUSTED_PROXIES_CIDR", "")),
744744

745745
PBBaseURL: mustEnv("PB_URL"),
746-
PBAuthCollection: env("PB_AUTH_COLLECTION", "_telemetry_service"),
746+
PBAuthCollection: mustEnv("PB_AUTH_COLLECTION"),
747747
PBIdentity: mustEnv("PB_IDENTITY"),
748748
PBPassword: mustEnv("PB_PASSWORD"),
749-
PBTargetColl: env("PB_TARGET_COLLECTION", "_telemetry_data"),
749+
PBTargetColl: mustEnv("PB_TARGET_COLLECTION"),
750750

751751
MaxBodyBytes: envInt64("MAX_BODY_BYTES", 1024),
752752
RateLimitRPM: envInt("RATE_LIMIT_RPM", 60),

0 commit comments

Comments
 (0)