You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
separate server/client port args for 'add' cmd (#43)
* separate server/client port args for 'add' command
* explicit server port in config file via 'configure' and `add server`
* README examples updated with explicit port env vars
* clearer port help messages
Copy file name to clipboardExpand all lines: src/cmd/add.go
-3Lines changed: 0 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,6 @@ import (
9
9
typeaddCmdConfigstruct {
10
10
endpointstring
11
11
outboundbool
12
-
portint
13
12
keepaliveint
14
13
}
15
14
@@ -18,7 +17,6 @@ type addCmdConfig struct {
18
17
varaddCmdArgs=addCmdConfig{
19
18
endpoint: Endpoint,
20
19
outbound: false,
21
-
port: USE_ENDPOINT_PORT,
22
20
keepalive: Keepalive,
23
21
}
24
22
@@ -35,7 +33,6 @@ func init() {
35
33
36
34
addCmd.PersistentFlags().StringVarP(&addCmdArgs.endpoint, "endpoint", "e", addCmdArgs.endpoint, "[REQUIRED] socket address of wireguard listener; client address if inbound handshake and server address if outbound (example \"1.2.3.4:51820\")")
37
35
addCmd.PersistentFlags().BoolVar(&addCmdArgs.outbound, "outbound", addCmdArgs.outbound, "use endpoint to initiate handshake out to server instead of the other way around")
38
-
addCmd.PersistentFlags().IntVarP(&addCmdArgs.port, "port", "p", addCmdArgs.port, "port of wireguard listener; client port if inbound handshake and server port if outbound")
39
36
40
37
addCmd.PersistentFlags().IntVarP(&addCmdArgs.keepalive, "keepalive", "k", addCmdArgs.keepalive, "tunnel keepalive in seconds")
Copy file name to clipboardExpand all lines: src/cmd/add_client.go
+7-3Lines changed: 7 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,7 @@ type addClientCmdConfig struct {
24
24
outputConfigFileE2EEstring
25
25
serverAddressstring
26
26
mtuint
27
+
portint
27
28
}
28
29
29
30
varaddClientCmdArgs=addClientCmdConfig{
@@ -33,6 +34,7 @@ var addClientCmdArgs = addClientCmdConfig{
33
34
outputConfigFileE2EE: ConfigE2EE,
34
35
serverAddress: "",
35
36
mtu: MTU,
37
+
port: USE_ENDPOINT_PORT,
36
38
}
37
39
38
40
// addClientCmd represents the client command.
@@ -49,7 +51,9 @@ func init() {
49
51
addCmd.AddCommand(addClientCmd)
50
52
51
53
addClientCmd.Flags().StringVarP(&addClientCmdArgs.serverAddress, "server-address", "s", addClientCmdArgs.serverAddress, "API address of server that new client will connect to. By default new clients connect to existing relay servers")
54
+
addClientCmd.Flags().IntVarP(&addClientCmdArgs.port, "port", "p", addClientCmdArgs.port, "port of wireguard listener to start; server port if --outbound, client port otherwise. Default is the port specified in --endpoint")
Copy file name to clipboardExpand all lines: src/cmd/add_server.go
+16-9Lines changed: 16 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,7 @@ type addServerCmdConfig struct {
24
24
configFileE2EEstring
25
25
configFileServerstring
26
26
writeToClipboardbool
27
+
portint
27
28
}
28
29
29
30
varaddServerCmdArgs=addServerCmdConfig{
@@ -33,6 +34,7 @@ var addServerCmdArgs = addServerCmdConfig{
33
34
configFileE2EE: ConfigE2EE,
34
35
configFileServer: ConfigServer,
35
36
writeToClipboard: false,
37
+
port: USE_ENDPOINT_PORT,
36
38
}
37
39
38
40
// addServerCmd represents the server command.
@@ -50,10 +52,12 @@ func init() {
50
52
51
53
addServerCmd.Flags().StringSliceVarP(&addServerCmdArgs.allowedIPs, "routes", "r", addServerCmdArgs.allowedIPs, "[REQUIRED] CIDR IP ranges that will be routed through wiretap")
52
54
addServerCmd.Flags().StringVarP(&addServerCmdArgs.serverAddress, "server-address", "s", addServerCmdArgs.serverAddress, "API address of server that new server will connect to, connects to client by default")
55
+
addServerCmd.Flags().IntVarP(&addServerCmdArgs.port, "port", "p", addServerCmdArgs.port, "listener port to start on new server for wireguard relay. If --outbound, default is the port specified in --endpoint; otherwise default is 51820")
56
+
addServerCmd.Flags().BoolVarP(&addServerCmdArgs.writeToClipboard, "clipboard", "c", addServerCmdArgs.writeToClipboard, "copy configuration args to clipboard")
57
+
53
58
addServerCmd.Flags().StringVarP(&addServerCmdArgs.configFileRelay, "relay-input", "", addServerCmdArgs.configFileRelay, "filename of input relay config file")
54
59
addServerCmd.Flags().StringVarP(&addServerCmdArgs.configFileE2EE, "e2ee-input", "", addServerCmdArgs.configFileE2EE, "filename of input E2EE config file")
55
60
addServerCmd.Flags().StringVarP(&addServerCmdArgs.configFileServer, "server-output", "", addServerCmdArgs.configFileServer, "filename of server config output file")
56
-
addServerCmd.Flags().BoolVarP(&addServerCmdArgs.writeToClipboard, "clipboard", "c", addServerCmdArgs.writeToClipboard, "copy configuration args to clipboard")
0 commit comments