Skip to content

Commit 97040a4

Browse files
Merge remote-tracking branch 'upstream/main' into fix/darwin-dns
* upstream/main: (135 commits) [signal] Fix HTTP/WebSocket proxy not using custom certificates (#4644) [client] Fix active profile name in debug bundle (#4689) [management] Add peer disapproval reason (#4468) [misc] Update tag name extraction in install.sh (#4677) [client] Clean up match domain reg entries between config changes (#4676) [client] Delete TURNConfig section from script (#4639) [client] Security upgrade alpine from 3.22.0 to 3.22.2 #4618 [client] Fix status showing P2P without connection (#4661) [client] Support BROWSER env for login (#4654) [client] Remove rule squashing (#4653) Handle the case when the service has already been down and the status recorder is not available (#4652) [client] Set default wg port for new profiles (#4651) [client] Add bind activity listener to bypass udp sockets (#4646) [client] Fix missing flag values in profiles (#4650) [management] feat: Basic PocketID IDP integration (#4529) [client] Force TLS1.2 for RDP with Win11/Server2025 for CredSSP compatibility (#4617) [misc] Add service definition for netbird-signal (#4620) [management] pass temporary flag to validator (#4599) [client] Explicitly disable DNSOverTLS for systemd-resolved (#4579) [management] sync all other peers on peer add/remove (#4614) ...
2 parents 2d5720a + 709e24e commit 97040a4

File tree

634 files changed

+24400
-7313
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

634 files changed

+24400
-7313
lines changed

.github/pull_request_template.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@
1212
- [ ] Is a feature enhancement
1313
- [ ] It is a refactor
1414
- [ ] Created tests that fail without the change (if possible)
15-
- [ ] Extended the README / documentation, if necessary
1615

1716
> By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md).
17+
18+
## Documentation
19+
Select exactly one:
20+
21+
- [ ] I added/updated documentation for this change
22+
- [ ] Documentation is **not needed** for this change (explain why)
23+
24+
### Docs PR URL (required if "docs added" is checked)
25+
Paste the PR link from https://github.com/netbirdio/docs here:
26+
27+
https://github.com/netbirdio/docs/pull/__
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Check License Dependencies
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
8+
jobs:
9+
check-dependencies:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Check for problematic license dependencies
16+
run: |
17+
echo "Checking for dependencies on management/, signal/, and relay/ packages..."
18+
19+
# Find all directories except the problematic ones and system dirs
20+
FOUND_ISSUES=0
21+
find . -maxdepth 1 -type d -not -name "." -not -name "management" -not -name "signal" -not -name "relay" -not -name ".git*" | sort | while read dir; do
22+
echo "=== Checking $dir ==="
23+
# Search for problematic imports, excluding test files
24+
RESULTS=$(grep -r "github.com/netbirdio/netbird/\(management\|signal\|relay\)" "$dir" --include="*.go" | grep -v "_test.go" | grep -v "test_" | grep -v "/test/" || true)
25+
if [ ! -z "$RESULTS" ]; then
26+
echo "❌ Found problematic dependencies:"
27+
echo "$RESULTS"
28+
FOUND_ISSUES=1
29+
else
30+
echo "✓ No problematic dependencies found"
31+
fi
32+
done
33+
if [ $FOUND_ISSUES -eq 1 ]; then
34+
echo ""
35+
echo "❌ Found dependencies on management/, signal/, or relay/ packages"
36+
echo "These packages will change license and should not be imported by client or shared code"
37+
exit 1
38+
else
39+
echo ""
40+
echo "✅ All license dependencies are clean"
41+
fi

