@@ -22,9 +22,6 @@ type Options struct {
2222 ProxyPrefix string `flag:"proxy-prefix" cfg:"proxy_prefix"`
2323 PingPath string `flag:"ping-path" cfg:"ping_path"`
2424 PingUserAgent string `flag:"ping-user-agent" cfg:"ping_user_agent"`
25− MetricsAddress string `flag:"metrics-address" cfg:"metrics_address"`
26− HTTPAddress string `flag:"http-address" cfg:"http_address"`
27− HTTPSAddress string `flag:"https-address" cfg:"https_address"`
2825 ReverseProxy bool `flag:"reverse-proxy" cfg:"reverse_proxy"`
2926 RealClientIPHeader string `flag:"real-client-ip-header" cfg:"real_client_ip_header"`
3027 TrustedIPs []string `flag:"trusted-ip" cfg:"trusted_ips"`
@@ -33,8 +30,6 @@ type Options struct {
3330 ClientID string `flag:"client-id" cfg:"client_id"`
3431 ClientSecret string `flag:"client-secret" cfg:"client_secret"`
3532 ClientSecretFile string `flag:"client-secret-file" cfg:"client_secret_file"`
36− TLSCertFile string `flag:"tls-cert-file" cfg:"tls_cert_file"`
37− TLSKeyFile string `flag:"tls-key-file" cfg:"tls_key_file"`
3833
3934 AuthenticatedEmailsFile string `flag:"authenticated-emails-file" cfg:"authenticated_emails_file"`
4035 KeycloakGroups []string `flag:"keycloak-group" cfg:"keycloak_groups"`
@@ -68,6 +63,9 @@ type Options struct {
6863 InjectRequestHeaders []Header `cfg:",internal"`
6964 InjectResponseHeaders []Header `cfg:",internal"`
7065
66+ Server Server `cfg:",internal"`
67+ MetricsServer Server `cfg:",internal"`
68+
7169 SkipAuthRegex []string `flag:"skip-auth-regex" cfg:"skip_auth_regex"`
7270 SkipAuthRoutes []string `flag:"skip-auth-route" cfg:"skip_auth_routes"`
7371 SkipJwtBearerTokens bool `flag:"skip-jwt-bearer-tokens" cfg:"skip_jwt_bearer_tokens"`
@@ -136,10 +134,7 @@ func NewOptions() *Options {
136134 return &Options{
137135 ProxyPrefix: "/oauth2",
138136 ProviderType: "google",
139− MetricsAddress: "",
140137 PingPath: "/ping",
141− HTTPAddress: "127.0.0.1:4180",
142− HTTPSAddress: ":443",
143138 RealClientIPHeader: "X-Real-IP",
144139 ForceHTTPS: false,
145140 Cookie: cookieDefaults(),
@@ -162,14 +157,10 @@ func NewOptions() *Options {
162157func NewFlagSet() *pflag.FlagSet {
163158 flagSet := pflag.NewFlagSet("oauth2-proxy", pflag.ExitOnError)
164159
165− flagSet.String("http-address", "127.0.0.1:4180", "[http://]<addr>:<port> or unix://<path> to listen on for HTTP clients")
166− flagSet.String("https-address", ":443", "<addr>:<port> to listen on for HTTPS clients")
167160 flagSet.Bool("reverse-proxy", false, "are we running behind a reverse proxy, controls whether headers like X-Real-Ip are accepted")
168161 flagSet.String("real-client-ip-header", "X-Real-IP", "Header used to determine the real IP of the client (one of: X-Forwarded-For, X-Real-IP, or X-ProxyUser-IP)")
169162 flagSet.StringSlice("trusted-ip", []string{}, "list of IPs or CIDR ranges to allow to bypass authentication. WARNING: trusting by IP has inherent security flaws, read the configuration documentation for more information.")
170163 flagSet.Bool("force-https", false, "force HTTPS redirect for HTTP requests")
171− flagSet.String("tls-cert-file", "", "path to certificate file")
172− flagSet.String("tls-key-file", "", "path to private key file")
173164 flagSet.String("redirect-url", "", "the OAuth Redirect URL. ie: \"https://internalapp.yourcompany.com/oauth2/callback\"")
174165 flagSet.StringSlice("skip-auth-regex", []string{}, "(DEPRECATED for --skip-auth-route) bypass authentication for requests path's that match (may be given multiple times)")
175166 flagSet.StringSlice("skip-auth-route", []string{}, "bypass authentication for requests that match the method & path. Format: method=path_regex OR path_regex alone for all methods")
@@ -204,7 +195,6 @@ func NewFlagSet() *pflag.FlagSet {
204195 flagSet.String("proxy-prefix", "/oauth2", "the url root path that this proxy should be nested under (e.g. /<oauth2>/sign_in)")
205196 flagSet.String("ping-path", "/ping", "the ping endpoint that can be used for basic health checks")
206197 flagSet.String("ping-user-agent", "", "special User-Agent that will be used for basic health checks")
207− flagSet.String("metrics-address", "", "the address /metrics will be served on (e.g. \":9100\")")
208198 flagSet.String("session-store-type", "cookie", "the session storage provider to use")
209199 flagSet.Bool("session-cookie-minimal", false, "strip OAuth tokens from cookie session stores if they aren't needed (cookie session store only)")
210200 flagSet.String("redis-connection-url", "", "URL of redis server for redis session storage (eg: redis://HOST[:PORT])")