diff --git a/cmd/totp-proxy/main.go b/cmd/totp-proxy/main.go index 1283da6..e153601 100644 --- a/cmd/totp-proxy/main.go +++ b/cmd/totp-proxy/main.go @@ -104,7 +104,7 @@ func main() { }) mhttp.CfgServer(cfg, authHandler) - if err := cfg.StartRun(context.Background(), new(mcfg.SourceCLI)); err != nil { + if err := cfg.StartRun(context.Background(), m.CfgSource()); err != nil { mlog.Fatal("error during startup", mlog.ErrKV(err)) } select {} diff --git a/m/m.go b/m/m.go index c223b28..e52ad2d 100644 --- a/m/m.go +++ b/m/m.go @@ -11,6 +11,15 @@ import ( "github.com/mediocregopher/mediocre-go-lib/mlog" ) +// CfgSource returns an mcfg.Source which takes in configuration info from the +// environment and from the CLI. +func CfgSource() mcfg.Source { + return mcfg.Sources{ + mcfg.SourceEnv{}, + mcfg.SourceCLI{}, + } +} + // TODO this isn't going to work. At some point there will be something like // mhttp which will have some glue code for it in here, but then something // within it which logs (like the http server), and then there'll be an import