diff --git a/cmd/stepd/main.go b/cmd/stepd/main.go index 566e708..240e893 100644 --- a/cmd/stepd/main.go +++ b/cmd/stepd/main.go @@ -116,6 +116,23 @@ func main () { if err != nil { log.Fatal(err) } // TODO: load plugins + pluginPath := os.Getenv("STEP_PLUGIN_PATH") + if pluginPath == "" { + pluginPath = "/usr/lib/step/plugins:/usr/local/lib/step/plugins" + } + for _, pat := range filepath.SplitList(pluginPath) { + entries, err := os.ReadDir(pat) + if err != nil { continue } + for _, entry := range entries { + pluginPath := filepath.Join(pat, entry.Name()) + _, err := environment.LoadProviderPlugin(pat) + if err != nil { + log.Printf ( + "!!! could not load plugin %s: %v", + pluginPath, err) + } + } + } logProviders(environment.Providers) // set up the HTTP handler