Skip to content

Commit b423b18

Browse files
committed
fix merge conflicts
2 parents 709ac8b + 1d92a0a commit b423b18

31 files changed

+287
-83
lines changed

.github/workflows/deletedroplets.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1313
steps:
1414
- name: get logs
15-
uses: dawidd6/action-download-artifact@v9
15+
uses: dawidd6/action-download-artifact@v11
1616
with:
1717
run_id: ${{ github.event.workflow_run.id}}
1818
if_no_artifact_found: warn
@@ -75,7 +75,7 @@ jobs:
7575
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
7676
steps:
7777
- name: get logs
78-
uses: dawidd6/action-download-artifact@v9
78+
uses: dawidd6/action-download-artifact@v11
7979
with:
8080
run_id: ${{ github.event.workflow_run.id}}
8181
if_no_artifact_found: warn

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ COPY . .
66

77
RUN GOOS=linux CGO_ENABLED=1 go build -ldflags="-s -w " -tags ${tags} .
88
# RUN go build -tags=ee . -o netmaker main.go
9-
FROM alpine:3.21.3
9+
FROM alpine:3.22.0
1010

1111
# add a c lib
1212
# set the working directory

Dockerfile-quick

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#first stage - builder
2-
FROM alpine:3.21.3
2+
FROM alpine:3.22.0
33
ARG version
44
WORKDIR /app
55
COPY ./netmaker /root/netmaker

cli/cmd/network/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66

77
"github.com/gravitl/netmaker/cli/cmd/commons"
88
"github.com/gravitl/netmaker/cli/functions"
9-
"github.com/olekukonko/tablewriter"
9+
"github.com/guumaster/tablewriter"
1010
"github.com/spf13/cobra"
1111
)
1212

