Skip to content

Commit 81d8e61

Browse files
authored
Merge branch 'release-v0.99.0' into patch/db-conn-pool
2 parents da51152 + b86aea9 commit 81d8e61

File tree

19 files changed

+82
-59
lines changed

19 files changed

+82
-59
lines changed

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ body:
3131
label: Version
3232
description: What version are you running?
3333
options:
34+
- v0.99.0
3435
- v0.90.0
3536
- v0.30.0
3637
- v0.26.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<p align="center">
1818
<a href="https://github.com/gravitl/netmaker/releases">
19-
<img src="https://img.shields.io/badge/Version-0.90.0-informational?style=flat-square" />
19+
<img src="https://img.shields.io/badge/Version-0.99.0-informational?style=flat-square" />
2020
</a>
2121
<a href="https://hub.docker.com/r/gravitl/netmaker/tags">
2222
<img src="https://img.shields.io/docker/pulls/gravitl/netmaker?label=downloads" />

compose/docker-compose.netclient.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: "3.4"
33
services:
44
netclient:
55
container_name: netclient
6-
image: 'gravitl/netclient:v0.90.0'
6+
image: 'gravitl/netclient:v0.99.0'
77
hostname: netmaker-1
88
network_mode: host
99
restart: on-failure

controllers/user.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,10 @@ func createUser(w http.ResponseWriter, r *http.Request) {
710710
if !servercfg.IsPro {
711711
user.PlatformRoleID = models.AdminRole
712712
}
713+
if user.UserName == logic.MasterUser {
714+
logic.ReturnErrorResponse(w, r, logic.FormatError(errors.New("username not allowed"), "badrequest"))
715+
return
716+
}
713717

714718
if user.PlatformRoleID == "" {
715719
logic.ReturnErrorResponse(w, r, logic.FormatError(errors.New("platform role is missing"), "badrequest"))

k8s/client/netclient-daemonset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spec:
1616
hostNetwork: true
1717
containers:
1818
- name: netclient
19-
image: gravitl/netclient:v0.90.0
19+
image: gravitl/netclient:v0.99.0
2020
env:
2121
- name: TOKEN
2222
value: "TOKEN_VALUE"

k8s/client/netclient.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ spec:
2828
# - "<node label value>"
2929
containers:
3030
- name: netclient
31-
image: gravitl/netclient:v0.90.0
31+
image: gravitl/netclient:v0.99.0
3232
env:
3333
- name: TOKEN
3434
value: "TOKEN_VALUE"

k8s/server/netmaker-ui.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
spec:
1616
containers:
1717
- name: netmaker-ui
18-
image: gravitl/netmaker-ui:v0.90.0
18+
image: gravitl/netmaker-ui:v0.99.0
1919
ports:
2020
- containerPort: 443
2121
env:

logic/auth.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,10 @@ func UpdateUser(userchange, user *models.User) (*models.User, error) {
282282
if _, err := GetUser(userchange.UserName); err == nil {
283283
return &models.User{}, errors.New("username exists already")
284284
}
285+
if userchange.UserName == MasterUser {
286+
return &models.User{}, errors.New("username not allowed")
287+
}
288+
285289
user.UserName = userchange.UserName
286290
}
287291
if userchange.Password != "" {

logic/egress.go

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,27 +39,22 @@ func ValidateEgressReq(e *schema.Egress) error {
3939
func DoesNodeHaveAccessToEgress(node *models.Node, e *schema.Egress, acls []models.Acl) bool {
4040
nodeTags := maps.Clone(node.Tags)
4141
nodeTags[models.TagID(node.ID.String())] = struct{}{}
42+
nodeTags[models.TagID("*")] = struct{}{}
4243
for _, acl := range acls {
4344
if !acl.Enabled {
4445
continue
4546
}
4647
srcVal := ConvAclTagToValueMap(acl.Src)
47-
if acl.AllowedDirection == models.TrafficDirectionBi {
48-
if _, ok := srcVal["*"]; ok {
49-
return true
50-
}
51-
}
5248
for _, dstI := range acl.Dst {
53-
54-
if dstI.ID == models.NodeTagID && dstI.Value == "*" {
55-
return true
56-
}
57-
if dstI.ID == models.EgressID && dstI.Value == e.ID {
58-
e := schema.Egress{ID: dstI.Value}
59-
err := e.Get(db.WithContext(context.TODO()))
60-
if err != nil {
61-
continue
49+
if (dstI.ID == models.EgressID && dstI.Value == e.ID) || (dstI.ID == models.NodeTagID && dstI.Value == "*") {
50+
if dstI.ID == models.EgressID {
51+
e := schema.Egress{ID: dstI.Value}
52+
err := e.Get(db.WithContext(context.TODO()))
53+
if err != nil {
54+
continue
55+
}
6256
}
57+
6358
if node.IsStatic {
6459
if _, ok := srcVal[node.StaticNode.ClientID]; ok {
6560
return true
@@ -75,8 +70,8 @@ func DoesNodeHaveAccessToEgress(node *models.Node, e *schema.Egress, acls []mode
7570
return true
7671
}
7772
}
78-
7973
}
74+
8075
}
8176
}
8277
return false

logic/gateway.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,7 @@ func CreateIngressGateway(netid string, nodeid string, ingress models.IngressReq
190190
}
191191
node.IsIngressGateway = true
192192
node.IsGw = true
193-
if !servercfg.IsPro {
194-
node.IsInternetGateway = ingress.IsInternetGateway
195-
}
193+
node.IsInternetGateway = ingress.IsInternetGateway
196194
node.IngressGatewayRange = network.AddressRange
197195
node.IngressGatewayRange6 = network.AddressRange6
198196
node.IngressDNS = ingress.ExtclientDNS

0 commit comments

Comments
 (0)