You've already forked oauth2-proxy
mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2025-06-15 00:15:00 +02:00
Ensure config flags get parsed correctly when other flags preceed them
This commit is contained in:
5
main.go
5
main.go
@ -20,6 +20,11 @@ func main() {
|
||||
logger.SetFlags(logger.Lshortfile)
|
||||
|
||||
configFlagSet := pflag.NewFlagSet("oauth2-proxy", pflag.ContinueOnError)
|
||||
|
||||
// Because we parse early to determine alpha vs legacy config, we have to
|
||||
// ignore any unknown flags for now
|
||||
configFlagSet.ParseErrorsWhitelist.UnknownFlags = true
|
||||
|
||||
config := configFlagSet.String("config", "", "path to config file")
|
||||
alphaConfig := configFlagSet.String("alpha-config", "", "path to alpha config file (use at your own risk - the structure in this config file may change between minor releases)")
|
||||
convertConfig := configFlagSet.Bool("convert-config-to-alpha", false, "if true, the proxy will load configuration as normal and convert existing configuration to the alpha config structure, and print it to stdout")
|
||||
|
Reference in New Issue
Block a user