Skip to content

Commit 8fe4001

Browse files
authored
Merge pull request #1580 from gravitl/bugfix_v0.16.0_flags_and_postrules
fixing flags and config
2 parents 1a6cbf5 + 1723f57 commit 8fe4001

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

logic/gateway.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,12 @@ func CreateIngressGateway(netid string, nodeid string) (models.Node, error) {
212212

213213
if node.PostUp != "" {
214214
if !strings.Contains(node.PostUp, postUpCmd) {
215-
postUpCmd = node.PostUp + " ; " + postUpCmd
215+
postUpCmd = node.PostUp + postUpCmd
216216
}
217217
}
218218
if node.PostDown != "" {
219219
if !strings.Contains(node.PostDown, postDownCmd) {
220-
postDownCmd = node.PostDown + " ; " + postDownCmd
220+
postDownCmd = node.PostDown + postDownCmd
221221
}
222222
}
223223
node.SetLastModified()
@@ -385,12 +385,12 @@ func firewallIPTablesCommandsCreateIngress(networkInterface string, ipv4, ipv6 b
385385
// spacing around ; is important for later parsing of postup/postdown in wireguard/common.go
386386
postUp += "ip6tables -A FORWARD -i " + networkInterface + " -j ACCEPT ; "
387387
postUp += "ip6tables -A FORWARD -o " + networkInterface + " -j ACCEPT ; "
388-
postUp += "ip6tables -t nat -A POSTROUTING -o " + networkInterface + " -j MASQUERADE"
388+
postUp += "ip6tables -t nat -A POSTROUTING -o " + networkInterface + " -j MASQUERADE ; "
389389

390390
// doesn't remove potentially empty tables or chains
391391
postDown += "ip6tables -D FORWARD -i " + networkInterface + " -j ACCEPT ; "
392392
postDown += "ip6tables -D FORWARD -o " + networkInterface + " -j ACCEPT ; "
393-
postDown += "ip6tables -t nat -D POSTROUTING -o " + networkInterface + " -j MASQUERADE"
393+
postDown += "ip6tables -t nat -D POSTROUTING -o " + networkInterface + " -j MASQUERADE ; "
394394
}
395395
return postUp, postDown
396396
}
@@ -402,13 +402,13 @@ func firewallIPTablesCommandsCreateEgress(networkInterface string, gatewayInterf
402402
postDown := ""
403403
if ipv4 {
404404
postUp += "iptables -A FORWARD -i " + networkInterface + " -j ACCEPT ; "
405-
postUp += "iptables -A FORWARD -o " + networkInterface + " -j ACCEPT"
405+
postUp += "iptables -A FORWARD -o " + networkInterface + " -j ACCEPT ; "
406406
postDown += "iptables -D FORWARD -i " + networkInterface + " -j ACCEPT ; "
407407
postDown += "iptables -D FORWARD -o " + networkInterface + " -j ACCEPT ; "
408408

409409
if egressNatEnabled == "yes" {
410-
postUp += " ; iptables -t nat -A POSTROUTING -o " + gatewayInterface + " -j MASQUERADE ; "
411-
postDown += " ; iptables -t nat -D POSTROUTING -o " + gatewayInterface + " -j MASQUERADE ; "
410+
postUp += "iptables -t nat -A POSTROUTING -o " + gatewayInterface + " -j MASQUERADE ; "
411+
postDown += "iptables -t nat -D POSTROUTING -o " + gatewayInterface + " -j MASQUERADE ; "
412412
}
413413
}
414414
if ipv6 {
@@ -418,8 +418,8 @@ func firewallIPTablesCommandsCreateEgress(networkInterface string, gatewayInterf
418418
postDown += "ip6tables -D FORWARD -o " + networkInterface + " -j ACCEPT ; "
419419

420420
if egressNatEnabled == "yes" {
421-
postUp += " ; ip6tables -t nat -A POSTROUTING -o " + gatewayInterface + " -j MASQUERADE"
422-
postDown += " ; ip6tables -t nat -D POSTROUTING -o " + gatewayInterface + " -j MASQUERADE"
421+
postUp += "ip6tables -t nat -A POSTROUTING -o " + gatewayInterface + " -j MASQUERADE ; "
422+
postDown += "ip6tables -t nat -D POSTROUTING -o " + gatewayInterface + " -j MASQUERADE ; "
423423
}
424424
}
425425
return postUp, postDown

netclient/cli_options/flags.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ func GetFlags(hostname string) []cli.Flag {
134134
Usage: "Access Token for signing up machine with Netmaker server during initial 'add'.",
135135
},
136136
&cli.StringFlag{
137-
Name: "login-server",
138-
Aliases: []string{"l"},
139-
EnvVars: []string{"LOGIN_SERVER"},
137+
Name: "server",
138+
Aliases: []string{"s"},
139+
EnvVars: []string{"HOST_SERVER"},
140140
Value: "",
141-
Usage: "Login server URL, use it for the Single Sign-on along with the network parameter",
141+
Usage: "Host server (domain of API) [Example: api.example.com]. Do not include \"http(s)://\" use it for the Single Sign-on along with the network parameter",
142142
},
143143
&cli.StringFlag{
144144
Name: "user",

netclient/config/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ func GetCLIConfig(c *cli.Context) (ClientConfig, string, error) {
240240
if c.String("apiserver") != "" {
241241
cfg.Server.API = c.String("apiserver")
242242
}
243-
} else if c.String("login-server") != "" {
244-
cfg.SsoServer = c.String("login-server")
243+
} else if c.String("server") != "" {
244+
cfg.SsoServer = c.String("server")
245245
cfg.Network = c.String("network")
246246
cfg.Node.Network = c.String("network")
247247
global_settings.User = c.String("user")

0 commit comments

Comments
 (0)