grim/hgkeeper

closing merged branch
access-control
2019-05-07, Gary Kramlich
e92e1e8ee230
closing merged branch
package serve
import (
"bitbucket.org/rw_grim/hgkeeper/ssh"
)
type Command struct {
SSHAddr string `kong:"flag,name='ssh-listen-addr',short='l',help='what address to listen on',default=':22222'"`
SSHHostKeysPath string `kong:"flag,name='ssh-host-keys-path',short='H',help='the path where host keys are kept',default='host-keys'"`
}
func (c *Command) Run(reposPath string) error {
s, err := ssh.NewServer(c.SSHHostKeysPath, reposPath)
if err != nil {
return err
}
err = s.Listen(c.SSHAddr)
if err != nil {
return err
}
return nil
}