AUTH-2089: Revise ssh server to function as a proxy

This commit is contained in:
Michael Borkenstein
2019-09-30 15:44:23 -05:00
parent b3bcce97da
commit dbde3870da
10 changed files with 205 additions and 860 deletions

View File

@@ -74,9 +74,6 @@ const (
// s3URLFlag is the S3 URL of SSH log uploader (e.g. don't use AWS s3 and use google storage bucket instead)
s3URLFlag = "s3-url-host"
// disablePortForwarding disables both remote and local ssh port forwarding
enablePortForwardingFlag = "enable-port-forwarding"
noIntentMsg = "The --intent argument is required. Cloudflared looks up an Intent to determine what configuration to use (i.e. which tunnels to start). If you don't have any Intents yet, you can use a placeholder Intent Label for now. Then, when you make an Intent with that label, cloudflared will get notified and open the tunnels you specified in that Intent."
)
@@ -399,7 +396,7 @@ func StartServer(c *cli.Context, version string, shutdownC, graceShutdownC chan
}
sshServerAddress := "127.0.0.1:" + c.String(sshPortFlag)
server, err := sshserver.New(logManager, logger, version, sshServerAddress, shutdownC, c.Duration(sshIdleTimeoutFlag), c.Duration(sshMaxTimeoutFlag), c.Bool(enablePortForwardingFlag))
server, err := sshserver.New(logManager, logger, version, sshServerAddress, shutdownC, c.Duration(sshIdleTimeoutFlag), c.Duration(sshMaxTimeoutFlag))
if err != nil {
msg := "Cannot create new SSH Server"
logger.WithError(err).Error(msg)
@@ -1022,11 +1019,5 @@ func tunnelFlags(shouldHide bool) []cli.Flag {
EnvVars: []string{"S3_URL"},
Hidden: true,
}),
altsrc.NewBoolFlag(&cli.BoolFlag{
Name: enablePortForwardingFlag,
Usage: "Enables remote and local SSH port forwarding",
EnvVars: []string{"ENABLE_PORT_FORWARDING"},
Hidden: true,
}),
}
}