Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Commit

Permalink
add cert and key config options
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
  • Loading branch information
butonic committed Feb 26, 2020
1 parent 91a9b26 commit 604b24f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ func Server(cfg *config.Config) *cli.Command {
LDAPS: glauthcfg.LDAPS{
Enabled: cfg.Ldaps.Enabled,
Listen: cfg.Ldaps.Address,
Cert: cfg.Ldaps.Cert,
Key: cfg.Ldaps.Key,
},
Backend: glauthcfg.Backend{
Datastore: cfg.Backend.Datastore,
Expand Down
9 changes: 8 additions & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ type Ldap struct {
Enabled bool
}

// Ldaps defined the available LDAPS configuration.
type Ldaps struct {
Ldap
Cert string
Key string
}

// Backend defined the available backend configuration.
type Backend struct {
Datastore string
Expand All @@ -57,7 +64,7 @@ type Config struct {
HTTP HTTP
Tracing Tracing
Ldap Ldap
Ldaps Ldap
Ldaps Ldaps
Backend Backend
}

Expand Down
14 changes: 14 additions & 0 deletions pkg/flagset/flagset.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,20 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag {
EnvVars: []string{"GLAUTH_LDAPS_ENABLED"},
Destination: &cfg.Ldaps.Enabled,
},
&cli.StringFlag{
Name: "ldaps-cert",
Value: "certs/server.crt",
Usage: "path to ldaps certificate in PEM format",
EnvVars: []string{"GLAUTH_LDAPS_CERT"},
Destination: &cfg.Ldaps.Cert,
},
&cli.StringFlag{
Name: "ldaps-key",
Value: "certs/server.key",
Usage: "path to ldaps key in PEM format",
EnvVars: []string{"GLAUTH_LDAPS_KEY"},
Destination: &cfg.Ldaps.Key,
},

&cli.StringFlag{
Name: "backend-datastore",
Expand Down

0 comments on commit 604b24f

Please sign in to comment.