.github/workflows/docs-ack.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: Docs Acknowledgement
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, synchronize]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: read
10+
11+
jobs:
12+
docs-ack:
13+
name: Require docs PR URL or explicit "not needed"
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Read PR body
18+
id: body
19+
shell: bash
20+
run: |
21+
set -euo pipefail
22+
BODY_B64=$(jq -r '.pull_request.body // "" | @base64' "$GITHUB_EVENT_PATH")
23+
{
24+
echo "body_b64=$BODY_B64"
25+
} >> "$GITHUB_OUTPUT"
26+
27+
- name: Validate checkbox selection
28+
id: validate
29+
shell: bash
30+
env:
31+
BODY_B64: ${{ steps.body.outputs.body_b64 }}
32+
run: |
33+
set -euo pipefail
34+
if ! body="$(printf '%s' "$BODY_B64" | base64 -d)"; then
35+
echo "::error::Failed to decode PR body from base64. Data may be corrupted or missing."
36+
exit 1
37+
fi
38+
39+
added_checked=$(printf '%s' "$body" | grep -Ei '^[[:space:]]*-\s*\[x\]\s*I added/updated documentation' | wc -l | tr -d '[:space:]' || true)
40+
noneed_checked=$(printf '%s' "$body" | grep -Ei '^[[:space:]]*-\s*\[x\]\s*Documentation is \*\*not needed\*\*' | wc -l | tr -d '[:space:]' || true)
41+
42+
43+
if [ "$added_checked" -eq 1 ] && [ "$noneed_checked" -eq 1 ]; then
44+
echo "::error::Choose exactly one: either 'docs added' OR 'not needed'."
45+
exit 1
46+
fi
47+
48+
if [ "$added_checked" -eq 0 ] && [ "$noneed_checked" -eq 0 ]; then
49+
echo "::error::You must check exactly one docs option in the PR template."
50+
exit 1
51+
fi
52+
53+
if [ "$added_checked" -eq 1 ]; then
54+
echo "mode=added" >> "$GITHUB_OUTPUT"
55+
else
56+
echo "mode=noneed" >> "$GITHUB_OUTPUT"
57+
fi
58+
59+
- name: Extract docs PR URL (when 'docs added')
60+
if: steps.validate.outputs.mode == 'added'
61+
id: extract
62+
shell: bash
63+
env:
64+
BODY_B64: ${{ steps.body.outputs.body_b64 }}
65+
run: |
66+
set -euo pipefail
67+
body="$(printf '%s' "$BODY_B64" | base64 -d)"
68+
69+
# Strictly require HTTPS and that it's a PR in netbirdio/docs
70+
# e.g., https://github.com/netbirdio/docs/pull/1234
71+
url="$(printf '%s' "$body" | grep -Eo 'https://github\.com/netbirdio/docs/pull/[0-9]+' | head -n1 || true)"
72+
73+
if [ -z "${url:-}" ]; then
74+
echo "::error::You checked 'docs added' but didn't include a valid HTTPS PR link to netbirdio/docs (e.g., https://github.com/netbirdio/docs/pull/1234)."
75+
exit 1
76+
fi
77+
78+
pr_number="$(printf '%s' "$url" | sed -E 's#.*/pull/([0-9]+)$#\1#')"
79+
{
80+
echo "url=$url"
81+
echo "pr_number=$pr_number"
82+
} >> "$GITHUB_OUTPUT"
83+
84+
- name: Verify docs PR exists (and is open or merged)
85+
if: steps.validate.outputs.mode == 'added'
86+
uses: actions/github-script@v7
87+
id: verify
88+
with:
89+
pr_number: ${{ steps.extract.outputs.pr_number }}
90+
script: |
91+
const prNumber = parseInt(core.getInput('pr_number'), 10);
92+
const { data } = await github.rest.pulls.get({
93+
owner: 'netbirdio',
94+
repo: 'docs',
95+
pull_number: prNumber
96+
});
97+
98+
// Allow open or merged PRs
99+
const ok = data.state === 'open' || data.merged === true;
100+
core.setOutput('state', data.state);
101+
core.setOutput('merged', String(!!data.merged));
102+
if (!ok) {
103+
core.setFailed(`Docs PR #${prNumber} exists but is neither open nor merged (state=${data.state}, merged=${data.merged}).`);
104+
}
105+
result-encoding: string
106+
github-token: ${{ secrets.GITHUB_TOKEN }}
107+
108+
- name: All good
109+
run: echo "Documentation requirement satisfied ✅"

.github/workflows/forum.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Post release topic on Discourse
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
post:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: roots/discourse-topic-github-release-action@main
12+
with:
13+
discourse-api-key: ${{ secrets.DISCOURSE_RELEASES_API_KEY }}
14+
discourse-base-url: https://forum.netbird.io
15+
discourse-author-username: NetBird
16+
discourse-category: 17
17+
discourse-tags:
18+
releases

