Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ It is also possible to configure the allowlist via environment variables. The va

If both commandline parameter and environment variable is configured for a particular HTTP method, the environment variable is ignored.

Use Go's regexp syntax to create the patterns for these parameters. To avoid insecure configurations, the characters ^ at the beginning and $ at the end of the string are automatically added. Note: invalid regexp results in program termination.
Use Go's regexp syntax to create the patterns for these parameters. To avoid insecure configurations, the characters ^ at the beginning and $ at the end of the string are automatically added. Note: invalid regexp results in program termination. It also will be expanded with environment variables.

Examples (command line):
+ `'-allowGET=/v1\..{1,2}/(version|containers/.*|events.*)'` could be used for allowing access to the docker socket for Traefik v2.
Expand Down
5 changes: 5 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ func InitConfig() (*Config, error) {
}
flag.Parse()

for i := range mr {
mr[i].regexStringFromParam = os.ExpandEnv(mr[i].regexStringFromParam)
mr[i].regexStringFromEnv = os.ExpandEnv(mr[i].regexStringFromEnv)
}

// check listenIP and proxyPort
if net.ParseIP(listenIP) == nil {
return nil, fmt.Errorf("invalid IP \"%s\" for listenip", listenIP)
Expand Down