mirror of
https://github.com/khairul169/garage-webui.git
synced 2026-06-12 05:36:20 +07:00
Add ability to read Admin key from env var path
This commit is contained in:
parent
ee420fbf29
commit
74ccfbbddb
@ -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 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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user