sshpiper/plugin/yaml/main.go
Josh Bleecher Snyder 297b8c60e7
extract skel into its own package (#596)
This breaks the dependency of libplugin
on x/crypto, enabling people to use libplugin
without having conflicts over the crypto module.
2025-05-23 12:42:44 -07:00

37 lines
950 B
Go

//go:build full || e2e
package main
import (
"github.com/tg123/sshpiper/libplugin"
"github.com/tg123/sshpiper/libplugin/skel"
"github.com/urfave/cli/v2"
)
func main() {
plugin := newYamlPlugin()
libplugin.CreateAndRunPluginTemplate(&libplugin.PluginTemplate{
Name: "yaml",
Usage: "sshpiperd yaml plugin",
Flags: []cli.Flag{
&cli.StringSliceFlag{
Name: "config",
Usage: "path to yaml config files, can be globs as well",
Required: true,
EnvVars: []string{"SSHPIPERD_YAML_CONFIG"},
Destination: &plugin.FileGlobs,
},
&cli.BoolFlag{
Name: "no-check-perm",
Usage: "disable 0400 checking",
EnvVars: []string{"SSHPIPERD_YAML_NOCHECKPERM"},
Destination: &plugin.NoCheckPerm,
},
},
CreateConfig: func(c *cli.Context) (*libplugin.SshPiperPluginConfig, error) {
skel := skel.NewSkelPlugin(plugin.listPipe)
return skel.CreateConfig(), nil
},
})
}