12 "github.com/oauth2-proxy/oauth2-proxy/v7/pkg/apis/options"
13 "github.com/oauth2-proxy/oauth2-proxy/v7/pkg/logger"
14 "github.com/oauth2-proxy/oauth2-proxy/v7/pkg/validation"
18 logger.SetFlags(logger.Lshortfile)
19 flagSet := options.NewFlagSet()
21 config := flagSet.String("config", "", "path to config file")
22 showVersion := flagSet.Bool("version", false, "print version string")
24 err := flagSet.Parse(os.Args[1:])
26 logger.Printf("ERROR: Failed to parse flags: %v", err)
31 fmt.Printf("oauth2-proxy %s (built with %s)\n", VERSION, runtime.Version())
35 legacyOpts := options.NewLegacyOptions()
36 err = options.Load(*config, flagSet, legacyOpts)
38 logger.Errorf("ERROR: Failed to load config: %v", err)
42 opts, err := legacyOpts.ToOptions()
44 logger.Errorf("ERROR: Failed to convert config: %v", err)
48 err = validation.Validate(opts)
50 logger.Printf("%s", err)
54 validator := NewValidator(opts.EmailDomains, opts.AuthenticatedEmailsFile)
55 oauthproxy, err := NewOAuthProxy(opts, validator)
57 logger.Errorf("ERROR: Failed to initialise OAuth2 Proxy: %v", err)
61 rand.Seed(time.Now().UnixNano())
66 stop: make(chan struct{}, 1),
68 // Observe signals in background goroutine.
70 sigint := make(chan os.Signal, 1)
71 signal.Notify(sigint, os.Interrupt, syscall.SIGTERM)
73 s.stop <- struct{}{} // notify having caught signal
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list