mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-05-31 11:51:20 +08:00
Merge pull request #3448 from LongDinhh/feat/home-env-vars
feat(server): add HOME_ADDR and HOME_PASSWORD env var fallback
This commit is contained in:
@@ -299,6 +299,19 @@ func main() {
|
||||
return "", false
|
||||
}
|
||||
writableBase := util.WritablePath()
|
||||
|
||||
// Allow env var fallback for home flags so they can be configured without command args.
|
||||
if strings.TrimSpace(homeAddr) == "" {
|
||||
if v, ok := lookupEnv("HOME_ADDR", "home_addr"); ok {
|
||||
homeAddr = v
|
||||
}
|
||||
}
|
||||
if strings.TrimSpace(homePassword) == "" {
|
||||
if v, ok := lookupEnv("HOME_PASSWORD", "home_password"); ok {
|
||||
homePassword = v
|
||||
}
|
||||
}
|
||||
|
||||
if value, ok := lookupEnv("PGSTORE_DSN", "pgstore_dsn"); ok {
|
||||
usePostgresStore = true
|
||||
pgStoreDSN = value
|
||||
|
||||
Reference in New Issue
Block a user