@@ -53,14 +53,11 @@ type Options struct {
5353 GoogleAdminEmail string `flag:"google-admin-email" cfg:"google_admin_email"`
5454 GoogleServiceAccountJSON string `flag:"google-service-account-json" cfg:"google_service_account_json"`
5555 HtpasswdFile string `flag:"htpasswd-file" cfg:"htpasswd_file"`
56− DisplayHtpasswdForm bool `flag:"display-htpasswd-form" cfg:"display_htpasswd_form"`
57− CustomTemplatesDir string `flag:"custom-templates-dir" cfg:"custom_templates_dir"`
58− Banner string `flag:"banner" cfg:"banner"`
59− Footer string `flag:"footer" cfg:"footer"`
6056
61− Cookie Cookie `cfg:",squash"`
62− Session SessionOptions `cfg:",squash"`
63− Logging Logging `cfg:",squash"`
57+ Cookie Cookie `cfg:",squash"`
58+ Session SessionOptions `cfg:",squash"`
59+ Logging Logging `cfg:",squash"`
60+ Templates Templates `cfg:",squash"`
6461
6562 // Not used in the legacy config, name not allowed to match an external key (upstreams)
6663 // TODO(JoelSpeed): Rename when legacy config is removed
@@ -135,16 +132,17 @@ func (o *Options) SetRealClientIPParser(s ipapi.RealClientIPParser) { o.realClie
135132// NewOptions constructs a new Options with defaulted values
136133func NewOptions() *Options {
137134 return &Options{
138− ProxyPrefix: "/oauth2",
139− ProviderType: "google",
140− PingPath: "/ping",
141− HTTPAddress: "127.0.0.1:4180",
142− HTTPSAddress: ":443",
143− RealClientIPHeader: "X-Real-IP",
144− ForceHTTPS: false,
145− DisplayHtpasswdForm: true,
135+ ProxyPrefix: "/oauth2",
136+ ProviderType: "google",
137+ PingPath: "/ping",
138+ HTTPAddress: "127.0.0.1:4180",
139+ HTTPSAddress: ":443",
140+ RealClientIPHeader: "X-Real-IP",
141+ ForceHTTPS: false,
142+
146143 Cookie: cookieDefaults(),
147144 Session: sessionOptionsDefaults(),
145+ Templates: templatesDefaults(),
148146 AzureTenant: "common",
149147 SkipAuthPreflight: false,
150148 Prompt: "", // Change to "login" when ApprovalPrompt officially deprecated
@@ -200,10 +198,6 @@ func NewFlagSet() *pflag.FlagSet {
200198 flagSet.String("client-secret-file", "", "the file with OAuth Client Secret")
201199 flagSet.String("authenticated-emails-file", "", "authenticate against emails via file (one per line)")
202200 flagSet.String("htpasswd-file", "", "additionally authenticate against a htpasswd file. Entries must be created with \"htpasswd -B\" for bcrypt encryption")
203− flagSet.Bool("display-htpasswd-form", true, "display username / password login form if an htpasswd file is provided")
204− flagSet.String("custom-templates-dir", "", "path to custom html templates")
205− flagSet.String("banner", "", "custom banner string. Use \"-\" to disable default banner.")
206− flagSet.String("footer", "", "custom footer string. Use \"-\" to disable default footer.")
207201 flagSet.String("proxy-prefix", "/oauth2", "the url root path that this proxy should be nested under (e.g. /<oauth2>/sign_in)")
208202 flagSet.String("ping-path", "/ping", "the ping endpoint that can be used for basic health checks")
209203 flagSet.String("ping-user-agent", "", "special User-Agent that will be used for basic health checks")
@@ -251,6 +245,7 @@ func NewFlagSet() *pflag.FlagSet {
251245
252246 flagSet.AddFlagSet(cookieFlagSet())
253247 flagSet.AddFlagSet(loggingFlagSet())
248+ flagSet.AddFlagSet(templatesFlagSet())
254249
255250 return flagSet
256251}