diff --git a/.github/workflows/golang-test-windows.yml b/.github/workflows/golang-test-windows.yml index a50c81918..6027d3626 100644 --- a/.github/workflows/golang-test-windows.yml +++ b/.github/workflows/golang-test-windows.yml @@ -44,7 +44,6 @@ jobs: - run: PsExec64 -s -w ${{ github.workspace }} C:\hostedtoolcache\windows\go\${{ steps.go.outputs.go-version }}\x64\bin\go.exe env -w GOMODCACHE=C:\Users\runneradmin\go\pkg\mod - run: PsExec64 -s -w ${{ github.workspace }} C:\hostedtoolcache\windows\go\${{ steps.go.outputs.go-version }}\x64\bin\go.exe env -w GOCACHE=C:\Users\runneradmin\AppData\Local\go-build - - run: "[Environment]::SetEnvironmentVariable('NETBIRD_STORE_ENGINE', 'jsonfile', 'Machine')" - name: test run: PsExec64 -s -w ${{ github.workspace }} cmd.exe /c "C:\hostedtoolcache\windows\go\${{ steps.go.outputs.go-version }}\x64\bin\go.exe test -timeout 5m -p 1 ./... > test-out.txt 2>&1" diff --git a/client/internal/dns/server_test.go b/client/internal/dns/server_test.go index f3282f1f4..22966d89c 100644 --- a/client/internal/dns/server_test.go +++ b/client/internal/dns/server_test.go @@ -750,6 +750,11 @@ func TestDNSPermanent_matchOnly(t *testing.T) { NSType: nbdns.UDPNameServerType, Port: 53, }, + { + IP: netip.MustParseAddr("9.9.9.9"), + NSType: nbdns.UDPNameServerType, + Port: 53, + }, }, Domains: []string{"customdomain.com"}, Primary: false, diff --git a/management/server/store.go b/management/server/store.go index 7ef090a67..77b8d0dad 100644 --- a/management/server/store.go +++ b/management/server/store.go @@ -103,7 +103,14 @@ func NewStoreFromJson(dataDir string, metrics telemetry.AppMetrics) (Store, erro return nil, err } - switch kind := getStoreEngineFromEnv(); kind { + // if store engine is not set in the config we first try to evaluate NETBIRD_STORE_ENGINE + kind := getStoreEngineFromEnv() + if kind == "" { + // NETBIRD_STORE_ENGINE is not set we evaluate default based on dataDir + kind = getStoreEngineFromDatadir(dataDir) + } + + switch kind { case FileStoreEngine: return fstore, nil case SqliteStoreEngine: