Merge 39d6c6696b62b7b22ad5488d7e0b34dbb0941c5c into ee420fbf2946e9f79977615cee5e29192d7da478

This commit is contained in:
Alex Westerman 2026-05-29 17:09:22 -04:00 committed by GitHub
commit 31d73eb9c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View File

@ -146,6 +146,7 @@ Configurable envs:
- `BASE_PATH`: Base path or prefix for Web UI. - `BASE_PATH`: Base path or prefix for Web UI.
- `API_BASE_URL`: Garage admin API endpoint URL. - `API_BASE_URL`: Garage admin API endpoint URL.
- `API_ADMIN_KEY`: Admin API key. - `API_ADMIN_KEY`: Admin API key.
- `API_ADMIN_KEY_FILE`: File to read the Admin API key from (overrides `API_ADMIN_KEY`)
- `S3_REGION`: S3 Region. - `S3_REGION`: S3 Region.
- `S3_ENDPOINT_URL`: S3 Endpoint url. - `S3_ENDPOINT_URL`: S3 Endpoint url.

View File

@ -86,6 +86,15 @@ func (g *garage) GetS3Region() string {
} }
func (g *garage) GetAdminKey() 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 string(key)
}
key := os.Getenv("API_ADMIN_KEY") key := os.Getenv("API_ADMIN_KEY")
if len(key) > 0 { if len(key) > 0 {
return key return key