We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 948ab9b commit e37b09dCopy full SHA for e37b09d
cmd/gateway-agent/main.go
@@ -6,6 +6,7 @@ import (
6
"io/ioutil"
7
"net/http"
8
"path/filepath"
9
+ "strings"
10
"time"
11
12
"github.com/nais/device/apiserver/api"
@@ -92,7 +93,7 @@ func configureWireguard(peers []api.Peer, privateKey string) error {
92
93
94
func generateWGConfig(peers []api.Peer, privateKey string) []byte {
95
wgConfig := "[Interface]\n"
- wgConfig += fmt.Sprintf("PrivateKey = %s\n", privateKey)
96
+ wgConfig += fmt.Sprintf("PrivateKey = %s\n", strings.Trim(privateKey, "\n"))
97
wgConfig += "ListenPort = 51820\n"
98
for _, peer := range peers {
99
wgConfig += "[Peer]\n"
0 commit comments