fix(pia): complete native WireGuard reconnect handling - #1
Draft
m4r1k wants to merge 43 commits into
Draft
Conversation
- Go upgraded from 1.25 to 1.26 - `golangci-lint` upgraded from v2.4.0 to v2.11.4 - `mockgen` and `gomock` upgraded from `golang/mock` to `uber-go/mock` v0.6.0
…que#3400) Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: Quentin McGaw <quentin.mcgaw@gmail.com> Thanks also to @arturhoo for also trying to resolve this issue in passteque#3410
Co-authored-by: OctoBored <212877535+OctoBored@users.noreply.github.com>
- enforce format with warning message - ask the user to tick a type for the PR (AI generated, human written, etc.) - Precise issue linking is optional - Add optional gluetun wiki PR linking section
- `UPDATER_PROTONVPN_TOTP_SECRET` option (and `-proton-totp-secret` cli updater flag) to provide the TOTP long key to set TOTP permanently - Updater CLI flag `-proton-totp-code` to provide a TOTP 6 digits code - Human verification support showing the URL and using it for a subsequent request retry - Fix passteque#3440
…RS_AS_LOCAL` options (passteque#3430)
# Conflicts: # internal/firewall/interfaces.go # internal/firewall/iptables/iptables.go
Replace SO_MARK and system-resolver bootstrap traffic with source-port-scoped DoH and HTTPS connections. This keeps server discovery, token retrieval, and key registration independent of tunnel DNS during reconnects.
Use the prospective VPN state when applying partial settings so tunnel shutdown can clear PIA runtime fields and stop the keepalive service.
Reject user-provided pre-shared keys and disable IPv6 routes for PIA's dynamically registered IPv4-only tunnels.
Keep every matching live PIA endpoint and use the shared connection picker so reconnect attempts do not remain pinned to the first server returned by the API.
Probe addKey's server_vip directly for port forwarding, then retain the existing OpenVPN-derived gateway addresses as fallbacks.
Leave global startup check timing unchanged so the native PIA WireGuard work can be reviewed independently.
Keep validation and error formatting readable under the current complexity, security, and style checks without changing the connection behavior.
PIA assigns the interface address during addKey registration, so reject user-provided addresses instead of silently replacing them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type
Please tick which one the following applies to your pull request:
Description
This is a follow-up review branch for passteque#3393. It targets
neilcorp2kx:feat/pia-wireguard-native, not upstreammaster.The branch first synchronizes passteque#3393 with current upstream master, then addresses the review and live-test failures reported on the original PR:
SO_MARKbootstrap firewall implementation with the mergedinternal/restrictednetsource-port-scoped DoH and HTTPS pathaddKeyregistration independent of tunnel DNS during reconnectsaddKeyserver_vipdirectly for port forwarding before the existing OpenVPN-derived gateway fallbacksThe persisted PIA port-forward payload intentionally remains server-independent. PIA documents payload and signature reuse across servers, and the live reconnect test below successfully rebound the same port after switching endpoints.
Verification
Repository checks:
docker build --no-cache --target lint .docker build --target mocks .docker build --target xcompile .go test -raceacross settings, firewall, restrictednet, PIA provider/updater, provider utilities, port forwarding, VPN, and healthcheck packagesgo test -tags=integration ./internal/restrictednetAuthenticated PIA test against CA Vancouver with the firewall and port forwarding enabled:
iptables OUTPUTafter bootstrap; only the active WireGuard endpoint and tunnel rules remainedtun0to reproduce the reported health failureserver name not setaddKeyregistration throughrestrictednetTraditional PIA OpenVPN regression against CA Vancouver with the same image:
tun0iptables OUTPUT; only the OpenVPN endpoint and tunnel rules were presentThe default full test-container run still reports the same
internal/netlinkandinternal/pmtud/tcpfailures as current upstream master on the test host. SELinux audit records showcontainer_tbeing deniedmodule_requestforrtnl-link-wireguardandipt_mark; these are host-policy failures, not branch-only failures. The authenticated tunnel test was run during a user-controlled temporary permissive window.AI was used for code analysis and code generation. I reviewed the resulting changes, tests, and live verification output before proposing them.
Issue (optional)
Follow-up fixes for passteque#3393.
Gluetun wiki associated pull request (optional)
None.