controllers/ext_client.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"fmt"
88
"net"
99
"net/http"
10+
"os"
1011
"reflect"
1112
"strconv"
1213
"strings"
@@ -673,7 +674,6 @@ func createExtClient(w http.ResponseWriter, r *http.Request) {
673674

674675
var params = mux.Vars(r)
675676
nodeid := params["nodeid"]
676-
677677
ingressExists := checkIngressExists(nodeid)
678678
if !ingressExists {
679679
err := errors.New("ingress does not exist")
@@ -780,6 +780,10 @@ func createExtClient(w http.ResponseWriter, r *http.Request) {
780780
}
781781
extclient.PublicEndpoint = customExtClient.PublicEndpoint
782782
extclient.Country = customExtClient.Country
783+
if customExtClient.RemoteAccessClientID != "" && customExtClient.Location == "" {
784+
extclient.Location = logic.GetHostLocInfo(logic.GetClientIP(r), os.Getenv("IP_INFO_TOKEN"))
785+
}
786+
extclient.Location = customExtClient.Location
783787

784788
if err = logic.CreateExtClient(&extclient); err != nil {
785789
slog.Error(
@@ -928,6 +932,9 @@ func updateExtClient(w http.ResponseWriter, r *http.Request) {
928932
sendPeerUpdate = true
929933
replacePeers = true
930934
}
935+
if update.RemoteAccessClientID != "" && update.Location == "" {
936+
update.Location = logic.GetHostLocInfo(logic.GetClientIP(r), os.Getenv("IP_INFO_TOKEN"))
937+
}
931938
newclient := logic.UpdateExtClient(&oldExtClient, &update)
932939
if err := logic.DeleteExtClient(oldExtClient.Network, oldExtClient.ClientID); err != nil {
933940
slog.Error(

controllers/hosts.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ func updateHost(w http.ResponseWriter, r *http.Request) {
308308
}
309309
}
310310
}()
311+
311312
logic.LogEvent(&models.Event{
312313
Action: models.Update,
313314
Source: models.Subject{

controllers/server.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,10 @@ func getConfig(w http.ResponseWriter, r *http.Request) {
247247
// @Success 200 {object} config.ServerSettings
248248
func getSettings(w http.ResponseWriter, r *http.Request) {
249249
scfg := logic.GetServerSettings()
250-
scfg.ClientSecret = logic.Mask()
250+
if scfg.ClientSecret != "" {
251+
scfg.ClientSecret = logic.Mask()
252+
}
253+
251254
logic.ReturnSuccessResponseWithJson(w, r, scfg, "fetched server settings successfully")
252255
}
253256

controllers/user.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package controller
22

33
import (
4+
"context"
45
"encoding/json"
56
"errors"
67
"fmt"
8+
"github.com/gravitl/netmaker/db"
79
"net/http"
810
"reflect"
911
"time"
@@ -584,6 +586,18 @@ func getUsers(w http.ResponseWriter, r *http.Request) {
584586
return
585587
}
586588

589+
for i, user := range users {
590+
// only setting num_access_tokens here, because only UI needs it.
591+
user.NumAccessTokens, err = (&schema.UserAccessToken{
592+
UserName: user.UserName,
593+
}).CountByUser(db.WithContext(context.TODO()))
594+
if err != nil {
595+
continue
596+
}
597+
598+
users[i] = user
599+
}
600+
587601
logic.SortUsers(users[:])
588602
logger.Log(2, r.Header.Get("user"), "fetched users")
589603
json.NewEncoder(w).Encode(users)

go.mod

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,24 @@ require (
1515
github.com/lib/pq v1.10.9
1616
github.com/mattn/go-sqlite3 v1.14.28
1717
github.com/rqlite/gorqlite v0.0.0-20240122221808-a8a425b1a6aa
18-
github.com/seancfoley/ipaddress-go v1.7.0
18+
github.com/seancfoley/ipaddress-go v1.7.1
1919
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
2020
github.com/stretchr/testify v1.10.0
2121
github.com/txn2/txeh v1.5.5
2222
go.uber.org/automaxprocs v1.6.0
23-
golang.org/x/crypto v0.38.0
24-
golang.org/x/net v0.39.0 // indirect
23+
golang.org/x/crypto v0.39.0
24+
golang.org/x/net v0.41.0 // indirect
2525
golang.org/x/oauth2 v0.30.0
2626
golang.org/x/sys v0.33.0 // indirect
27-
golang.org/x/text v0.25.0 // indirect
27+
golang.org/x/text v0.26.0 // indirect
2828
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20221104135756-97bc4ad4a1cb
2929
gopkg.in/yaml.v3 v3.0.1
3030
)
3131

3232
require (
3333
filippo.io/edwards25519 v1.1.0
3434
github.com/c-robinson/iplib v1.0.8
35-
github.com/posthog/posthog-go v1.5.5
35+
github.com/posthog/posthog-go v1.5.12
3636
)
3737

3838
require (
@@ -46,28 +46,27 @@ require (
4646
github.com/goombaio/namegenerator v0.0.0-20181006234301-989e774b106e
4747
github.com/guumaster/tablewriter v0.0.10
4848
github.com/matryer/is v1.4.1
49-
github.com/olekukonko/tablewriter v0.0.5
5049
github.com/spf13/cobra v1.9.1
51-
google.golang.org/api v0.229.0
50+
google.golang.org/api v0.238.0
5251
gopkg.in/mail.v2 v2.3.1
5352
gorm.io/datatypes v1.2.5
54-
gorm.io/driver/postgres v1.5.11
55-
gorm.io/driver/sqlite v1.5.7
53+
gorm.io/driver/postgres v1.6.0
54+
gorm.io/driver/sqlite v1.6.0
5655
gorm.io/gorm v1.30.0
5756
)
5857

5958
require (
60-
cloud.google.com/go/auth v0.16.0 // indirect
59+
cloud.google.com/go/auth v0.16.2 // indirect
6160
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
62-
cloud.google.com/go/compute/metadata v0.6.0 // indirect
61+
cloud.google.com/go/compute/metadata v0.7.0 // indirect
6362
github.com/gabriel-vasile/mimetype v1.4.8 // indirect
6463
github.com/go-jose/go-jose/v4 v4.0.5 // indirect
6564
github.com/go-logr/logr v1.4.2 // indirect
6665
github.com/go-logr/stdr v1.2.2 // indirect
6766
github.com/go-sql-driver/mysql v1.8.1 // indirect
6867
github.com/google/s2a-go v0.1.9 // indirect
6968
github.com/googleapis/enterprise-certificate-proxy v0.3.6 // indirect
70-
github.com/googleapis/gax-go/v2 v2.14.1 // indirect
69+
github.com/googleapis/gax-go/v2 v2.14.2 // indirect
7170
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
7271
github.com/inconshreveable/mousetrap v1.1.0 // indirect
7372
github.com/jackc/pgpassfile v1.0.0 // indirect
@@ -81,12 +80,12 @@ require (
8180
github.com/seancfoley/bintree v1.3.1 // indirect
8281
github.com/spf13/pflag v1.0.6 // indirect
8382
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
84-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 // indirect
85-
go.opentelemetry.io/otel v1.35.0 // indirect
86-
go.opentelemetry.io/otel/metric v1.35.0 // indirect
87-
go.opentelemetry.io/otel/trace v1.35.0 // indirect
88-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250414145226-207652e42e2e // indirect
89-
google.golang.org/grpc v1.71.1 // indirect
83+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
84+
go.opentelemetry.io/otel v1.36.0 // indirect
85+
go.opentelemetry.io/otel/metric v1.36.0 // indirect
86+
go.opentelemetry.io/otel/trace v1.36.0 // indirect
87+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 // indirect
88+
google.golang.org/grpc v1.73.0 // indirect
9089
google.golang.org/protobuf v1.36.6 // indirect
9190
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
9291
gorm.io/driver/mysql v1.5.6 // indirect
@@ -99,7 +98,7 @@ require (
9998
github.com/go-playground/universal-translator v0.18.1 // indirect
10099
github.com/hashicorp/go-version v1.7.0
101100
github.com/leodido/go-urn v1.4.0 // indirect
102-
github.com/mattn/go-runewidth v0.0.13 // indirect
101+
github.com/mattn/go-runewidth v0.0.16 // indirect
103102
github.com/pmezard/go-difflib v1.0.0 // indirect
104-
golang.org/x/sync v0.14.0 // indirect
103+
golang.org/x/sync v0.15.0 // indirect
105104
)

0 commit comments

Comments
 (0)