Skip to content

Commit

Permalink
Merge pull request #6 from butonic/config-backend
Browse files Browse the repository at this point in the history
default to config backend
  • Loading branch information
DeepDiver1975 authored Mar 17, 2020
2 parents deb9d0a + 3277311 commit 4e1a5ad
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,29 @@ func Server(cfg *config.Config) *cli.Command {
SSHKeyAttr: cfg.Backend.SSHKeyAttr,
UseGraphAPI: cfg.Backend.UseGraphAPI,
},
// TODO read users for the config backend from config file
Users: []glauthcfg.User{
glauthcfg.User{
Name: "admin",
UnixID: 20000,
PrimaryGroup: 30000,
Mail: "[email protected]",
PassSHA256: "8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918", // admin
},
glauthcfg.User{
Name: "demo",
UnixID: 20001,
PrimaryGroup: 30000,
Mail: "[email protected]",
PassSHA256: "2a97516c354b68848cdbd8f54a226a0a55b21ed138e207ad6c5cbb9c00aa5aea", // demo
},
},
Groups: []glauthcfg.Group{
glauthcfg.Group{
Name: "users",
UnixID: 30000,
},
},
}
server, err := glauth.NewServer(
glauth.Logger(log),
Expand Down
2 changes: 1 addition & 1 deletion pkg/flagset/flagset.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag {

&cli.StringFlag{
Name: "backend-datastore",
Value: "owncloud",
Value: "config",
Usage: "datastore to use as the backend. one of config, ldap or owncloud",
EnvVars: []string{"GLAUTH_BACKEND_DATASTORE"},
Destination: &cfg.Backend.Datastore,
Expand Down

0 comments on commit 4e1a5ad

Please sign in to comment.