Skip to content

Commit b055dae

Browse files
committed
feat: add env-delim support for env vars
Signed-off-by: Liam Stanley <[email protected]>
1 parent a57a86a commit b055dae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/models/flags.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ type Flags struct {
1414

1515
type ConfigHTTP struct {
1616
BindAddr string `env:"BIND_ADDR" long:"bind-addr" default:":8080" required:"true" description:"ip:port pair to bind to"`
17-
TrustedProxies []string `env:"TRUSTED_PROXIES" long:"trusted-proxies" description:"CIDR ranges that we trust the X-Forwarded-For header from (addl opts: local, *, cloudflare, and/or custom header to use)"`
17+
TrustedProxies []string `env:"TRUSTED_PROXIES" long:"trusted-proxies" env-delim:"," description:"CIDR ranges that we trust the X-Forwarded-For header from (addl opts: local, *, cloudflare, and/or custom header to use)"`
1818
MaxConcurrent int `env:"MAX_CONCURRENT" long:"max-concurrent" description:"limit total max concurrent requests across all connections (0 for no limit)"`
1919
Limit int `env:"LIMIT" long:"limit" description:"number of requests/ip/hour" default:"2000"`
2020
HSTS bool `env:"HSTS" long:"hsts" description:"enable HTTP Strict Transport Security"`
21-
CORS []string `env:"CORS" long:"cors" default:"*" description:"CORS allowed origins"`
21+
CORS []string `env:"CORS" long:"cors" env-delim:"," default:"*" description:"CORS allowed origins"`
2222
}
2323

2424
type ConfigDB struct {
@@ -36,7 +36,7 @@ type ConfigDB struct {
3636
}
3737

3838
type ConfigDNS struct {
39-
Resolvers []string `env:"RESOLVERS" long:"resolver" description:"resolver (in host:port form) to use for dns lookups (doesn't work with windows and plan9) (can be used multiple times)"`
39+
Resolvers []string `env:"RESOLVERS" long:"resolver" env-delim:"," description:"resolver (in host:port form) to use for dns lookups (doesn't work with windows and plan9) (can be used multiple times)"`
4040
Local bool `env:"LOCAL" long:"uselocal" description:"adds local (system) resolvers to the list of resolvers to use"`
4141
CacheSize int `env:"CACHE_SIZE" long:"size" description:"total number of lookups to keep in ARC cache (50% most recent, 50% most requested)" default:"500"`
4242
CacheExpire time.Duration `env:"CACHE_EXPIRE" long:"expire" description:"expiration time of cache" default:"1h"`

0 commit comments

Comments
 (0)