Skip to content

Commit

Permalink
RF-35226 Remove 'default' value from direct-connect command
Browse files Browse the repository at this point in the history
This value was used when not passing a specific tunnel-id param, but it is not needed anymore.
  • Loading branch information
sebaherrera07 committed Jul 30, 2024
1 parent da1a159 commit 42db471
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions direct_connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ import (

func launchDirectConnect(c cliContext, rfApi *rainforest.Client) error {
tunnelId := c.String("tunnel-id")
log.Println("Starting Direct Connect Tunnel for tunnel ID:", tunnelId)
if tunnelId == "" {
log.Println("Starting Direct Connect Tunnel")
} else {
log.Println("Starting Direct Connect Tunnel for tunnel ID:", tunnelId)
}

// Generate a wireguard public/private keypair
privateKey, err := wgtypes.GeneratePrivateKey()
Expand Down Expand Up @@ -152,7 +156,7 @@ func launchDirectConnect(c cliContext, rfApi *rainforest.Client) error {
apiHandler(tnetWireguard, ipv4Addr, uint16(80))
wg.Done()
}()
log.Printf("Rainforest Direct Connect running (PID: %d)! Press Ctrl+C to exit\n", os.Getpid())
log.Printf("Rainforest Direct Connect running (name: %d, PID: %d)! Press Ctrl+C to exit\n", serverDetails.Name, os.Getpid())

wg.Wait()

Expand Down
3 changes: 1 addition & 2 deletions rainforest-cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -639,12 +639,11 @@ func main() {
Name: "direct-connect",
Usage: "Start a Rainforest Direct Connect session",
OnUsageError: onCommandUsageErrorHandler("direct-connect"),
Description: "Starts a Direct Connect Session for the given tunnel-id",
Description: "Starts a Direct Connect Session",
Flags: []cli.Flag{
cli.StringFlag{
Name: "tunnel-id",
Usage: "tunnel-id",
Value: "default",
},
},
Action: func(c *cli.Context) error {
Expand Down
1 change: 1 addition & 0 deletions rainforest/direct_connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type DirectConnectConnection struct {
ServerPublicKey string `json:"server_public_key"`
ServerPort int `json:"server_port"`
ServerEndpoint string `json:"server_endpoint"`
Name string `json:"name"`
}

// SetupDirectConnectTunnel tells Rainforest to set up a Direct Connect tunnel for us
Expand Down

0 comments on commit 42db471

Please sign in to comment.