.github/workflows/golang-test-freebsd.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ jobs:
2525
release: "14.2"
2626
prepare: |
2727
pkg install -y curl pkgconf xorg
28-
LATEST_VERSION=$(curl -s https://go.dev/VERSION?m=text|head -n 1)
29-
GO_TARBALL="$LATEST_VERSION.freebsd-amd64.tar.gz"
28+
GO_TARBALL="go1.23.12.freebsd-amd64.tar.gz"
3029
GO_URL="https://go.dev/dl/$GO_TARBALL"
3130
curl -vLO "$GO_URL"
3231
tar -C /usr/local -vxzf "$GO_TARBALL"

.github/workflows/golang-test-linux.yml

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ jobs:
217217
- arch: "386"
218218
raceFlag: ""
219219
- arch: "amd64"
220-
raceFlag: ""
220+
raceFlag: "-race"
221221
runs-on: ubuntu-22.04
222222
steps:
223223
- name: Install Go
@@ -259,7 +259,7 @@ jobs:
259259
CGO_ENABLED=1 GOARCH=${{ matrix.arch }} \
260260
go test ${{ matrix.raceFlag }} \
261261
-exec 'sudo' \
262-
-timeout 10m ./relay/...
262+
-timeout 10m ./relay/... ./shared/relay/...
263263
264264
test_signal:
265265
name: "Signal / Unit"
@@ -309,7 +309,7 @@ jobs:
309309
CGO_ENABLED=1 GOARCH=${{ matrix.arch }} \
310310
go test \
311311
-exec 'sudo' \
312-
-timeout 10m ./signal/...
312+
-timeout 10m ./signal/... ./shared/signal/...
313313
314314
test_management:
315315
name: "Management / Unit"
@@ -369,7 +369,7 @@ jobs:
369369
CI=true \
370370
go test -tags=devcert \
371371
-exec "sudo --preserve-env=CI,NETBIRD_STORE_ENGINE" \
372-
-timeout 20m ./management/...
372+
-timeout 20m ./management/... ./shared/management/...
373373
374374
benchmark:
375375
name: "Management / Benchmark"
@@ -382,6 +382,32 @@ jobs:
382382
store: [ 'sqlite', 'postgres' ]
383383
runs-on: ubuntu-22.04
384384
steps:
385+
- name: Create Docker network
386+
run: docker network create promnet
387+
388+
- name: Start Prometheus Pushgateway
389+
run: docker run -d --name pushgateway --network promnet -p 9091:9091 prom/pushgateway
390+
391+
- name: Start Prometheus (for Pushgateway forwarding)
392+
run: |
393+
echo '
394+
global:
395+
scrape_interval: 15s
396+
scrape_configs:
397+
- job_name: "pushgateway"
398+
static_configs:
399+
- targets: ["pushgateway:9091"]
400+
remote_write:
401+
- url: ${{ secrets.GRAFANA_URL }}
402+
basic_auth:
403+
username: ${{ secrets.GRAFANA_USER }}
404+
password: ${{ secrets.GRAFANA_API_KEY }}
405+
' > prometheus.yml
406+
407+
docker run -d --name prometheus --network promnet \
408+
-v $PWD/prometheus.yml:/etc/prometheus/prometheus.yml \
409+
-p 9090:9090 \
410+
prom/prometheus
385411
- name: Install Go
386412
uses: actions/setup-go@v5
387413
with:
@@ -428,9 +454,10 @@ jobs:
428454
CGO_ENABLED=1 GOARCH=${{ matrix.arch }} \
429455
NETBIRD_STORE_ENGINE=${{ matrix.store }} \
430456
CI=true \
457+
GIT_BRANCH=${{ github.ref_name }} \
431458
go test -tags devcert -run=^$ -bench=. \
432-
-exec 'sudo --preserve-env=CI,NETBIRD_STORE_ENGINE' \
433-
-timeout 20m ./management/...
459+
-exec 'sudo --preserve-env=CI,NETBIRD_STORE_ENGINE,GIT_BRANCH,GITHUB_RUN_ID' \
460+
-timeout 20m ./management/... ./shared/management/... $(go list ./management/... ./shared/management/... | grep -v -e /management/server/http)
434461
435462
api_benchmark:
436463
name: "Management / Benchmark (API)"
@@ -521,7 +548,7 @@ jobs:
521548
-run=^$ \
522549
-bench=. \
523550
-exec 'sudo --preserve-env=CI,NETBIRD_STORE_ENGINE,GIT_BRANCH,GITHUB_RUN_ID' \
524-
-timeout 20m ./management/...
551+
-timeout 20m ./management/server/http/...
525552
526553
api_integration_test:
527554
name: "Management / Integration"
@@ -571,4 +598,4 @@ jobs:
571598
CI=true \
572599
go test -tags=integration \
573600
-exec 'sudo --preserve-env=CI,NETBIRD_STORE_ENGINE' \
574-
-timeout 20m ./management/...
601+
-timeout 20m ./management/server/http/...

.github/workflows/golang-test-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
- run: PsExec64 -s -w ${{ github.workspace }} C:\hostedtoolcache\windows\go\${{ steps.go.outputs.go-version }}\x64\bin\go.exe env -w GOMODCACHE=${{ env.cache }}
6464
- run: PsExec64 -s -w ${{ github.workspace }} C:\hostedtoolcache\windows\go\${{ steps.go.outputs.go-version }}\x64\bin\go.exe env -w GOCACHE=${{ env.modcache }}
6565
- run: PsExec64 -s -w ${{ github.workspace }} C:\hostedtoolcache\windows\go\${{ steps.go.outputs.go-version }}\x64\bin\go.exe mod tidy
66-
- run: echo "files=$(go list ./... | ForEach-Object { $_ } | Where-Object { $_ -notmatch '/management' })" >> $env:GITHUB_ENV
66+
- run: echo "files=$(go list ./... | ForEach-Object { $_ } | Where-Object { $_ -notmatch '/management' } | Where-Object { $_ -notmatch '/relay' } | Where-Object { $_ -notmatch '/signal' })" >> $env:GITHUB_ENV
6767

6868
- name: test
6969
run: PsExec64 -s -w ${{ github.workspace }} cmd.exe /c "C:\hostedtoolcache\windows\go\${{ steps.go.outputs.go-version }}\x64\bin\go.exe test -tags=devcert -timeout 10m -p 1 ${{ env.files }} > test-out.txt 2>&1"

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: codespell
2020
uses: codespell-project/actions-codespell@v2
2121
with:
22-
ignore_words_list: erro,clienta,hastable,iif,groupd,testin,groupe
22+
ignore_words_list: erro,clienta,hastable,iif,groupd,testin,groupe,cros
2323
skip: go.mod,go.sum
2424
golangci:
2525
strategy:

.github/workflows/release.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
pull_request:
1010

1111
env:
12-
SIGN_PIPE_VER: "v0.0.21"
12+
SIGN_PIPE_VER: "v0.0.23"
1313
GORELEASER_VER: "v2.3.2"
1414
PRODUCT_NAME: "NetBird"
1515
COPYRIGHT: "NetBird GmbH"
@@ -79,6 +79,8 @@ jobs:
7979
run: go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@233067e
8080
- name: Generate windows syso amd64
8181
run: goversioninfo -icon client/ui/assets/netbird.ico -manifest client/manifest.xml -product-name ${{ env.PRODUCT_NAME }} -copyright "${{ env.COPYRIGHT }}" -ver-major ${{ steps.semver_parser.outputs.major }} -ver-minor ${{ steps.semver_parser.outputs.minor }} -ver-patch ${{ steps.semver_parser.outputs.patch }} -ver-build 0 -file-version ${{ steps.semver_parser.outputs.fullversion }}.0 -product-version ${{ steps.semver_parser.outputs.fullversion }}.0 -o client/resources_windows_amd64.syso
82+
- name: Generate windows syso arm64
83+
run: goversioninfo -arm -64 -icon client/ui/assets/netbird.ico -manifest client/manifest.xml -product-name ${{ env.PRODUCT_NAME }} -copyright "${{ env.COPYRIGHT }}" -ver-major ${{ steps.semver_parser.outputs.major }} -ver-minor ${{ steps.semver_parser.outputs.minor }} -ver-patch ${{ steps.semver_parser.outputs.patch }} -ver-build 0 -file-version ${{ steps.semver_parser.outputs.fullversion }}.0 -product-version ${{ steps.semver_parser.outputs.fullversion }}.0 -o client/resources_windows_arm64.syso
8284
- name: Run GoReleaser
8385
uses: goreleaser/goreleaser-action@v4
8486
with:
@@ -154,10 +156,20 @@ jobs:
154156

155157
- name: Install dependencies
156158
run: sudo apt update && sudo apt install -y -q libappindicator3-dev gir1.2-appindicator3-0.1 libxxf86vm-dev gcc-mingw-w64-x86-64
159+
160+
- name: Install LLVM-MinGW for ARM64 cross-compilation
161+
run: |
162+
cd /tmp
163+
wget -q https://github.com/mstorsjo/llvm-mingw/releases/download/20250709/llvm-mingw-20250709-ucrt-ubuntu-22.04-x86_64.tar.xz
164+
echo "60cafae6474c7411174cff1d4ba21a8e46cadbaeb05a1bace306add301628337 llvm-mingw-20250709-ucrt-ubuntu-22.04-x86_64.tar.xz" | sha256sum -c
165+
tar -xf llvm-mingw-20250709-ucrt-ubuntu-22.04-x86_64.tar.xz
166+
echo "/tmp/llvm-mingw-20250709-ucrt-ubuntu-22.04-x86_64/bin" >> $GITHUB_PATH
157167
- name: Install goversioninfo
158168
run: go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@233067e
159169
- name: Generate windows syso amd64
160170
run: goversioninfo -64 -icon client/ui/assets/netbird.ico -manifest client/ui/manifest.xml -product-name ${{ env.PRODUCT_NAME }}-"UI" -copyright "${{ env.COPYRIGHT }}" -ver-major ${{ steps.semver_parser.outputs.major }} -ver-minor ${{ steps.semver_parser.outputs.minor }} -ver-patch ${{ steps.semver_parser.outputs.patch }} -ver-build 0 -file-version ${{ steps.semver_parser.outputs.fullversion }}.0 -product-version ${{ steps.semver_parser.outputs.fullversion }}.0 -o client/ui/resources_windows_amd64.syso
171+
- name: Generate windows syso arm64
172+
run: goversioninfo -arm -64 -icon client/ui/assets/netbird.ico -manifest client/ui/manifest.xml -product-name ${{ env.PRODUCT_NAME }}-"UI" -copyright "${{ env.COPYRIGHT }}" -ver-major ${{ steps.semver_parser.outputs.major }} -ver-minor ${{ steps.semver_parser.outputs.minor }} -ver-patch ${{ steps.semver_parser.outputs.patch }} -ver-build 0 -file-version ${{ steps.semver_parser.outputs.fullversion }}.0 -product-version ${{ steps.semver_parser.outputs.fullversion }}.0 -o client/ui/resources_windows_arm64.syso
161173

162174
- name: Run GoReleaser
163175
uses: goreleaser/goreleaser-action@v4
@@ -231,17 +243,3 @@ jobs:
231243
ref: ${{ env.SIGN_PIPE_VER }}
232244
token: ${{ secrets.SIGN_GITHUB_TOKEN }}
233245
inputs: '{ "tag": "${{ github.ref }}", "skipRelease": false }'
234-
235-
post_on_forum:
236-
runs-on: ubuntu-latest
237-
continue-on-error: true
238-
needs: [trigger_signer]
239-
steps:
240-
- uses: Codixer/[email protected]
241-
with:
242-
discourse-api-key: ${{ secrets.DISCOURSE_RELEASES_API_KEY }}
243-
discourse-base-url: https://forum.netbird.io
244-
discourse-author-username: NetBird
245-
discourse-category: 17
246-
discourse-tags:
247-
releases

.github/workflows/test-infrastructure-files.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,15 @@ jobs:
8383
- name: Checkout code
8484
uses: actions/checkout@v4
8585

86+
- name: Setup MySQL privileges
87+
if: matrix.store == 'mysql'
88+
run: |
89+
sleep 10
90+
mysql -h 127.0.0.1 -u root -pmysqlroot -e "
91+
GRANT SYSTEM_VARIABLES_ADMIN ON *.* TO 'netbird'@'%';
92+
FLUSH PRIVILEGES;
93+
"
94+
8695
- name: cp setup.env
8796
run: cp infrastructure_files/tests/setup.env infrastructure_files/
8897

0 commit comments

Comments
 (0)