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

default to config backend #6

Merged
merged 1 commit into from
Mar 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: "admin@example.com",
PassSHA256: "8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918", // admin
},
glauthcfg.User{
Name: "demo",
UnixID: 20001,
PrimaryGroup: 30000,
Mail: "demo@example.com",
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