Skip to content

Commit

Permalink
Update Nebula and dnapi (#158)
Browse files Browse the repository at this point in the history
* Update Nebula and dnapi

* Update Go
  • Loading branch information
johnmaguire committed Jun 20, 2024
1 parent 2353eaf commit f576aa0
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 79 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gofmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.20
- name: Set up Go 1.22
uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.22"
id: go

- name: Check out code into the Go module directory
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
runs-on: macos-latest

steps:
- name: Set up Go 1.20
- name: Set up Go 1.22
uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.22"

- uses: actions/setup-java@v2
with:
Expand Down
12 changes: 9 additions & 3 deletions nebula/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ func (e InvalidCredentialsError) Error() string {
}

func (c *APIClient) Enroll(code string) (*EnrollResult, error) {
cfg, pkey, creds, meta, err := c.c.EnrollWithTimeout(context.Background(), 30*time.Second, c.l, code)
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
cfg, pkey, creds, meta, err := c.c.Enroll(ctx, c.l, code)
var apiError *dnapi.APIError
switch {
case errors.As(err, &apiError):
Expand Down Expand Up @@ -99,7 +101,9 @@ func (c *APIClient) TryUpdate(siteName string, hostID string, privateKey string,
}

// Check for update
updateAvailable, err := c.c.CheckForUpdateWithTimeout(context.Background(), 10*time.Second, creds)
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
updateAvailable, err := c.c.CheckForUpdate(ctx, creds)
switch {
case errors.As(err, &dnapi.InvalidCredentialsError{}):
return nil, InvalidCredentialsError{}
Expand All @@ -112,7 +116,9 @@ func (c *APIClient) TryUpdate(siteName string, hostID string, privateKey string,
}

// Perform the update and return the new site object
cfg, pkey, newCreds, err := c.c.DoUpdateWithTimeout(context.Background(), 10*time.Second, creds)
updateCtx, updateCancel := context.WithTimeout(context.Background(), 30*time.Second)
defer updateCancel()
cfg, pkey, newCreds, err := c.c.DoUpdate(updateCtx, creds)
switch {
case errors.As(err, &dnapi.InvalidCredentialsError{}):
return nil, InvalidCredentialsError{}
Expand Down
40 changes: 20 additions & 20 deletions nebula/go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
module github.com/DefinedNet/mobile_nebula/nebula

go 1.19
go 1.22.0

toolchain go1.22.4

// replace github.com/slackhq/nebula => /Volumes/T7/nate/src/github.com/slackhq/nebula

require (
github.com/DefinedNet/dnapi v0.0.0-20221117210952-6f56f055f991
github.com/DefinedNet/dnapi v0.0.0-20240611201323-4589547bd270
github.com/sirupsen/logrus v1.9.3
github.com/slackhq/nebula v1.8.3-0.20240215174645-cc8b3cc961cf
golang.org/x/crypto v0.19.0
github.com/slackhq/nebula v1.9.3
golang.org/x/crypto v0.24.0
gopkg.in/yaml.v2 v2.4.0
)

Expand All @@ -17,31 +19,29 @@ require (
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cyberdelia/go-metrics-graphite v0.0.0-20161219230853-39f87cc3b432 // indirect
github.com/flynn/noise v1.0.1 // indirect
github.com/flynn/noise v1.1.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/miekg/dns v1.1.58 // indirect
github.com/miekg/dns v1.1.59 // indirect
github.com/nbrownus/go-metrics-prometheus v0.0.0-20210712211119-974a6260965f // indirect
github.com/prometheus/client_golang v1.18.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/prometheus/client_golang v1.19.1 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.54.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8 // indirect
github.com/vishvananda/netlink v1.2.1-beta.2 // indirect
github.com/vishvananda/netns v0.0.4 // indirect
golang.org/x/mobile v0.0.0-20240213143359-d1f7d3436075 // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/term v0.17.0 // indirect
golang.org/x/tools v0.18.0 // indirect
golang.org/x/mod v0.18.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/tools v0.22.0 // indirect
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173 // indirect
golang.zx2c4.com/wireguard/windows v0.5.3 // indirect
google.golang.org/protobuf v1.32.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
)
Loading

0 comments on commit f576aa0

Please sign in to comment.