forked from tg123/sshpiper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
36 lines (32 loc) · 911 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//go:build full || e2e
package main
import (
"github.com/tg123/sshpiper/libplugin"
"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 := libplugin.NewSkelPlugin(plugin.listPipe)
return skel.CreateConfig(), nil
},
})
}