From 74ccfbbddb7acc2850172883402d042f84142baa Mon Sep 17 00:00:00 2001 From: Alex Westerman Date: Fri, 29 May 2026 16:56:57 -0400 Subject: [PATCH] Add ability to read Admin key from env var path --- backend/utils/garage.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/backend/utils/garage.go b/backend/utils/garage.go index bde29ab..6c23fbe 100644 --- a/backend/utils/garage.go +++ b/backend/utils/garage.go @@ -86,6 +86,15 @@ func (g *garage) GetS3Region() string { } func (g *garage) GetAdminKey() string { + keyPath := os.Getenv("API_ADMIN_KEY_FILE") + if len(keyPath) > 0 { + key, err := os.ReadFile(keyPath) + if err != nil { + log.Fatal(err) + } + return key + } + key := os.Getenv("API_ADMIN_KEY") if len(key) > 0 { return key