Skip to content

Commit

Permalink
Merge pull request #496 from rainforestapp/RF-35226-remove-default-tu…
Browse files Browse the repository at this point in the history
…nnel-id

RF-35226 remove default tunnel id argument value
  • Loading branch information
sebaherrera07 authored Aug 1, 2024
2 parents da1a159 + e112e7a commit d5e2a8f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,9 @@ Email [[email protected]](mailto:[email protected]) if you're having tro
1. Create a new Pull Request

### Testing your local changes
First build the application:
First, make sure you have the submodules updated, then build the application:
```bash
git submodule update --init
go build
```

Expand Down
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: %s, 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 d5e2a8f

Please sign in to comment.