|
@@ -77,9 +77,6 @@ func wireSSHReload(l *logrus.Logger, ssh *sshd.SSHServer, c *config.C) {
|
|
// that callers may invoke to run the configured ssh server. On
|
|
// that callers may invoke to run the configured ssh server. On
|
|
// failure, it returns nil, error.
|
|
// failure, it returns nil, error.
|
|
func configSSH(l *logrus.Logger, ssh *sshd.SSHServer, c *config.C) (func(), error) {
|
|
func configSSH(l *logrus.Logger, ssh *sshd.SSHServer, c *config.C) (func(), error) {
|
|
- //TODO conntrack list
|
|
|
|
- //TODO print firewall rules or hash?
|
|
|
|
-
|
|
|
|
listen := c.GetString("sshd.listen", "")
|
|
listen := c.GetString("sshd.listen", "")
|
|
if listen == "" {
|
|
if listen == "" {
|
|
return nil, fmt.Errorf("sshd.listen must be provided")
|
|
return nil, fmt.Errorf("sshd.listen must be provided")
|
|
@@ -93,7 +90,6 @@ func configSSH(l *logrus.Logger, ssh *sshd.SSHServer, c *config.C) (func(), erro
|
|
return nil, fmt.Errorf("sshd.listen can not use port 22")
|
|
return nil, fmt.Errorf("sshd.listen can not use port 22")
|
|
}
|
|
}
|
|
|
|
|
|
- //TODO: no good way to reload this right now
|
|
|
|
hostKeyPathOrKey := c.GetString("sshd.host_key", "")
|
|
hostKeyPathOrKey := c.GetString("sshd.host_key", "")
|
|
if hostKeyPathOrKey == "" {
|
|
if hostKeyPathOrKey == "" {
|
|
return nil, fmt.Errorf("sshd.host_key must be provided")
|
|
return nil, fmt.Errorf("sshd.host_key must be provided")
|
|
@@ -418,7 +414,6 @@ func attachCommands(l *logrus.Logger, c *config.C, ssh *sshd.SSHServer, f *Inter
|
|
func sshListHostMap(hl controlHostLister, a interface{}, w sshd.StringWriter) error {
|
|
func sshListHostMap(hl controlHostLister, a interface{}, w sshd.StringWriter) error {
|
|
fs, ok := a.(*sshListHostMapFlags)
|
|
fs, ok := a.(*sshListHostMapFlags)
|
|
if !ok {
|
|
if !ok {
|
|
- //TODO: error
|
|
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
|
|
|
|
@@ -441,7 +436,6 @@ func sshListHostMap(hl controlHostLister, a interface{}, w sshd.StringWriter) er
|
|
|
|
|
|
err := js.Encode(hm)
|
|
err := js.Encode(hm)
|
|
if err != nil {
|
|
if err != nil {
|
|
- //TODO
|
|
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
|
|
|
|
@@ -460,7 +454,6 @@ func sshListHostMap(hl controlHostLister, a interface{}, w sshd.StringWriter) er
|
|
func sshListLighthouseMap(lightHouse *LightHouse, a interface{}, w sshd.StringWriter) error {
|
|
func sshListLighthouseMap(lightHouse *LightHouse, a interface{}, w sshd.StringWriter) error {
|
|
fs, ok := a.(*sshListHostMapFlags)
|
|
fs, ok := a.(*sshListHostMapFlags)
|
|
if !ok {
|
|
if !ok {
|
|
- //TODO: error
|
|
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
|
|
|
|
@@ -493,7 +486,6 @@ func sshListLighthouseMap(lightHouse *LightHouse, a interface{}, w sshd.StringWr
|
|
|
|
|
|
err := js.Encode(addrMap)
|
|
err := js.Encode(addrMap)
|
|
if err != nil {
|
|
if err != nil {
|
|
- //TODO
|
|
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
|
|
|
|
@@ -564,7 +556,6 @@ func sshQueryLighthouse(ifce *Interface, fs interface{}, a []string, w sshd.Stri
|
|
func sshCloseTunnel(ifce *Interface, fs interface{}, a []string, w sshd.StringWriter) error {
|
|
func sshCloseTunnel(ifce *Interface, fs interface{}, a []string, w sshd.StringWriter) error {
|
|
flags, ok := fs.(*sshCloseTunnelFlags)
|
|
flags, ok := fs.(*sshCloseTunnelFlags)
|
|
if !ok {
|
|
if !ok {
|
|
- //TODO: error
|
|
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
|
|
|
|
@@ -605,7 +596,6 @@ func sshCloseTunnel(ifce *Interface, fs interface{}, a []string, w sshd.StringWr
|
|
func sshCreateTunnel(ifce *Interface, fs interface{}, a []string, w sshd.StringWriter) error {
|
|
func sshCreateTunnel(ifce *Interface, fs interface{}, a []string, w sshd.StringWriter) error {
|
|
flags, ok := fs.(*sshCreateTunnelFlags)
|
|
flags, ok := fs.(*sshCreateTunnelFlags)
|
|
if !ok {
|
|
if !ok {
|
|
- //TODO: error
|
|
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
|
|
|
|
@@ -651,7 +641,6 @@ func sshCreateTunnel(ifce *Interface, fs interface{}, a []string, w sshd.StringW
|
|
func sshChangeRemote(ifce *Interface, fs interface{}, a []string, w sshd.StringWriter) error {
|
|
func sshChangeRemote(ifce *Interface, fs interface{}, a []string, w sshd.StringWriter) error {
|
|
flags, ok := fs.(*sshChangeRemoteFlags)
|
|
flags, ok := fs.(*sshChangeRemoteFlags)
|
|
if !ok {
|
|
if !ok {
|
|
- //TODO: error
|
|
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
|
|
|
|
@@ -781,7 +770,6 @@ func sshLogFormat(l *logrus.Logger, fs interface{}, a []string, w sshd.StringWri
|
|
func sshPrintCert(ifce *Interface, fs interface{}, a []string, w sshd.StringWriter) error {
|
|
func sshPrintCert(ifce *Interface, fs interface{}, a []string, w sshd.StringWriter) error {
|
|
args, ok := fs.(*sshPrintCertFlags)
|
|
args, ok := fs.(*sshPrintCertFlags)
|
|
if !ok {
|
|
if !ok {
|
|
- //TODO: error
|
|
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
|
|
|
|
@@ -807,7 +795,6 @@ func sshPrintCert(ifce *Interface, fs interface{}, a []string, w sshd.StringWrit
|
|
if args.Json || args.Pretty {
|
|
if args.Json || args.Pretty {
|
|
b, err := cert.MarshalJSON()
|
|
b, err := cert.MarshalJSON()
|
|
if err != nil {
|
|
if err != nil {
|
|
- //TODO: handle it
|
|
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
|
|
|
|
@@ -816,7 +803,6 @@ func sshPrintCert(ifce *Interface, fs interface{}, a []string, w sshd.StringWrit
|
|
err := json.Indent(buf, b, "", " ")
|
|
err := json.Indent(buf, b, "", " ")
|
|
b = buf.Bytes()
|
|
b = buf.Bytes()
|
|
if err != nil {
|
|
if err != nil {
|
|
- //TODO: handle it
|
|
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -827,7 +813,6 @@ func sshPrintCert(ifce *Interface, fs interface{}, a []string, w sshd.StringWrit
|
|
if args.Raw {
|
|
if args.Raw {
|
|
b, err := cert.MarshalPEM()
|
|
b, err := cert.MarshalPEM()
|
|
if err != nil {
|
|
if err != nil {
|
|
- //TODO: handle it
|
|
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
|
|
|
|
@@ -840,7 +825,6 @@ func sshPrintCert(ifce *Interface, fs interface{}, a []string, w sshd.StringWrit
|
|
func sshPrintRelays(ifce *Interface, fs interface{}, a []string, w sshd.StringWriter) error {
|
|
func sshPrintRelays(ifce *Interface, fs interface{}, a []string, w sshd.StringWriter) error {
|
|
args, ok := fs.(*sshPrintTunnelFlags)
|
|
args, ok := fs.(*sshPrintTunnelFlags)
|
|
if !ok {
|
|
if !ok {
|
|
- //TODO: error
|
|
|
|
w.WriteLine(fmt.Sprintf("sshPrintRelays failed to convert args type"))
|
|
w.WriteLine(fmt.Sprintf("sshPrintRelays failed to convert args type"))
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
@@ -938,7 +922,6 @@ func sshPrintRelays(ifce *Interface, fs interface{}, a []string, w sshd.StringWr
|
|
func sshPrintTunnel(ifce *Interface, fs interface{}, a []string, w sshd.StringWriter) error {
|
|
func sshPrintTunnel(ifce *Interface, fs interface{}, a []string, w sshd.StringWriter) error {
|
|
args, ok := fs.(*sshPrintTunnelFlags)
|
|
args, ok := fs.(*sshPrintTunnelFlags)
|
|
if !ok {
|
|
if !ok {
|
|
- //TODO: error
|
|
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
|
|
|