Conversation
|
Understand this PR’s impact Explore downstream dependencies and potential security impact with Blast Radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. WalkthroughThe change adds optional WireGuard MTU configuration. Values are validated between 576 and 9000. The manager applies MTU values during interface initialization and configuration restart, while tracking the kernel default for restoration. ChangesWireGuard MTU management
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant WireGuard
participant Manager
participant netlink
WireGuard->>Manager: initializeWithPeers(..., mtu)
Manager->>netlink: Apply interface MTU
netlink-->>Manager: Return MTU result
Manager-->>WireGuard: Return initialization result
WireGuard->>Manager: applyConfig(config, mtu)
Manager->>netlink: Apply interface MTU
netlink-->>Manager: Return MTU result
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit sets the MTU with care Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
WireGuard core configs currently ignore
mtu, so changing it in the panel does not change the server interface. Accept an optional integer MTU (576–9000) and apply it before the interface is brought up and during in-place restarts.Keep the kernel default when MTU is omitted. Capture the interface MTU before the first override so clearing the setting restores it. Reject invalid values before interface initialization and propagate netlink failures through the existing permission-error handling.
Related to PasarGuard/panel#906. Companion panel PR: PasarGuard/panel#917.
Validation
Verified on Linux against this PR's production code using a separate fork branch: https://github.com/dr-hoseyn/node/actions/runs/35507877164
go test -race ./backend/wireguard.go build ./cmd/nodeandgit diff --check.make testwas also run but is not green: the unchanged controller tests callkeepAliveStalewith three arguments while the dev implementation accepts two; Xray and REST/RPC tests require the Xray binary and TLS fixtures absent from this runner. The verification workflow allows that full-suite step to fail so the independent WireGuard checks can complete.Only three production Go files are included. Verification-only tests and workflow are in a separate branch; no test or documentation files are part of this PR.
Summary by CodeRabbit
New Features
Bug Fixes