-
-
Notifications
You must be signed in to change notification settings - Fork 590
PureVPN provider revamp #3165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
reedog117
wants to merge
22
commits into
passteque:master
Choose a base branch
from
reedog117:codex/purevpn-deb-updater
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
PureVPN provider revamp #3165
Changes from 21 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
40812fc
fix(firewall): flush conntrack table after enabling firewall at conta…
qdm12 ee8d62e
purevpn: switch updater to linux deb local-data and protocol ports
2a49d27
purevpn: improve resolver fallback and update OpenVPN port defaults
388e628
purevpn updater: fetch live inventory from app-derived URL
dbe31bc
purevpn: add hostname-trait server type selection
32ff15d
purevpn: add deterministic hostname-code location filters
f81d061
purevpn: add template ingestion and p2p server type support
6838917
purevpn: merge app local data and add multi-trait filter tests
2e88ef2
purevpn: switch to city-only filters and match-all tags
f7b0e54
chore: remove local purevpn test harness scripts from repo
5a6b7c9
purevpn: add OpenVPN fallback remote lines for port 1194
57662fc
Merge origin/master into codex/purevpn-deb-updater
f9ec7ba
chore: remove CSV/TSV PureVPN export tests from repo
a4afbe4
purevpn: expand city code mappings and tighten inventory-port tests
eac0f01
purevpn: remove atom secret env override and related tests
bfe558d
purevpn: remove fallback ports and reseller uid parsing test
9c63460
chore(deps): tidy purevpn module dependencies
b89cbbf
purevpn: apply review feedback and split selector features out
7253ec1
Merge upstream/master into codex/purevpn-deb-updater
f0247ff
Merge branch 'master' into codex/purevpn-deb-updater
reedog117 164d724
Merge branch 'master' into codex/purevpn-deb-updater
reedog117 4ed9152
Merge branch 'master' into codex/purevpn-deb-updater
qdm12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| PUREVPN_USER=your-username | ||
| PUREVPN_PASSWORD=your-password | ||
| # Optional timezone for container logs | ||
| TZ=UTC | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| scratch.txt | ||
| .env.purevpn | ||
|
qdm12 marked this conversation as resolved.
|
||
| .DS_Store | ||
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
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,62 @@ | ||||||||||||||||
| package settings | ||||||||||||||||
|
|
||||||||||||||||
| import ( | ||||||||||||||||
| "testing" | ||||||||||||||||
|
|
||||||||||||||||
| "github.com/qdm12/gluetun/internal/constants" | ||||||||||||||||
| "github.com/qdm12/gluetun/internal/constants/providers" | ||||||||||||||||
| "github.com/stretchr/testify/assert" | ||||||||||||||||
| "github.com/stretchr/testify/require" | ||||||||||||||||
| ) | ||||||||||||||||
|
|
||||||||||||||||
| func Test_OpenVPNSelection_validate(t *testing.T) { | ||||||||||||||||
| t.Parallel() | ||||||||||||||||
|
|
||||||||||||||||
| testCases := map[string]struct { | ||||||||||||||||
| selection OpenVPNSelection | ||||||||||||||||
| provider string | ||||||||||||||||
| err error | ||||||||||||||||
| }{ | ||||||||||||||||
| "purevpn default selection is valid": { | ||||||||||||||||
|
qdm12 marked this conversation as resolved.
|
||||||||||||||||
| selection: openVPNSelectionForValidation(providers.Purevpn), | ||||||||||||||||
| provider: providers.Purevpn, | ||||||||||||||||
| }, | ||||||||||||||||
| "purevpn TCP without custom port is valid": { | ||||||||||||||||
| selection: func() OpenVPNSelection { | ||||||||||||||||
| s := openVPNSelectionForValidation(providers.Purevpn) | ||||||||||||||||
| s.Protocol = constants.TCP | ||||||||||||||||
| return s | ||||||||||||||||
| }(), | ||||||||||||||||
| provider: providers.Purevpn, | ||||||||||||||||
| }, | ||||||||||||||||
| "purevpn custom port is rejected": { | ||||||||||||||||
| selection: func() OpenVPNSelection { | ||||||||||||||||
| s := openVPNSelectionForValidation(providers.Purevpn) | ||||||||||||||||
| *s.CustomPort = 1194 | ||||||||||||||||
| return s | ||||||||||||||||
| }(), | ||||||||||||||||
| provider: providers.Purevpn, | ||||||||||||||||
| err: ErrOpenVPNCustomPortNotAllowed, | ||||||||||||||||
| }, | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| for name, testCase := range testCases { | ||||||||||||||||
| t.Run(name, func(t *testing.T) { | ||||||||||||||||
| t.Parallel() | ||||||||||||||||
|
|
||||||||||||||||
| err := testCase.selection.validate(testCase.provider) | ||||||||||||||||
| if testCase.err == nil { | ||||||||||||||||
| require.NoError(t, err) | ||||||||||||||||
| return | ||||||||||||||||
| } | ||||||||||||||||
| require.Error(t, err) | ||||||||||||||||
| assert.ErrorIs(t, err, testCase.err) | ||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same thing as
Suggested change
|
||||||||||||||||
| }) | ||||||||||||||||
| } | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| func openVPNSelectionForValidation(provider string) OpenVPNSelection { | ||||||||||||||||
| selection := OpenVPNSelection{} | ||||||||||||||||
| selection.setDefaults(provider) | ||||||||||||||||
| return selection | ||||||||||||||||
| } | ||||||||||||||||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -103,6 +103,10 @@ func (ss *ServerSelection) validate(vpnServiceProvider string, | |
| *ss = nordvpnRetroRegion(*ss, filterChoices.Regions, filterChoices.Countries) | ||
| case providers.Surfshark: | ||
| *ss = surfsharkRetroRegion(*ss) | ||
| case providers.Purevpn: | ||
| // Keep parsing SERVER_REGIONS for retro-compatibility, but | ||
| // do not apply it to PureVPN filtering. | ||
| ss.Regions = nil | ||
|
Comment on lines
+95
to
+97
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not? It should still be applied somehow, otherwise it breaks compatibility. |
||
| } | ||
|
|
||
| err = validateServerFilters(*ss, filterChoices, vpnServiceProvider, warner) | ||
|
|
||
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.