mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-04 14:26:14 +00:00
use ssh agent to auth to remote
This commit is contained in:
@@ -5,11 +5,12 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"golang.org/x/crypto/ssh/agent"
|
||||
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
e2e "github.com/tendermint/tendermint/test/e2e/pkg"
|
||||
@@ -91,10 +92,13 @@ func NewCLI() *CLI {
|
||||
switch inft {
|
||||
case "docker":
|
||||
cli.infp = &docker.Provider{Testnet: testnet}
|
||||
case "digitalocean":
|
||||
|
||||
// TMP: hardcoded key
|
||||
cfg, err := e2essh.NewClientConfig(filepath.Join(os.Getenv("HOME"), ".ssh", "PVT_KEY"))
|
||||
case "digital-ocean":
|
||||
c, err := net.Dial("unix", os.Getenv("SSH_AUTH_SOCK")) // TODO(williambanfield): Ensure this is a consistent location for the authentication socket of the agent.
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ac := agent.NewClient(c)
|
||||
cfg, err := e2essh.NewClientConfig(ac)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ func Start(testnet *e2e.Testnet, p infra.Provider) error {
|
||||
if _, err := waitForNode(node, 0, 15*time.Second); err != nil {
|
||||
return err
|
||||
}
|
||||
logger.Info("start", "msg", log.NewLazySprintf("Node %v up on http://127.0.0.1:%v", node.Name, node.ProxyPort))
|
||||
logger.Info("start", "msg", log.NewLazySprintf("Node %v up on http://%s:%v", node.Name, node.IP, node.ProxyPort))
|
||||
}
|
||||
|
||||
networkHeight := testnet.InitialHeight
|
||||
@@ -116,8 +116,8 @@ func Start(testnet *e2e.Testnet, p infra.Provider) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
logger.Info("start", "msg", log.NewLazySprintf("Node %v up on http://127.0.0.1:%v at height %v",
|
||||
node.Name, node.ProxyPort, status.SyncInfo.LatestBlockHeight))
|
||||
logger.Info("start", "msg", log.NewLazySprintf("Node %v up on http://%s:%v at height %v",
|
||||
node.Name, node.IP, node.ProxyPort, status.SyncInfo.LatestBlockHeight))
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user