Compare commits
256 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f569998c93 | ||
|
|
9877366c51 | ||
|
|
61066e3896 | ||
|
|
c777f8d97d | ||
|
|
7d4f5c8906 | ||
|
|
da39d07d48 | ||
|
|
b98f2456c0 | ||
|
|
564cc2b0bc | ||
|
|
49885c63c4 | ||
|
|
d7a6caa2ac | ||
|
|
73c383fd65 | ||
|
|
10b270f742 | ||
|
|
7a222923c7 | ||
|
|
430512dd27 | ||
|
|
d5ba15c23b | ||
|
|
037b43ee10 | ||
|
|
ab910403c6 | ||
|
|
8105437815 | ||
|
|
7b20cec035 | ||
|
|
8d512852a4 | ||
|
|
c8ad9b942a | ||
|
|
8153d4bb2a | ||
|
|
849dfee200 | ||
|
|
85540d96b6 | ||
|
|
7479974d79 | ||
|
|
3f1fb52fcb | ||
|
|
7e343d7006 | ||
|
|
72a5e1f695 | ||
|
|
253310bd1a | ||
|
|
fa6ccb08bd | ||
|
|
762507855e | ||
|
|
54610866f2 | ||
|
|
c39ff5c233 | ||
|
|
2ddc784965 | ||
|
|
10aabe8375 | ||
|
|
122647b39d | ||
|
|
02492c34a7 | ||
|
|
9436f604ba | ||
|
|
d9ca0deb08 | ||
|
|
0b985e8c35 | ||
|
|
c5d92ae02c | ||
|
|
94b60d9f70 | ||
|
|
b23eb8f29d | ||
|
|
3c44214d01 | ||
|
|
21f4cf7ab5 | ||
|
|
e94684aa39 | ||
|
|
a34cc48197 | ||
|
|
b262d91ccc | ||
|
|
39aa983771 | ||
|
|
5b9887dade | ||
|
|
c33402ce66 | ||
|
|
6f58f84151 | ||
|
|
6acb7caf5b | ||
|
|
8beff34cca | ||
|
|
478e0f74f7 | ||
|
|
b7bd23ab60 | ||
|
|
82533c1453 | ||
|
|
e0735b57ce | ||
|
|
1e0bfc3b0c | ||
|
|
cb0e89a38e | ||
|
|
da4d528463 | ||
|
|
394abbbe35 | ||
|
|
fd39bc8518 | ||
|
|
2663e8fba7 | ||
|
|
faebac6a77 | ||
|
|
bc1b09e997 | ||
|
|
af358f777b | ||
|
|
c0d27b4bfc | ||
|
|
7e50c95823 | ||
|
|
39068dda17 | ||
|
|
8185979ca4 | ||
|
|
7c44188130 | ||
|
|
c2d527bbd3 | ||
|
|
ac3ff095a1 | ||
|
|
0ed738cd61 | ||
|
|
6bbb7c8f7d | ||
|
|
d29429808c | ||
|
|
09eccd7cd9 | ||
|
|
bb2b8b4514 | ||
|
|
e20b9c5774 | ||
|
|
3badfa197a | ||
|
|
dee372e71b | ||
|
|
679be6e1bd | ||
|
|
92212fdd11 | ||
|
|
a6fb1ad9ef | ||
|
|
87d712fbd7 | ||
|
|
023809f099 | ||
|
|
ace37370d1 | ||
|
|
8efbd4fac1 | ||
|
|
06c8792887 | ||
|
|
3ea376a1b2 | ||
|
|
9667d30907 | ||
|
|
3f7ccc6c49 | ||
|
|
dd97ff5895 | ||
|
|
2e4d80d9bc | ||
|
|
1227dc5a2b | ||
|
|
ed828bc733 | ||
|
|
c25a018c05 | ||
|
|
266596af68 | ||
|
|
2c77b73ebc | ||
|
|
d81d4bbda3 | ||
|
|
400affe429 | ||
|
|
d3c63680e8 | ||
|
|
28de8a834c | ||
|
|
208374fc54 | ||
|
|
535a136a27 | ||
|
|
ba4c3e30a4 | ||
|
|
16d8a388cb | ||
|
|
5ea31b0b64 | ||
|
|
582c6d1c43 | ||
|
|
c63ae3f3af | ||
|
|
4c0df96a95 | ||
|
|
05c6b9379a | ||
|
|
fb7fdcd925 | ||
|
|
1774e2ad88 | ||
|
|
a402d9135e | ||
|
|
3d2c56d9ee | ||
|
|
f9308e6fed | ||
|
|
6710468020 | ||
|
|
ad1981fff6 | ||
|
|
01f9e71912 | ||
|
|
d41b75ee35 | ||
|
|
b829490aac | ||
|
|
7002bf8e34 | ||
|
|
625ea493fb | ||
|
|
79b3b2823b | ||
|
|
9be912e9fd | ||
|
|
3c3cd431cd | ||
|
|
8b8bab5c58 | ||
|
|
835fa6c41f | ||
|
|
8a6cf221a9 | ||
|
|
876563c492 | ||
|
|
be22c8547f | ||
|
|
82d98c4859 | ||
|
|
f1b5341f33 | ||
|
|
b3829493ea | ||
|
|
7db1253967 | ||
|
|
449db40d5f | ||
|
|
d5d0311bc6 | ||
|
|
0c4f01a892 | ||
|
|
bc7246f882 | ||
|
|
da65f3b016 | ||
|
|
a8c574219d | ||
|
|
a3751a77aa | ||
|
|
4f521e4dcb | ||
|
|
a9589d8d5b | ||
|
|
13e75aaf20 | ||
|
|
0c9bd8aaa0 | ||
|
|
5dba91c9ab | ||
|
|
7d6763cde7 | ||
|
|
dd1b23773e | ||
|
|
33253c0cfc | ||
|
|
0099c06056 | ||
|
|
1540660cc3 | ||
|
|
cff5e693d2 | ||
|
|
5159c1dc83 | ||
|
|
ccc7ad7cbd | ||
|
|
c8a61ca687 | ||
|
|
61e36d6aff | ||
|
|
e8c8742bae | ||
|
|
1cb93d76ed | ||
|
|
dadc939aab | ||
|
|
c59ea781e3 | ||
|
|
810ff62c26 | ||
|
|
5a0418bba6 | ||
|
|
baf506ae27 | ||
|
|
52ff03ae41 | ||
|
|
2d95edf8ab | ||
|
|
95b0fb81d6 | ||
|
|
eff65dce00 | ||
|
|
6c1c069261 | ||
|
|
4fe1e062f2 | ||
|
|
1fb0840e72 | ||
|
|
689ddf8bf0 | ||
|
|
d243ac49f3 | ||
|
|
de8f018b14 | ||
|
|
8407542600 | ||
|
|
a7a5cca8dd | ||
|
|
d9a70fd094 | ||
|
|
248cc0d3d3 | ||
|
|
2924d711cb | ||
|
|
d7db105a2f | ||
|
|
2ec2f45c82 | ||
|
|
a34769ae02 | ||
|
|
c0e4d805b1 | ||
|
|
6770336274 | ||
|
|
8d431dbb34 | ||
|
|
e8e7b83297 | ||
|
|
442340dcf2 | ||
|
|
91b037a335 | ||
|
|
d5ef3de64c | ||
|
|
167a0b0b29 | ||
|
|
954e3c70b2 | ||
|
|
b02a80abbd | ||
|
|
04313d3c3b | ||
|
|
fb8279f8f0 | ||
|
|
e0e56595c6 | ||
|
|
44d8cf9d4e | ||
|
|
282c1e53ec | ||
|
|
7ba98af1cc | ||
|
|
d3df5aaa52 | ||
|
|
1c83dcab5e | ||
|
|
6208081788 | ||
|
|
3795e92a82 | ||
|
|
0636123e7a | ||
|
|
69f9461bcd | ||
|
|
d1558a3472 | ||
|
|
8230596f98 | ||
|
|
cc4117e054 | ||
|
|
a0ddbc037f | ||
|
|
de82d4e616 | ||
|
|
fa220f9e93 | ||
|
|
aca112fa42 | ||
|
|
9f4077d35d | ||
|
|
9509b855f1 | ||
|
|
be72f4a046 | ||
|
|
8b36ce198f | ||
|
|
71de05dc68 | ||
|
|
83b5a9457a | ||
|
|
0b7ada9fd9 | ||
|
|
92bcef0b1c | ||
|
|
a10c4056d0 | ||
|
|
1fd3ee7149 | ||
|
|
e3a157bfe1 | ||
|
|
b446aa6590 | ||
|
|
c54ee71e1d | ||
|
|
1748a2ae12 | ||
|
|
eff46aa97a | ||
|
|
9fb186af75 | ||
|
|
f1b1001863 | ||
|
|
c5af536299 | ||
|
|
b9b2f691a5 | ||
|
|
bdc8817672 | ||
|
|
a55acb2816 | ||
|
|
d686c76db3 | ||
|
|
30c1ae651e | ||
|
|
adaad62fbd | ||
|
|
fe5ec205fc | ||
|
|
576400e0d9 | ||
|
|
f08a03106f | ||
|
|
f852b7789e | ||
|
|
b0bd06bdc5 | ||
|
|
84787f0ea2 | ||
|
|
f69b3dbbe6 | ||
|
|
ec5ec6f02c | ||
|
|
5d681e635b | ||
|
|
3deb65b529 | ||
|
|
3e527fee8b | ||
|
|
b1f1f94a76 | ||
|
|
43e140e6cc | ||
|
|
7ca9d445f1 | ||
|
|
90aaf71270 | ||
|
|
4f2570865c | ||
|
|
81556ec2e1 | ||
|
|
dd5a9c6067 | ||
|
|
982c50c756 |
@@ -19,6 +19,7 @@ It works on Linux, Windows and OSX.
|
||||
|
||||
1. Open the command palette in Visual Studio Code (CTRL+SHIFT+P).
|
||||
1. Select `Remote-Containers: Open Folder in Container...` and choose the project directory.
|
||||
1. For Docker running on Windows HyperV, if you want to use SSH keys, bind mount them at `/tmp/.ssh` by changing the `volumes` section in the [docker-compose.yml](docker-compose.yml).
|
||||
|
||||
## Customization
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"vscode"
|
||||
],
|
||||
"shutdownAction": "stopCompose",
|
||||
"postCreateCommand": "go mod download",
|
||||
"postCreateCommand": "source ~/.windows.sh && go mod download && go mod tidy",
|
||||
"workspaceFolder": "/workspace",
|
||||
"extensions": [
|
||||
"golang.go",
|
||||
|
||||
@@ -8,12 +8,17 @@ services:
|
||||
- ../:/workspace
|
||||
# Docker socket to access Docker server
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
# SSH directory
|
||||
- ~/.ssh:/home/vscode/.ssh
|
||||
- ~/.ssh:/root/.ssh
|
||||
# Docker configuration
|
||||
- ~/.docker:/root/.docker:z
|
||||
# SSH directory for Linux, OSX and WSL
|
||||
- ~/.ssh:/root/.ssh:z
|
||||
# For Windows without WSL, a copy will be made
|
||||
# from /tmp/.ssh to ~/.ssh to fix permissions
|
||||
#- ~/.ssh:/tmp/.ssh:ro
|
||||
# Shell history persistence
|
||||
- ~/.zsh_history:/root/.zsh_history:z
|
||||
# Git config
|
||||
- ~/.gitconfig:/home/districter/.gitconfig
|
||||
- ~/.gitconfig:/root/.gitconfig
|
||||
- ~/.gitconfig:/root/.gitconfig:z
|
||||
environment:
|
||||
- TZ=
|
||||
cap_add:
|
||||
|
||||
16
.github/ISSUE_TEMPLATE/bug.md
vendored
16
.github/ISSUE_TEMPLATE/bug.md
vendored
@@ -7,10 +7,16 @@ assignees: qdm12
|
||||
|
||||
---
|
||||
|
||||
**Host OS** (approximate answer is fine too): Ubuntu 18
|
||||
<!---
|
||||
⚠️ Answer the following or I'll insta-close your issue
|
||||
-->
|
||||
|
||||
**Is this urgent?**: No
|
||||
|
||||
**Host OS** (approximate answer is fine too): Ubuntu 18
|
||||
|
||||
**CPU arch** or **device name**: amd64
|
||||
|
||||
**What VPN provider are you using**:
|
||||
|
||||
**What are you using to run your container?**: Docker Compose
|
||||
@@ -25,9 +31,7 @@ Running version latest built on 2020-03-13T01:30:06Z (commit d0f678c)
|
||||
|
||||
That feature doesn't work
|
||||
|
||||
**Share your logs...**
|
||||
|
||||
...*careful to remove i.e. token information with PIA port forwarding*
|
||||
**Share your logs... (careful to remove in example tokens)**
|
||||
|
||||
```log
|
||||
|
||||
@@ -35,3 +39,7 @@ PASTE YOUR LOGS
|
||||
IN THERE
|
||||
|
||||
```
|
||||
|
||||
<!---
|
||||
💡 You can highlight your code with https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlight
|
||||
-->
|
||||
|
||||
22
.github/ISSUE_TEMPLATE/help.md
vendored
22
.github/ISSUE_TEMPLATE/help.md
vendored
@@ -7,10 +7,22 @@ assignees:
|
||||
|
||||
---
|
||||
|
||||
**Host OS** (approximate answer is fine too): Ubuntu 18
|
||||
<!---
|
||||
⚠️ If this about a Docker configuration problem or another service:
|
||||
Start a discussion at https://github.com/qdm12/gluetun/discussions/new
|
||||
OR I WILL INSTA-CLOSE YOUR ISSUE.
|
||||
-->
|
||||
|
||||
<!---
|
||||
⚠️ Answer the following or I'll insta-close your issue
|
||||
-->
|
||||
|
||||
**Is this urgent?**: No
|
||||
|
||||
**Host OS** (approximate answer is fine too): Ubuntu 18
|
||||
|
||||
**CPU arch** or **device name**: amd64
|
||||
|
||||
**What VPN provider are you using**:
|
||||
|
||||
**What is the version of the program** (See the line at the top of your logs)
|
||||
@@ -23,9 +35,7 @@ Running version latest built on 2020-03-13T01:30:06Z (commit d0f678c)
|
||||
|
||||
That feature doesn't work
|
||||
|
||||
**Share your logs...**
|
||||
|
||||
...*careful to remove i.e. token information with PIA port forwarding*
|
||||
**Share your logs... (careful to remove in example tokens)**
|
||||
|
||||
```log
|
||||
|
||||
@@ -36,6 +46,10 @@ IN THERE
|
||||
|
||||
**What are you using to run your container?**: Docker Compose
|
||||
|
||||
<!---
|
||||
💡 You can highlight your code with https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlight
|
||||
-->
|
||||
|
||||
Please also share your configuration file:
|
||||
|
||||
```yml
|
||||
|
||||
17
.github/ISSUE_TEMPLATE/provider.md
vendored
Normal file
17
.github/ISSUE_TEMPLATE/provider.md
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
name: Support a VPN provider
|
||||
about: Suggest a VPN provider to be supported
|
||||
title: 'VPN provider support: NAME OF THE PROVIDER'
|
||||
labels: ":bulb: New provider"
|
||||
|
||||
---
|
||||
|
||||
One of the following is required:
|
||||
|
||||
- Publicly accessible URL to a zip file containing the Openvpn configuration files
|
||||
- Publicly accessible URL to a structured (JSON etc.) list of servers **and attach** an example Openvpn configuration file for both TCP and UDP
|
||||
- Publicly accessible URL to the list of servers **and attach** an example Openvpn configuration file for both TCP and UDP
|
||||
|
||||
If the list of servers requires to login **or** is hidden behind an interactive configurator,
|
||||
you can only use a custom Openvpn configuration file.
|
||||
[The Wiki](https://github.com/qdm12/gluetun/wiki/Openvpn-file) describes how to do so.
|
||||
23
.github/labels.yml
vendored
23
.github/labels.yml
vendored
@@ -18,6 +18,18 @@
|
||||
- name: ":cloud: Cyberghost"
|
||||
color: "cfe8d4"
|
||||
description: ""
|
||||
- name: ":cloud: HideMyAss"
|
||||
color: "cfe8d4"
|
||||
description: ""
|
||||
- name: ":cloud: IPVanish"
|
||||
color: "cfe8d4"
|
||||
description: ""
|
||||
- name: ":cloud: IVPN"
|
||||
color: "cfe8d4"
|
||||
description: ""
|
||||
- name: ":cloud: FastestVPN"
|
||||
color: "cfe8d4"
|
||||
description: ""
|
||||
- name: ":cloud: Mullvad"
|
||||
color: "cfe8d4"
|
||||
description: ""
|
||||
@@ -30,12 +42,23 @@
|
||||
- name: ":cloud: Privado"
|
||||
color: "cfe8d4"
|
||||
description: ""
|
||||
- name: ":cloud: PrivateVPN"
|
||||
color: "cfe8d4"
|
||||
description: ""
|
||||
- name: ":cloud: ProtonVPN"
|
||||
color: "cfe8d4"
|
||||
- name: ":cloud: PureVPN"
|
||||
color: "cfe8d4"
|
||||
description: ""
|
||||
- name: ":cloud: Surfshark"
|
||||
color: "cfe8d4"
|
||||
description: ""
|
||||
- name: ":cloud: Torguard"
|
||||
color: "cfe8d4"
|
||||
description: ""
|
||||
- name: ":cloud: VPNUnlimited"
|
||||
color: "cfe8d4"
|
||||
description: ""
|
||||
- name: ":cloud: Vyprvpn"
|
||||
color: "cfe8d4"
|
||||
description: ""
|
||||
|
||||
@@ -2,7 +2,7 @@ name: CI
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- .github/workflows/build.yml
|
||||
- .github/workflows/ci.yml
|
||||
- cmd/**
|
||||
- internal/**
|
||||
- pkg/**
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
env:
|
||||
DOCKER_BUILDKIT: "1"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v2.3.4
|
||||
|
||||
- name: Linting
|
||||
run: docker build --target lint .
|
||||
@@ -34,24 +34,28 @@ jobs:
|
||||
touch coverage.txt
|
||||
docker run --rm \
|
||||
-v "$(pwd)/coverage.txt:/tmp/gobuild/coverage.txt" \
|
||||
test-container \
|
||||
go test \
|
||||
-race \
|
||||
-coverpkg=./... \
|
||||
-coverprofile=coverage.txt \
|
||||
-covermode=atomic \
|
||||
./...
|
||||
test-container
|
||||
|
||||
# We run this here to use the caching of the previous steps
|
||||
- if: github.event_name == 'push'
|
||||
name: Build final image
|
||||
run: docker build .
|
||||
- name: Code security analysis
|
||||
uses: snyk/actions/golang@master
|
||||
env:
|
||||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
|
||||
|
||||
- name: Build final image
|
||||
run: docker build -t final-image .
|
||||
|
||||
- name: Image security analysis
|
||||
uses: snyk/actions/docker@master
|
||||
env:
|
||||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
|
||||
with:
|
||||
image: final-image
|
||||
|
||||
publish:
|
||||
needs: [verify]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v2.3.4
|
||||
|
||||
- uses: docker/setup-qemu-action@v1
|
||||
- uses: docker/setup-buildx-action@v1
|
||||
@@ -69,32 +73,27 @@ jobs:
|
||||
BRANCH=${GITHUB_REF#refs/heads/}
|
||||
TAG=${GITHUB_REF#refs/tags/}
|
||||
echo ::set-output name=commit::$(git rev-parse --short HEAD)
|
||||
echo ::set-output name=build_date::$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
||||
echo ::set-output name=created::$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
||||
if [ "$TAG" != "$GITHUB_REF" ]; then
|
||||
echo ::set-output name=version::$TAG
|
||||
echo ::set-output name=platforms::linux/amd64,linux/386,linux/arm64,linux/arm/v6,linux/arm/v7,linux/s390x,linux/ppc64le
|
||||
echo ::set-output name=platforms::linux/amd64,linux/386,linux/arm64,linux/arm/v6,linux/arm/v7,linux/ppc64le
|
||||
elif [ "$BRANCH" = "master" ]; then
|
||||
echo ::set-output name=version::latest
|
||||
echo ::set-output name=platforms::linux/amd64,linux/386,linux/arm64,linux/arm/v6,linux/arm/v7,linux/s390x,linux/ppc64le
|
||||
echo ::set-output name=platforms::linux/amd64,linux/386,linux/arm64,linux/arm/v6,linux/arm/v7,linux/ppc64le
|
||||
else
|
||||
echo ::set-output name=version::$BRANCH
|
||||
echo ::set-output name=platforms::linux/amd64
|
||||
echo ::set-output name=platforms::linux/amd64,linux/386,linux/arm64,linux/arm/v6,linux/arm/v7,linux/ppc64le
|
||||
fi
|
||||
|
||||
- name: Build and push final image
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v2.6.1
|
||||
with:
|
||||
platforms: ${{ steps.vars.outputs.platforms }}
|
||||
build-args: |
|
||||
BUILD_DATE=${{ steps.vars.outputs.build_date }}
|
||||
CREATED=${{ steps.vars.outputs.created }}
|
||||
COMMIT=${{ steps.vars.outputs.commit }}
|
||||
VERSION=${{ steps.vars.outputs.version }}
|
||||
tags: |
|
||||
qmcgaw/gluetun:${{ steps.vars.outputs.version }}
|
||||
qmcgaw/private-internet-access:${{ steps.vars.outputs.version }}
|
||||
push: true
|
||||
|
||||
- if: github.event_name == 'push' && github.event.ref == 'refs/heads/master'
|
||||
name: Microbadger hook
|
||||
run: curl -X POST https://hooks.microbadger.com/images/qmcgaw/gluetun/l-keGI7p4IhX4QuIDMFYKhsZ1L0=
|
||||
continue-on-error: true
|
||||
2
.github/workflows/dockerhub-description.yml
vendored
2
.github/workflows/dockerhub-description.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v2.3.4
|
||||
- name: Docker Hub Description
|
||||
uses: peter-evans/dockerhub-description@v2
|
||||
with:
|
||||
|
||||
2
.github/workflows/labels.yml
vendored
2
.github/workflows/labels.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
||||
labeler:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v2.3.4
|
||||
- uses: crazy-max/ghaction-github-labeler@v3
|
||||
with:
|
||||
yaml-file: .github/labels.yml
|
||||
|
||||
2
.github/workflows/misspell.yml
vendored
2
.github/workflows/misspell.yml
vendored
@@ -8,7 +8,7 @@ jobs:
|
||||
misspell:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v2.3.4
|
||||
- uses: reviewdog/action-misspell@v1
|
||||
with:
|
||||
locale: "US"
|
||||
|
||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
scratch.txt
|
||||
@@ -10,10 +10,25 @@ issues:
|
||||
linters:
|
||||
- dupl
|
||||
- maligned
|
||||
- path: internal/unix/constants\.go
|
||||
- goerr113
|
||||
- path: internal/server/
|
||||
linters:
|
||||
- golint
|
||||
text: don't use ALL_CAPS in Go names; use CamelCase
|
||||
- dupl
|
||||
- path: internal/configuration/
|
||||
linters:
|
||||
- dupl
|
||||
- path: internal/constants/
|
||||
linters:
|
||||
- dupl
|
||||
- text: "exported: exported var Err*"
|
||||
linters:
|
||||
- revive
|
||||
- text: "mnd: Magic number: 0644*"
|
||||
linters:
|
||||
- gomnd
|
||||
- text: "mnd: Magic number: 0400*"
|
||||
linters:
|
||||
- gomnd
|
||||
linters:
|
||||
disable-all: true
|
||||
enable:
|
||||
@@ -33,29 +48,32 @@ linters:
|
||||
- gocritic
|
||||
- gocyclo
|
||||
- godot
|
||||
- goerr113
|
||||
- goheader
|
||||
- goimports
|
||||
- golint
|
||||
- gomnd
|
||||
- goprintffuncname
|
||||
- gosec
|
||||
- gosimple
|
||||
- govet
|
||||
- importas
|
||||
- ineffassign
|
||||
- interfacer
|
||||
- lll
|
||||
- maligned
|
||||
- misspell
|
||||
- nakedret
|
||||
- nestif
|
||||
- nilerr
|
||||
- noctx
|
||||
- nolintlint
|
||||
- prealloc
|
||||
- predeclared
|
||||
- revive
|
||||
- rowserrcheck
|
||||
- scopelint
|
||||
- sqlclosecheck
|
||||
- staticcheck
|
||||
- structcheck
|
||||
- thelper
|
||||
- tparallel
|
||||
- typecheck
|
||||
- unconvert
|
||||
- unparam
|
||||
|
||||
96
Dockerfile
96
Dockerfile
@@ -1,31 +1,36 @@
|
||||
ARG ALPINE_VERSION=3.12
|
||||
ARG GO_VERSION=1.15
|
||||
ARG ALPINE_VERSION=3.14
|
||||
ARG GO_ALPINE_VERSION=3.13
|
||||
ARG GO_VERSION=1.16
|
||||
ARG XCPUTRANSLATE_VERSION=v0.6.0
|
||||
ARG GOLANGCI_LINT_VERSION=v1.41.1
|
||||
ARG BUILDPLATFORM=linux/amd64
|
||||
|
||||
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS base
|
||||
RUN apk --update add git
|
||||
FROM --platform=${BUILDPLATFORM} qmcgaw/xcputranslate:${XCPUTRANSLATE_VERSION} AS xcputranslate
|
||||
FROM --platform=${BUILDPLATFORM} qmcgaw/binpot:golangci-lint-${GOLANGCI_LINT_VERSION} AS golangci-lint
|
||||
|
||||
FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION}-alpine${GO_ALPINE_VERSION} AS base
|
||||
COPY --from=xcputranslate /xcputranslate /usr/local/bin/xcputranslate
|
||||
RUN apk --update add git g++
|
||||
ENV CGO_ENABLED=0
|
||||
COPY --from=golangci-lint /bin /go/bin/golangci-lint
|
||||
WORKDIR /tmp/gobuild
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY cmd/ ./cmd/
|
||||
COPY internal/ ./internal/
|
||||
|
||||
FROM --platform=$BUILDPLATFORM base AS test
|
||||
FROM --platform=${BUILDPLATFORM} base AS test
|
||||
# Note on the go race detector:
|
||||
# - we set CGO_ENABLED=1 to have it enabled
|
||||
# - we install g++ to support the race detector
|
||||
# - we installed g++ to support the race detector
|
||||
ENV CGO_ENABLED=1
|
||||
RUN apk --update --no-cache add g++
|
||||
ENTRYPOINT go test -race -coverpkg=./... -coverprofile=coverage.txt -covermode=atomic ./...
|
||||
|
||||
FROM --platform=$BUILDPLATFORM base AS lint
|
||||
ARG GOLANGCI_LINT_VERSION=v1.35.2
|
||||
RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \
|
||||
sh -s -- -b /usr/local/bin ${GOLANGCI_LINT_VERSION}
|
||||
FROM --platform=${BUILDPLATFORM} base AS lint
|
||||
COPY .golangci.yml ./
|
||||
RUN golangci-lint run --timeout=10m
|
||||
|
||||
FROM --platform=$BUILDPLATFORM base AS tidy
|
||||
FROM --platform=${BUILDPLATFORM} base AS tidy
|
||||
RUN git init && \
|
||||
git config user.email ci@localhost && \
|
||||
git config user.name ci && \
|
||||
@@ -34,27 +39,26 @@ RUN git init && \
|
||||
go mod tidy && \
|
||||
git diff --exit-code -- go.mod
|
||||
|
||||
FROM --platform=$BUILDPLATFORM base AS build
|
||||
COPY --from=qmcgaw/xcputranslate:v0.4.0 /xcputranslate /usr/local/bin/xcputranslate
|
||||
FROM --platform=${BUILDPLATFORM} base AS build
|
||||
ARG TARGETPLATFORM
|
||||
ARG VERSION=unknown
|
||||
ARG BUILD_DATE="an unknown date"
|
||||
ARG CREATED="an unknown date"
|
||||
ARG COMMIT=unknown
|
||||
RUN GOARCH="$(xcputranslate -field arch -targetplatform ${TARGETPLATFORM})" \
|
||||
GOARM="$(xcputranslate -field arm -targetplatform ${TARGETPLATFORM})" \
|
||||
RUN GOARCH="$(xcputranslate translate -field arch -targetplatform ${TARGETPLATFORM})" \
|
||||
GOARM="$(xcputranslate translate -field arm -targetplatform ${TARGETPLATFORM})" \
|
||||
go build -trimpath -ldflags="-s -w \
|
||||
-X 'main.version=$VERSION' \
|
||||
-X 'main.buildDate=$BUILD_DATE' \
|
||||
-X 'main.created=$CREATED' \
|
||||
-X 'main.commit=$COMMIT' \
|
||||
" -o entrypoint cmd/gluetun/main.go
|
||||
|
||||
FROM alpine:${ALPINE_VERSION}
|
||||
ARG VERSION=unknown
|
||||
ARG BUILD_DATE="an unknown date"
|
||||
ARG CREATED="an unknown date"
|
||||
ARG COMMIT=unknown
|
||||
LABEL \
|
||||
org.opencontainers.image.authors="quentin.mcgaw@gmail.com" \
|
||||
org.opencontainers.image.created=$BUILD_DATE \
|
||||
org.opencontainers.image.created=$CREATED \
|
||||
org.opencontainers.image.version=$VERSION \
|
||||
org.opencontainers.image.revision=$COMMIT \
|
||||
org.opencontainers.image.url="https://github.com/qdm12/gluetun" \
|
||||
@@ -65,48 +69,55 @@ LABEL \
|
||||
ENV VPNSP=pia \
|
||||
VERSION_INFORMATION=on \
|
||||
PROTOCOL=udp \
|
||||
OPENVPN_VERSION=2.5 \
|
||||
OPENVPN_VERBOSITY=1 \
|
||||
OPENVPN_ROOT=no \
|
||||
OPENVPN_FLAGS= \
|
||||
OPENVPN_ROOT=yes \
|
||||
OPENVPN_TARGET_IP= \
|
||||
OPENVPN_IPV6=off \
|
||||
OPENVPN_CUSTOM_CONFIG= \
|
||||
TZ= \
|
||||
PUID= \
|
||||
PGID= \
|
||||
PUBLICIP_FILE="/tmp/gluetun/ip" \
|
||||
# PIA, Windscribe, Surfshark, Cyberghost, Vyprvpn, NordVPN, PureVPN only
|
||||
# VPN provider settings
|
||||
OPENVPN_USER= \
|
||||
OPENVPN_PASSWORD= \
|
||||
USER_SECRETFILE=/run/secrets/openvpn_user \
|
||||
PASSWORD_SECRETFILE=/run/secrets/openvpn_password \
|
||||
REGION= \
|
||||
# PIA only
|
||||
COUNTRY= \
|
||||
CITY= \
|
||||
PORT= \
|
||||
SERVER_HOSTNAME= \
|
||||
# Mullvad only:
|
||||
ISP= \
|
||||
OWNED=no \
|
||||
# Private Internet Access only:
|
||||
PIA_ENCRYPTION=strong \
|
||||
PORT_FORWARDING=off \
|
||||
PORT_FORWARDING_STATUS_FILE="/tmp/gluetun/forwarded_port" \
|
||||
# Mullvad and PureVPN only
|
||||
COUNTRY= \
|
||||
# Mullvad, PureVPN, Windscribe only
|
||||
CITY= \
|
||||
# Windscribe only
|
||||
SERVER_HOSTNAME= \
|
||||
# Mullvad only
|
||||
ISP= \
|
||||
OWNED=no \
|
||||
# Mullvad and Windscribe only
|
||||
PORT= \
|
||||
# Cyberghost only
|
||||
# Cyberghost only:
|
||||
CYBERGHOST_GROUP="Premium UDP Europe" \
|
||||
OPENVPN_CLIENTCRT_SECRETFILE=/run/secrets/openvpn_clientcrt \
|
||||
OPENVPN_CLIENTKEY_SECRETFILE=/run/secrets/openvpn_clientkey \
|
||||
# NordVPN only
|
||||
# Nordvpn only:
|
||||
SERVER_NUMBER= \
|
||||
# NordVPN and ProtonVPN only:
|
||||
SERVER_NAME= \
|
||||
# ProtonVPN only:
|
||||
FREE_ONLY= \
|
||||
# Openvpn
|
||||
OPENVPN_CIPHER= \
|
||||
OPENVPN_AUTH= \
|
||||
# Health
|
||||
HEALTH_OPENVPN_DURATION_INITIAL=6s \
|
||||
HEALTH_OPENVPN_DURATION_ADDITION=5s \
|
||||
HEALTH_SERVER_ADDRESS=127.0.0.1:9999 \
|
||||
# DNS over TLS
|
||||
DOT=on \
|
||||
DOT_PROVIDERS=cloudflare \
|
||||
DOT_PRIVATE_ADDRESS=127.0.0.1/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,169.254.0.0/16,::1/128,fc00::/7,fe80::/10,::ffff:0:0/96 \
|
||||
DOT_PRIVATE_ADDRESS=127.0.0.1/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,169.254.0.0/16,::1/128,fc00::/7,fe80::/10,::ffff:7f00:1/104,::ffff:a00:0/104,::ffff:a9fe:0/112,::ffff:ac10:0/108,::ffff:c0a8:0/112 \
|
||||
DOT_VERBOSITY=1 \
|
||||
DOT_VERBOSITY_DETAILS=0 \
|
||||
DOT_VALIDATION_LOGLEVEL=0 \
|
||||
@@ -144,11 +155,14 @@ ENV VPNSP=pia \
|
||||
ENTRYPOINT ["/entrypoint"]
|
||||
EXPOSE 8000/tcp 8888/tcp 8388/tcp 8388/udp
|
||||
HEALTHCHECK --interval=5s --timeout=5s --start-period=10s --retries=1 CMD /entrypoint healthcheck
|
||||
RUN apk add -q --progress --no-cache --update openvpn ca-certificates iptables ip6tables unbound tzdata && \
|
||||
rm -rf /var/cache/apk/* /etc/unbound/* /usr/sbin/unbound-* && \
|
||||
ARG TARGETPLATFORM
|
||||
RUN apk add --no-cache --update -l apk-tools && \
|
||||
apk add --no-cache --update -X "https://dl-cdn.alpinelinux.org/alpine/v3.12/main" openvpn==2.4.11-r0 && \
|
||||
mv /usr/sbin/openvpn /usr/sbin/openvpn2.4 && \
|
||||
apk del openvpn && \
|
||||
apk add --no-cache --update openvpn ca-certificates iptables ip6tables unbound tzdata && \
|
||||
rm -rf /var/cache/apk/* /etc/unbound/* /usr/sbin/unbound-* /etc/openvpn/*.sh /usr/lib/openvpn/plugins/openvpn-plugin-down-root.so && \
|
||||
deluser openvpn && \
|
||||
deluser unbound && \
|
||||
mkdir /gluetun
|
||||
# TODO remove once SAN is added to PIA servers certificates, see https://github.com/pia-foss/manual-connections/issues/10
|
||||
ENV GODEBUG=x509ignoreCN=0
|
||||
COPY --from=build /tmp/gobuild/entrypoint /entrypoint
|
||||
|
||||
86
README.md
86
README.md
@@ -1,26 +1,42 @@
|
||||
# Gluetun VPN client
|
||||
|
||||
*Lightweight swiss-knife-like VPN client to tunnel to Private Internet Access,
|
||||
Mullvad, Windscribe, Surfshark Cyberghost, VyprVPN, NordVPN, PureVPN and Privado VPN servers, using Go, OpenVPN, iptables, DNS over TLS, ShadowSocks and an HTTP proxy*
|
||||
*Lightweight swiss-knife-like VPN client to tunnel to Cyberghost, FastestVPN,
|
||||
HideMyAss, IPVanish, IVPN, Mullvad, NordVPN, Privado, Private Internet Access, PrivateVPN,
|
||||
ProtonVPN, PureVPN, Surfshark, TorGuard, VPNUnlimited, VyprVPN and Windscribe VPN servers
|
||||
using Go, OpenVPN, iptables, DNS over TLS, ShadowSocks and an HTTP proxy*
|
||||
|
||||
**ANNOUNCEMENT**: *New Docker image name `qmcgaw/gluetun`*
|
||||
**ANNOUNCEMENT**:
|
||||
|
||||
<img height="250" src="https://raw.githubusercontent.com/qdm12/gluetun/master/title.svg?sanitize=true">
|
||||

|
||||
|
||||
[](https://hub.docker.com/r/qmcgaw/gluetun/tags?page=1&ordering=last_updated)
|
||||
[](https://hub.docker.com/r/qmcgaw/gluetun/tags)
|
||||
[](https://github.com/qdm12/gluetun/actions/workflows/ci.yml)
|
||||
|
||||
[](https://hub.docker.com/r/qmcgaw/private-internet-access)
|
||||
[](https://hub.docker.com/r/qmcgaw/gluetun)
|
||||
[](https://hub.docker.com/r/qmcgaw/gluetun)
|
||||
[](https://hub.docker.com/r/qmcgaw/gluetun)
|
||||
|
||||
[](https://hub.docker.com/r/qmcgaw/gluetun)
|
||||
[](https://hub.docker.com/r/qmcgaw/gluetun)
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
[](https://hub.docker.com/r/qmcgaw/gluetun/tags?page=1&ordering=last_updated)
|
||||

|
||||

|
||||
[](https://github.com/qdm12/gluetun/commits)
|
||||
|
||||
[](https://hub.docker.com/r/qmcgaw/gluetun/tags)
|
||||
|
||||
[](https://github.com/qdm12/gluetun/commits/master)
|
||||
[](https://github.com/qdm12/gluetun/graphs/contributors)
|
||||
[](https://github.com/qdm12/gluetun/pulls?q=is%3Apr+is%3Aclosed)
|
||||
[](https://github.com/qdm12/gluetun/issues)
|
||||
[](https://github.com/qdm12/gluetun/issues?q=is%3Aissue+is%3Aclosed)
|
||||
|
||||
[](https://github.com/qdm12/gluetun)
|
||||

|
||||

|
||||

|
||||
|
||||

|
||||
|
||||
## Quick links
|
||||
|
||||
@@ -33,11 +49,14 @@ Mullvad, Windscribe, Surfshark Cyberghost, VyprVPN, NordVPN, PureVPN and Privado
|
||||
- Sponsor me on [github.com/sponsors/qdm12](https://github.com/sponsors/qdm12)
|
||||
- Donate to [paypal.me/qmcgaw](https://www.paypal.me/qmcgaw)
|
||||
- Drop me [an email](mailto:quentin.mcgaw@gmail.com)
|
||||
- Video:
|
||||
|
||||
[](https://youtu.be/0F6I03LQcI4)
|
||||
|
||||
## Features
|
||||
|
||||
- Based on Alpine 3.12 for a small Docker image of 52MB
|
||||
- Supports **Private Internet Access**, **Mullvad**, **Windscribe**, **Surfshark**, **Cyberghost**, **Vyprvpn**, **NordVPN**, **PureVPN** and **Privado** servers
|
||||
- Based on Alpine 3.13 for a small Docker image of 54MB
|
||||
- Supports: **Cyberghost**, **FastestVPN**, **HideMyAss**, **IPVanish**, **IVPN**, **Mullvad**, **NordVPN**, **Privado**, **Private Internet Access**, **PrivateVPN**, **ProtonVPN**, **PureVPN**, **Surfshark**, **TorGuard**, **VPNUnlimited**, **Vyprvpn**, **Windscribe** servers
|
||||
- Supports Openvpn only for now
|
||||
- DNS over TLS baked in with service provider(s) of your choice
|
||||
- DNS fine blocking of malicious/ads/surveillance hostnames and IP addresses, with live update every 24 hours
|
||||
@@ -47,7 +66,7 @@ Mullvad, Windscribe, Surfshark Cyberghost, VyprVPN, NordVPN, PureVPN and Privado
|
||||
- Built in HTTP proxy (tunnels HTTP and HTTPS through TCP)
|
||||
- [Connect other containers to it](https://github.com/qdm12/gluetun/wiki/Connect-to-gluetun)
|
||||
- [Connect LAN devices to it](https://github.com/qdm12/gluetun/wiki/Connect-to-gluetun)
|
||||
- Compatible with amd64, i686 (32 bit), **ARM** 64 bit, ARM 32 bit v6 and v7, and even s390x as well as ppc64le 🎆
|
||||
- Compatible with amd64, i686 (32 bit), **ARM** 64 bit, ARM 32 bit v6 and v7, and even ppc64le 🎆
|
||||
- VPN server side port forwarding for Private Internet Access and Vyprvpn
|
||||
- Possibility of split horizon DNS by selecting multiple DNS over TLS providers
|
||||
- Subprograms all drop root privileges once launched
|
||||
@@ -56,8 +75,17 @@ Mullvad, Windscribe, Surfshark Cyberghost, VyprVPN, NordVPN, PureVPN and Privado
|
||||
|
||||
## Setup
|
||||
|
||||
1. On some devices you may need to setup your tunnel kernel module on your host with `insmod /lib/modules/tun.ko` or `modprobe tun`
|
||||
- [Synology users Wiki page](https://github.com/qdm12/gluetun/wiki/Synology-setup)
|
||||
1. Ensure your `tun` kernel module is setup:
|
||||
|
||||
```sh
|
||||
sudo modprobe tun
|
||||
# or, if you don't have modprobe, with
|
||||
sudo insmod /lib/modules/tun.ko
|
||||
```
|
||||
|
||||
1. Extra steps:
|
||||
- [For Synology users](https://github.com/qdm12/gluetun/wiki/Synology-setup)
|
||||
- [For 32 bit Operating systems (**Rasberry Pis**)](https://github.com/qdm12/gluetun/wiki/32-bit-setup)
|
||||
1. Launch the container with:
|
||||
|
||||
```bash
|
||||
@@ -71,8 +99,6 @@ Mullvad, Windscribe, Surfshark Cyberghost, VyprVPN, NordVPN, PureVPN and Privado
|
||||
or use [docker-compose.yml](https://github.com/qdm12/gluetun/blob/master/docker-compose.yml) with:
|
||||
|
||||
```bash
|
||||
echo "your openvpn username" > openvpn_user
|
||||
echo "your openvpn password" > openvpn_password
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
@@ -82,35 +108,13 @@ Mullvad, Windscribe, Surfshark Cyberghost, VyprVPN, NordVPN, PureVPN and Privado
|
||||
|
||||
The following points are all optional but should give you insights on all the possibilities with this container.
|
||||
|
||||
- Use [Docker secrets](https://github.com/qdm12/gluetun/wiki/Docker-secrets) to read your credentials instead of environment variables
|
||||
- [Test your setup](https://github.com/qdm12/gluetun/wiki/Test-your-setup)
|
||||
- [How to connect other containers and devices to Gluetun](https://github.com/qdm12/gluetun/wiki/Connect-to-gluetun)
|
||||
- [VPN server side port forwarding](https://github.com/qdm12/gluetun/wiki/Port-forwarding)
|
||||
- [HTTP control server](https://github.com/qdm12/gluetun/wiki/HTTP-Control-server) to automate things, restart Openvpn etc.
|
||||
- Update the image with `docker pull qmcgaw/gluetun:latest`. See this [Wiki document](https://github.com/qdm12/gluetun/wiki/Docker-image-tags) for Docker tags available.
|
||||
- Use [Docker secrets](https://github.com/qdm12/gluetun/wiki/Docker-secrets) to read your credentials instead of environment variables
|
||||
|
||||
## License
|
||||
|
||||
[](https://github.com/qdm12/gluetun/master/LICENSE)
|
||||
|
||||
## Metadata
|
||||
|
||||
[](https://github.com/qdm12/gluetun/commits)
|
||||
[](https://github.com/qdm12/gluetun/pulls?q=is%3Apr+is%3Aclosed)
|
||||
|
||||
[](https://github.com/qdm12/gluetun/issues)
|
||||
[](https://github.com/qdm12/gluetun/issues?q=is%3Aissue+is%3Aclosed)
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
[](https://hub.docker.com/r/qmcgaw/gluetun)
|
||||
|
||||

|
||||

|
||||
|
||||
@@ -2,96 +2,96 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
nativeos "os"
|
||||
"os"
|
||||
"os/signal"
|
||||
"sync"
|
||||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/qdm12/dns/pkg/unbound"
|
||||
"github.com/qdm12/gluetun/internal/alpine"
|
||||
"github.com/qdm12/gluetun/internal/cli"
|
||||
"github.com/qdm12/gluetun/internal/configuration"
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
"github.com/qdm12/gluetun/internal/dns"
|
||||
"github.com/qdm12/gluetun/internal/firewall"
|
||||
"github.com/qdm12/gluetun/internal/healthcheck"
|
||||
"github.com/qdm12/gluetun/internal/httpproxy"
|
||||
gluetunLogging "github.com/qdm12/gluetun/internal/logging"
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
"github.com/qdm12/gluetun/internal/openvpn"
|
||||
"github.com/qdm12/gluetun/internal/params"
|
||||
"github.com/qdm12/gluetun/internal/publicip"
|
||||
"github.com/qdm12/gluetun/internal/routing"
|
||||
"github.com/qdm12/gluetun/internal/server"
|
||||
"github.com/qdm12/gluetun/internal/settings"
|
||||
"github.com/qdm12/gluetun/internal/shadowsocks"
|
||||
"github.com/qdm12/gluetun/internal/storage"
|
||||
"github.com/qdm12/gluetun/internal/unix"
|
||||
"github.com/qdm12/gluetun/internal/updater"
|
||||
versionpkg "github.com/qdm12/gluetun/internal/version"
|
||||
"github.com/qdm12/golibs/command"
|
||||
"github.com/qdm12/golibs/logging"
|
||||
"github.com/qdm12/golibs/os"
|
||||
"github.com/qdm12/golibs/os/user"
|
||||
"github.com/qdm12/golibs/params"
|
||||
"github.com/qdm12/goshutdown"
|
||||
"github.com/qdm12/gosplash"
|
||||
"github.com/qdm12/updated/pkg/dnscrypto"
|
||||
)
|
||||
|
||||
//nolint:gochecknoglobals
|
||||
var (
|
||||
version = "unknown"
|
||||
commit = "unknown"
|
||||
buildDate = "an unknown date"
|
||||
version = "unknown"
|
||||
commit = "unknown"
|
||||
created = "an unknown date"
|
||||
)
|
||||
|
||||
var (
|
||||
errSetupRouting = errors.New("cannot setup routing")
|
||||
errCreateUser = errors.New("cannot create user")
|
||||
)
|
||||
|
||||
func main() {
|
||||
buildInfo := models.BuildInformation{
|
||||
Version: version,
|
||||
Commit: commit,
|
||||
BuildDate: buildDate,
|
||||
Version: version,
|
||||
Commit: commit,
|
||||
Created: created,
|
||||
}
|
||||
|
||||
ctx := context.Background()
|
||||
ctx, stop := signal.NotifyContext(ctx, syscall.SIGINT, syscall.SIGTERM, os.Interrupt)
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
|
||||
logger, err := logging.NewLogger(logging.ConsoleEncoding, logging.InfoLevel)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
nativeos.Exit(1)
|
||||
}
|
||||
logger := logging.NewParent(logging.Settings{
|
||||
Level: logging.LevelInfo,
|
||||
})
|
||||
|
||||
args := nativeos.Args
|
||||
os := os.New()
|
||||
osUser := user.New()
|
||||
args := os.Args
|
||||
unix := unix.New()
|
||||
cli := cli.New()
|
||||
env := params.NewEnv()
|
||||
cmder := command.NewCmder()
|
||||
|
||||
errorCh := make(chan error)
|
||||
go func() {
|
||||
errorCh <- _main(ctx, buildInfo, args, logger, os, osUser, unix, cli)
|
||||
errorCh <- _main(ctx, buildInfo, args, logger, env, unix, cmder, cli)
|
||||
}()
|
||||
|
||||
signalsCh := make(chan nativeos.Signal, 1)
|
||||
signal.Notify(signalsCh,
|
||||
syscall.SIGINT,
|
||||
syscall.SIGTERM,
|
||||
nativeos.Interrupt,
|
||||
)
|
||||
|
||||
select {
|
||||
case signal := <-signalsCh:
|
||||
logger.Warn("Caught OS signal %s, shutting down", signal)
|
||||
case <-ctx.Done():
|
||||
stop()
|
||||
logger.Warn("Caught OS signal, shutting down")
|
||||
case err := <-errorCh:
|
||||
stop()
|
||||
close(errorCh)
|
||||
if err == nil { // expected exit such as healthcheck
|
||||
nativeos.Exit(0)
|
||||
os.Exit(0)
|
||||
}
|
||||
logger.Error(err)
|
||||
logger.Error(err.Error())
|
||||
cancel()
|
||||
}
|
||||
|
||||
cancel()
|
||||
|
||||
const shutdownGracePeriod = 5 * time.Second
|
||||
timer := time.NewTimer(shutdownGracePeriod)
|
||||
select {
|
||||
@@ -104,55 +104,81 @@ func main() {
|
||||
logger.Warn("Shutdown timed out")
|
||||
}
|
||||
|
||||
nativeos.Exit(1)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
var (
|
||||
errCommandUnknown = errors.New("command is unknown")
|
||||
)
|
||||
|
||||
//nolint:gocognit,gocyclo
|
||||
func _main(ctx context.Context, buildInfo models.BuildInformation,
|
||||
args []string, logger logging.Logger, os os.OS, osUser user.OSUser, unix unix.Unix,
|
||||
cli cli.CLI) error {
|
||||
args []string, logger logging.ParentLogger, env params.Env,
|
||||
unix unix.Unix, cmder command.RunStarter, cli cli.CLIer) error {
|
||||
if len(args) > 1 { // cli operation
|
||||
switch args[1] {
|
||||
case "healthcheck":
|
||||
return cli.HealthCheck(ctx)
|
||||
return cli.HealthCheck(ctx, env, logger)
|
||||
case "clientkey":
|
||||
return cli.ClientKey(args[2:], os.OpenFile)
|
||||
return cli.ClientKey(args[2:])
|
||||
case "openvpnconfig":
|
||||
return cli.OpenvpnConfig(os)
|
||||
return cli.OpenvpnConfig(logger)
|
||||
case "update":
|
||||
return cli.Update(ctx, args[2:], os)
|
||||
return cli.Update(ctx, args[2:], logger)
|
||||
default:
|
||||
return fmt.Errorf("command %q is unknown", args[1])
|
||||
return fmt.Errorf("%w: %s", errCommandUnknown, args[1])
|
||||
}
|
||||
}
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
|
||||
const clientTimeout = 15 * time.Second
|
||||
httpClient := &http.Client{Timeout: clientTimeout}
|
||||
// Create configurators
|
||||
alpineConf := alpine.NewConfigurator(os.OpenFile, osUser)
|
||||
ovpnConf := openvpn.NewConfigurator(logger, os, unix)
|
||||
alpineConf := alpine.New()
|
||||
ovpnConf := openvpn.NewConfigurator(
|
||||
logger.NewChild(logging.Settings{Prefix: "openvpn configurator: "}),
|
||||
unix, cmder)
|
||||
dnsCrypto := dnscrypto.New(httpClient, "", "")
|
||||
const cacertsPath = "/etc/ssl/certs/ca-certificates.crt"
|
||||
dnsConf := unbound.NewConfigurator(logger, os.OpenFile, dnsCrypto,
|
||||
dnsConf := unbound.NewConfigurator(nil, cmder, dnsCrypto,
|
||||
"/etc/unbound", "/usr/sbin/unbound", cacertsPath)
|
||||
routingConf := routing.NewRouting(logger)
|
||||
firewallConf := firewall.NewConfigurator(logger, routingConf, os.OpenFile)
|
||||
|
||||
paramsReader := params.NewReader(logger, os)
|
||||
fmt.Println(gluetunLogging.Splash(buildInfo))
|
||||
|
||||
printVersions(ctx, logger, map[string]func(ctx context.Context) (string, error){
|
||||
"OpenVPN": ovpnConf.Version,
|
||||
"Unbound": dnsConf.Version,
|
||||
"IPtables": firewallConf.Version,
|
||||
})
|
||||
|
||||
allSettings, warnings, err := settings.GetAllSettings(paramsReader)
|
||||
for _, warning := range warnings {
|
||||
logger.Warn(warning)
|
||||
announcementExp, err := time.Parse(time.RFC3339, "2021-07-22T00:00:00Z")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
splashSettings := gosplash.Settings{
|
||||
User: "qdm12",
|
||||
Repository: "gluetun",
|
||||
Emails: []string{"quentin.mcgaw@gmail.com"},
|
||||
Version: buildInfo.Version,
|
||||
Commit: buildInfo.Commit,
|
||||
BuildDate: buildInfo.Created,
|
||||
Announcement: "",
|
||||
AnnounceExp: announcementExp,
|
||||
// Sponsor information
|
||||
PaypalUser: "qmcgaw",
|
||||
GithubSponsor: "qdm12",
|
||||
}
|
||||
for _, line := range gosplash.MakeLines(splashSettings) {
|
||||
fmt.Println(line)
|
||||
}
|
||||
|
||||
err = printVersions(ctx, logger, []printVersionElement{
|
||||
{name: "Alpine", getVersion: alpineConf.Version},
|
||||
{name: "OpenVPN 2.4", getVersion: ovpnConf.Version24},
|
||||
{name: "OpenVPN 2.5", getVersion: ovpnConf.Version25},
|
||||
{name: "Unbound", getVersion: dnsConf.Version},
|
||||
{name: "IPtables", getVersion: func(ctx context.Context) (version string, err error) {
|
||||
return firewall.Version(ctx, cmder)
|
||||
}},
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var allSettings configuration.Settings
|
||||
err = allSettings.Read(env,
|
||||
logger.NewChild(logging.Settings{Prefix: "configuration: "}))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -166,7 +192,9 @@ func _main(ctx context.Context, buildInfo models.BuildInformation,
|
||||
}
|
||||
|
||||
// TODO run this in a loop or in openvpn to reload from file without restarting
|
||||
storage := storage.New(logger, os, constants.ServersData)
|
||||
storage := storage.New(
|
||||
logger.NewChild(logging.Settings{Prefix: "storage: "}),
|
||||
constants.ServersData)
|
||||
allServers, err := storage.SyncServers(constants.GetAllServers())
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -178,27 +206,35 @@ func _main(ctx context.Context, buildInfo models.BuildInformation,
|
||||
const defaultUsername = "nonrootuser"
|
||||
nonRootUsername, err := alpineConf.CreateUser(defaultUsername, puid)
|
||||
if err != nil {
|
||||
return err
|
||||
return fmt.Errorf("%w: %s", errCreateUser, err)
|
||||
}
|
||||
if nonRootUsername != defaultUsername {
|
||||
logger.Info("using existing username %s corresponding to user id %d", nonRootUsername, puid)
|
||||
logger.Info("using existing username " + nonRootUsername + " corresponding to user id " + fmt.Sprint(puid))
|
||||
}
|
||||
// set it for Unbound
|
||||
// TODO remove this when migrating to qdm12/dns v2
|
||||
allSettings.DNS.Unbound.Username = nonRootUsername
|
||||
|
||||
if err := os.Chown("/etc/unbound", puid, pgid); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
firewallLogLevel := logging.LevelInfo
|
||||
if allSettings.Firewall.Debug {
|
||||
firewallConf.SetDebug()
|
||||
routingConf.SetDebug()
|
||||
firewallLogLevel = logging.LevelDebug
|
||||
}
|
||||
routingLogger := logger.NewChild(logging.Settings{
|
||||
Prefix: "routing: ",
|
||||
Level: firewallLogLevel,
|
||||
})
|
||||
routingConf := routing.NewRouting(routingLogger)
|
||||
|
||||
defaultInterface, defaultGateway, err := routingConf.DefaultRoute()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
localSubnet, err := routingConf.LocalSubnet()
|
||||
localNetworks, err := routingConf.LocalNetworks()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -208,15 +244,23 @@ func _main(ctx context.Context, buildInfo models.BuildInformation,
|
||||
return err
|
||||
}
|
||||
|
||||
firewallConf.SetNetworkInformation(defaultInterface, defaultGateway, localSubnet, defaultIP)
|
||||
firewallLogger := logger.NewChild(logging.Settings{
|
||||
Prefix: "firewall: ",
|
||||
Level: firewallLogLevel,
|
||||
})
|
||||
firewallConf := firewall.NewConfig(firewallLogger, cmder,
|
||||
defaultInterface, defaultGateway, localNetworks, defaultIP)
|
||||
|
||||
if err := routingConf.Setup(); err != nil {
|
||||
return err
|
||||
if strings.Contains(err.Error(), "operation not permitted") {
|
||||
logger.Warn("💡 Tip: Are you passing NET_ADMIN capability to gluetun?")
|
||||
}
|
||||
return fmt.Errorf("%w: %s", errSetupRouting, err)
|
||||
}
|
||||
defer func() {
|
||||
routingConf.SetVerbose(false)
|
||||
logger.Info("routing cleanup...")
|
||||
if err := routingConf.TearDown(); err != nil {
|
||||
logger.Error(err)
|
||||
logger.Error("cannot teardown routing: " + err.Error())
|
||||
}
|
||||
}()
|
||||
|
||||
@@ -228,7 +272,7 @@ func _main(ctx context.Context, buildInfo models.BuildInformation,
|
||||
}
|
||||
|
||||
if err := ovpnConf.CheckTUN(); err != nil {
|
||||
logger.Warn(err)
|
||||
logger.Warn(err.Error())
|
||||
err = ovpnConf.CreateTUN()
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -259,151 +303,213 @@ func _main(ctx context.Context, buildInfo models.BuildInformation,
|
||||
}
|
||||
} // TODO move inside firewall?
|
||||
|
||||
wg := &sync.WaitGroup{}
|
||||
// Shutdown settings
|
||||
const defaultShutdownTimeout = 400 * time.Millisecond
|
||||
defaultShutdownOnSuccess := func(goRoutineName string) {
|
||||
logger.Info(goRoutineName + ": terminated ✔️")
|
||||
}
|
||||
defaultShutdownOnFailure := func(goRoutineName string, err error) {
|
||||
logger.Warn(goRoutineName + ": " + err.Error() + " ⚠️")
|
||||
}
|
||||
defaultGoRoutineSettings := goshutdown.GoRoutineSettings{Timeout: defaultShutdownTimeout}
|
||||
defaultGroupSettings := goshutdown.GroupSettings{
|
||||
Timeout: defaultShutdownTimeout,
|
||||
OnSuccess: defaultShutdownOnSuccess,
|
||||
}
|
||||
|
||||
openvpnLooper := openvpn.NewLooper(allSettings.OpenVPN, nonRootUsername, puid, pgid, allServers,
|
||||
ovpnConf, firewallConf, routingConf, logger, httpClient, os.OpenFile, tunnelReadyCh, cancel)
|
||||
wg.Add(1)
|
||||
controlGroupHandler := goshutdown.NewGroupHandler("control", defaultGroupSettings)
|
||||
tickersGroupHandler := goshutdown.NewGroupHandler("tickers", defaultGroupSettings)
|
||||
otherGroupHandler := goshutdown.NewGroupHandler("other", defaultGroupSettings)
|
||||
|
||||
openvpnLooper := openvpn.NewLoop(allSettings.OpenVPN, nonRootUsername, puid, pgid, allServers,
|
||||
ovpnConf, firewallConf, logger, httpClient, tunnelReadyCh)
|
||||
openvpnHandler, openvpnCtx, openvpnDone := goshutdown.NewGoRoutineHandler(
|
||||
"openvpn", goshutdown.GoRoutineSettings{Timeout: time.Second})
|
||||
// wait for restartOpenvpn
|
||||
go openvpnLooper.Run(ctx, wg)
|
||||
go openvpnLooper.Run(openvpnCtx, openvpnDone)
|
||||
|
||||
updaterLooper := updater.NewLooper(allSettings.Updater,
|
||||
allServers, storage, openvpnLooper.SetServers, httpClient, logger)
|
||||
wg.Add(1)
|
||||
allServers, storage, openvpnLooper.SetServers, httpClient,
|
||||
logger.NewChild(logging.Settings{Prefix: "updater: "}))
|
||||
updaterHandler, updaterCtx, updaterDone := goshutdown.NewGoRoutineHandler(
|
||||
"updater", defaultGoRoutineSettings)
|
||||
// wait for updaterLooper.Restart() or its ticket launched with RunRestartTicker
|
||||
go updaterLooper.Run(ctx, wg)
|
||||
go updaterLooper.Run(updaterCtx, updaterDone)
|
||||
tickersGroupHandler.Add(updaterHandler)
|
||||
|
||||
unboundLooper := dns.NewLooper(dnsConf, allSettings.DNS, httpClient,
|
||||
logger, nonRootUsername, puid, pgid)
|
||||
wg.Add(1)
|
||||
unboundLogger := logger.NewChild(logging.Settings{Prefix: "dns over tls: "})
|
||||
unboundLooper := dns.NewLoop(dnsConf, allSettings.DNS, httpClient,
|
||||
unboundLogger)
|
||||
dnsHandler, dnsCtx, dnsDone := goshutdown.NewGoRoutineHandler(
|
||||
"unbound", defaultGoRoutineSettings)
|
||||
// wait for unboundLooper.Restart or its ticker launched with RunRestartTicker
|
||||
go unboundLooper.Run(ctx, wg)
|
||||
go unboundLooper.Run(dnsCtx, dnsDone)
|
||||
otherGroupHandler.Add(dnsHandler)
|
||||
|
||||
publicIPLooper := publicip.NewLooper(
|
||||
httpClient, logger, allSettings.PublicIP, puid, pgid, os)
|
||||
wg.Add(1)
|
||||
go publicIPLooper.Run(ctx, wg)
|
||||
wg.Add(1)
|
||||
go publicIPLooper.RunRestartTicker(ctx, wg)
|
||||
publicIPLooper := publicip.NewLoop(httpClient,
|
||||
logger.NewChild(logging.Settings{Prefix: "ip getter: "}),
|
||||
allSettings.PublicIP, puid, pgid)
|
||||
pubIPHandler, pubIPCtx, pubIPDone := goshutdown.NewGoRoutineHandler(
|
||||
"public IP", defaultGoRoutineSettings)
|
||||
go publicIPLooper.Run(pubIPCtx, pubIPDone)
|
||||
otherGroupHandler.Add(pubIPHandler)
|
||||
|
||||
httpProxyLooper := httpproxy.NewLooper(logger, allSettings.HTTPProxy)
|
||||
wg.Add(1)
|
||||
go httpProxyLooper.Run(ctx, wg)
|
||||
pubIPTickerHandler, pubIPTickerCtx, pubIPTickerDone := goshutdown.NewGoRoutineHandler(
|
||||
"public IP", defaultGoRoutineSettings)
|
||||
go publicIPLooper.RunRestartTicker(pubIPTickerCtx, pubIPTickerDone)
|
||||
tickersGroupHandler.Add(pubIPTickerHandler)
|
||||
|
||||
shadowsocksLooper := shadowsocks.NewLooper(allSettings.ShadowSocks, logger)
|
||||
wg.Add(1)
|
||||
go shadowsocksLooper.Run(ctx, wg)
|
||||
httpProxyLooper := httpproxy.NewLoop(
|
||||
logger.NewChild(logging.Settings{Prefix: "http proxy: "}),
|
||||
allSettings.HTTPProxy)
|
||||
httpProxyHandler, httpProxyCtx, httpProxyDone := goshutdown.NewGoRoutineHandler(
|
||||
"http proxy", defaultGoRoutineSettings)
|
||||
go httpProxyLooper.Run(httpProxyCtx, httpProxyDone)
|
||||
otherGroupHandler.Add(httpProxyHandler)
|
||||
|
||||
wg.Add(1)
|
||||
go routeReadyEvents(ctx, wg, buildInfo, tunnelReadyCh,
|
||||
shadowsocksLooper := shadowsocks.NewLooper(allSettings.ShadowSocks,
|
||||
logger.NewChild(logging.Settings{Prefix: "shadowsocks: "}))
|
||||
shadowsocksHandler, shadowsocksCtx, shadowsocksDone := goshutdown.NewGoRoutineHandler(
|
||||
"shadowsocks proxy", defaultGoRoutineSettings)
|
||||
go shadowsocksLooper.Run(shadowsocksCtx, shadowsocksDone)
|
||||
otherGroupHandler.Add(shadowsocksHandler)
|
||||
|
||||
eventsRoutingHandler, eventsRoutingCtx, eventsRoutingDone := goshutdown.NewGoRoutineHandler(
|
||||
"events routing", defaultGoRoutineSettings)
|
||||
go routeReadyEvents(eventsRoutingCtx, eventsRoutingDone, buildInfo, tunnelReadyCh,
|
||||
unboundLooper, updaterLooper, publicIPLooper, routingConf, logger, httpClient,
|
||||
allSettings.VersionInformation, allSettings.OpenVPN.Provider.PortForwarding.Enabled, openvpnLooper.PortForward,
|
||||
)
|
||||
controlServerAddress := fmt.Sprintf("0.0.0.0:%d", allSettings.ControlServer.Port)
|
||||
controlServerLogging := allSettings.ControlServer.Log
|
||||
httpServer := server.New(controlServerAddress, controlServerLogging,
|
||||
logger, buildInfo, openvpnLooper, unboundLooper, updaterLooper, publicIPLooper)
|
||||
wg.Add(1)
|
||||
go httpServer.Run(ctx, wg)
|
||||
controlGroupHandler.Add(eventsRoutingHandler)
|
||||
|
||||
healthcheckServer := healthcheck.NewServer(
|
||||
constants.HealthcheckAddress, logger)
|
||||
wg.Add(1)
|
||||
go healthcheckServer.Run(ctx, wg)
|
||||
controlServerAddress := ":" + strconv.Itoa(int(allSettings.ControlServer.Port))
|
||||
controlServerLogging := allSettings.ControlServer.Log
|
||||
httpServerHandler, httpServerCtx, httpServerDone := goshutdown.NewGoRoutineHandler(
|
||||
"http server", defaultGoRoutineSettings)
|
||||
httpServer := server.New(httpServerCtx, controlServerAddress, controlServerLogging,
|
||||
logger.NewChild(logging.Settings{Prefix: "http server: "}),
|
||||
buildInfo, openvpnLooper, unboundLooper, updaterLooper, publicIPLooper)
|
||||
go httpServer.Run(httpServerCtx, httpServerDone)
|
||||
controlGroupHandler.Add(httpServerHandler)
|
||||
|
||||
healthLogger := logger.NewChild(logging.Settings{Prefix: "healthcheck: "})
|
||||
healthcheckServer := healthcheck.NewServer(allSettings.Health, healthLogger, openvpnLooper)
|
||||
healthServerHandler, healthServerCtx, healthServerDone := goshutdown.NewGoRoutineHandler(
|
||||
"HTTP health server", defaultGoRoutineSettings)
|
||||
go healthcheckServer.Run(healthServerCtx, healthServerDone)
|
||||
|
||||
const orderShutdownTimeout = 3 * time.Second
|
||||
orderSettings := goshutdown.OrderSettings{
|
||||
Timeout: orderShutdownTimeout,
|
||||
OnFailure: defaultShutdownOnFailure,
|
||||
OnSuccess: defaultShutdownOnSuccess,
|
||||
}
|
||||
orderHandler := goshutdown.NewOrder("gluetun", orderSettings)
|
||||
orderHandler.Append(controlGroupHandler, tickersGroupHandler, healthServerHandler,
|
||||
openvpnHandler, otherGroupHandler)
|
||||
|
||||
// Start openvpn for the first time in a blocking call
|
||||
// until openvpn is launched
|
||||
_, _ = openvpnLooper.SetStatus(constants.Running) // TODO option to disable with variable
|
||||
_, _ = openvpnLooper.ApplyStatus(ctx, constants.Running) // TODO option to disable with variable
|
||||
|
||||
<-ctx.Done()
|
||||
|
||||
if allSettings.OpenVPN.Provider.PortForwarding.Enabled {
|
||||
logger.Info("Clearing forwarded port status file %s", allSettings.OpenVPN.Provider.PortForwarding.Filepath)
|
||||
if err := os.Remove(string(allSettings.OpenVPN.Provider.PortForwarding.Filepath)); err != nil {
|
||||
logger.Error(err)
|
||||
logger.Info("Clearing forwarded port status file " + allSettings.OpenVPN.Provider.PortForwarding.Filepath)
|
||||
if err := os.Remove(allSettings.OpenVPN.Provider.PortForwarding.Filepath); err != nil {
|
||||
logger.Error(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
wg.Wait()
|
||||
return orderHandler.Shutdown(context.Background())
|
||||
}
|
||||
|
||||
type printVersionElement struct {
|
||||
name string
|
||||
getVersion func(ctx context.Context) (version string, err error)
|
||||
}
|
||||
|
||||
func printVersions(ctx context.Context, logger logging.Logger,
|
||||
elements []printVersionElement) (err error) {
|
||||
const timeout = 5 * time.Second
|
||||
ctx, cancel := context.WithTimeout(ctx, timeout)
|
||||
defer cancel()
|
||||
|
||||
for _, element := range elements {
|
||||
version, err := element.getVersion(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
logger.Info(element.name + " version: " + version)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func printVersions(ctx context.Context, logger logging.Logger,
|
||||
versionFunctions map[string]func(ctx context.Context) (string, error)) {
|
||||
const timeout = 5 * time.Second
|
||||
ctx, cancel := context.WithTimeout(ctx, timeout)
|
||||
defer cancel()
|
||||
for name, f := range versionFunctions {
|
||||
version, err := f(ctx)
|
||||
if err != nil {
|
||||
logger.Error(err)
|
||||
} else {
|
||||
logger.Info("%s version: %s", name, version)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func routeReadyEvents(ctx context.Context, wg *sync.WaitGroup, buildInfo models.BuildInformation,
|
||||
func routeReadyEvents(ctx context.Context, done chan<- struct{}, buildInfo models.BuildInformation,
|
||||
tunnelReadyCh <-chan struct{},
|
||||
unboundLooper dns.Looper, updaterLooper updater.Looper, publicIPLooper publicip.Looper,
|
||||
routing routing.Routing, logger logging.Logger, httpClient *http.Client,
|
||||
routing routing.VPNGetter, logger logging.Logger, httpClient *http.Client,
|
||||
versionInformation, portForwardingEnabled bool, startPortForward func(vpnGateway net.IP)) {
|
||||
defer wg.Done()
|
||||
tickerWg := &sync.WaitGroup{}
|
||||
defer close(done)
|
||||
|
||||
// for linters only
|
||||
var restartTickerContext context.Context
|
||||
var restartTickerCancel context.CancelFunc = func() {}
|
||||
|
||||
unboundTickerDone := make(chan struct{})
|
||||
close(unboundTickerDone)
|
||||
updaterTickerDone := make(chan struct{})
|
||||
close(updaterTickerDone)
|
||||
|
||||
first := true
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
restartTickerCancel() // for linters only
|
||||
tickerWg.Wait()
|
||||
<-unboundTickerDone
|
||||
<-updaterTickerDone
|
||||
return
|
||||
case <-tunnelReadyCh: // blocks until openvpn is connected
|
||||
vpnDestination, err := routing.VPNDestinationIP()
|
||||
if err != nil {
|
||||
logger.Warn(err)
|
||||
logger.Warn(err.Error())
|
||||
} else {
|
||||
logger.Info("VPN routing IP address: %s", vpnDestination)
|
||||
logger.Info("VPN routing IP address: " + vpnDestination.String())
|
||||
}
|
||||
|
||||
if unboundLooper.GetSettings().Enabled {
|
||||
_, _ = unboundLooper.SetStatus(constants.Running)
|
||||
_, _ = unboundLooper.ApplyStatus(ctx, constants.Running)
|
||||
}
|
||||
|
||||
restartTickerCancel() // stop previous restart tickers
|
||||
tickerWg.Wait()
|
||||
<-unboundTickerDone
|
||||
<-updaterTickerDone
|
||||
restartTickerContext, restartTickerCancel = context.WithCancel(ctx)
|
||||
|
||||
// Runs the Public IP getter job once
|
||||
_, _ = publicIPLooper.SetStatus(constants.Running)
|
||||
if !versionInformation {
|
||||
break
|
||||
}
|
||||
|
||||
if first {
|
||||
_, _ = publicIPLooper.ApplyStatus(ctx, constants.Running)
|
||||
if versionInformation && first {
|
||||
first = false
|
||||
message, err := versionpkg.GetMessage(ctx, buildInfo, httpClient)
|
||||
if err != nil {
|
||||
logger.Error(err)
|
||||
logger.Error("cannot get version information: " + err.Error())
|
||||
} else {
|
||||
logger.Info(message)
|
||||
}
|
||||
}
|
||||
|
||||
//nolint:gomnd
|
||||
tickerWg.Add(2)
|
||||
go unboundLooper.RunRestartTicker(restartTickerContext, tickerWg)
|
||||
go updaterLooper.RunRestartTicker(restartTickerContext, tickerWg)
|
||||
unboundTickerDone = make(chan struct{})
|
||||
updaterTickerDone = make(chan struct{})
|
||||
go unboundLooper.RunRestartTicker(restartTickerContext, unboundTickerDone)
|
||||
go updaterLooper.RunRestartTicker(restartTickerContext, updaterTickerDone)
|
||||
if portForwardingEnabled {
|
||||
// vpnGateway required only for PIA
|
||||
vpnGateway, err := routing.VPNLocalGatewayIP()
|
||||
if err != nil {
|
||||
logger.Error(err)
|
||||
logger.Error("cannot get VPN local gateway IP: " + err.Error())
|
||||
}
|
||||
logger.Info("VPN gateway IP address: %s", vpnGateway)
|
||||
logger.Info("VPN gateway IP address: " + vpnGateway.String())
|
||||
startPortForward(vpnGateway)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,18 +14,11 @@ services:
|
||||
# command:
|
||||
volumes:
|
||||
- /yourpath:/gluetun
|
||||
secrets:
|
||||
- openvpn_user
|
||||
- openvpn_password
|
||||
environment:
|
||||
# More variables are available, see the readme table
|
||||
- OPENVPN_USER=
|
||||
- OPENVPN_PASSWORD=
|
||||
- VPNSP=private internet access
|
||||
# Timezone for accurate logs times
|
||||
- TZ=
|
||||
restart: always
|
||||
|
||||
secrets:
|
||||
openvpn_user:
|
||||
file: ./openvpn_user
|
||||
openvpn_password:
|
||||
file: ./openvpn_password
|
||||
|
||||
20
go.mod
20
go.mod
@@ -1,16 +1,18 @@
|
||||
module github.com/qdm12/gluetun
|
||||
|
||||
go 1.15
|
||||
go 1.16
|
||||
|
||||
require (
|
||||
github.com/fatih/color v1.10.0
|
||||
github.com/golang/mock v1.4.4
|
||||
github.com/kyokomi/emoji v2.2.4+incompatible
|
||||
github.com/qdm12/dns v1.4.0-rc5
|
||||
github.com/qdm12/golibs v0.0.0-20210124192933-79a950eaf217
|
||||
github.com/qdm12/ss-server v0.1.0
|
||||
github.com/qdm12/updated v0.0.0-20210102005021-dd457d77f94a
|
||||
github.com/fatih/color v1.12.0
|
||||
github.com/golang/mock v1.6.0
|
||||
github.com/qdm12/dns v1.11.0
|
||||
github.com/qdm12/golibs v0.0.0-20210723175634-a75ca7fd74c2
|
||||
github.com/qdm12/goshutdown v0.1.0
|
||||
github.com/qdm12/gosplash v0.1.0
|
||||
github.com/qdm12/ss-server v0.2.0
|
||||
github.com/qdm12/updated v0.0.0-20210603204757-205acfe6937e
|
||||
github.com/stretchr/testify v1.7.0
|
||||
github.com/vishvananda/netlink v1.1.0
|
||||
golang.org/x/sys v0.0.0-20201223074533-0d417f636930
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c
|
||||
inet.af/netaddr v0.0.0-20210718074554-06ca8145d722
|
||||
)
|
||||
|
||||
153
go.sum
153
go.sum
@@ -1,119 +1,90 @@
|
||||
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/PuerkitoBio/purell v1.1.0 h1:rmGxhojJlM0tuKtfdvliR84CFHljx9ag64t2xmVkjK4=
|
||||
github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
|
||||
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
|
||||
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
|
||||
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs=
|
||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
|
||||
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
|
||||
github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf h1:eg0MeVzsP1G42dRafH3vf+al2vQIJU0YHX+1Tw87oco=
|
||||
github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
|
||||
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
|
||||
github.com/dvyukov/go-fuzz v0.0.0-20210103155950-6a8e9d1f2415/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw=
|
||||
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
|
||||
github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s=
|
||||
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
|
||||
github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg=
|
||||
github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
|
||||
github.com/fatih/color v1.12.0 h1:mRhaKNwANqRgUBGKmnI5ZxEk7QXmjQeCcuYFMX2bfcc=
|
||||
github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
|
||||
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
|
||||
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
|
||||
github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb h1:D4uzjWwKYQ5XnAvUbuvHW93esHg7F8N/OYeBBcJoTr0=
|
||||
github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
|
||||
github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI=
|
||||
github.com/go-openapi/analysis v0.17.0 h1:8JV+dzJJiK46XqGLqqLav8ZfEiJECp8jlOFhpiCdZ+0=
|
||||
github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik=
|
||||
github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0=
|
||||
github.com/go-openapi/errors v0.17.2 h1:azEQ8Fnx0jmtFF2fxsnmd6I0x6rsweUF63qqSO1NmKk=
|
||||
github.com/go-openapi/errors v0.17.2/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0=
|
||||
github.com/go-openapi/jsonpointer v0.17.0 h1:nH6xp8XdXHx8dqveo0ZuJBluCO2qGrPbDNZ0dwoRHP0=
|
||||
github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
|
||||
github.com/go-openapi/jsonreference v0.17.0 h1:yJW3HCkTHg7NOA+gZ83IPHzUSnUzGXhGmsdiCcMexbA=
|
||||
github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
|
||||
github.com/go-openapi/loads v0.17.0 h1:H22nMs3GDQk4SwAaFQ+jLNw+0xoFeCueawhZlv8MBYs=
|
||||
github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU=
|
||||
github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA=
|
||||
github.com/go-openapi/runtime v0.17.2 h1:/ZK67ikFhQAMFFH/aPu2MaGH7QjP4wHBvHYOVIzDAw0=
|
||||
github.com/go-openapi/runtime v0.17.2/go.mod h1:QO936ZXeisByFmZEO1IS1Dqhtf4QV1sYYFtIq6Ld86Q=
|
||||
github.com/go-openapi/spec v0.17.0 h1:XNvrt8FlSVP8T1WuhbAFF6QDhJc0zsoWzX4wXARhhpE=
|
||||
github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI=
|
||||
github.com/go-openapi/strfmt v0.17.0 h1:1isAxYf//QDTnVzbLAMrUK++0k1EjeLJU/gTOR0o3Mc=
|
||||
github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU=
|
||||
github.com/go-openapi/swag v0.17.0 h1:iqrgMg7Q7SvtbWLlltPrkMs0UBJI6oTSs79JFRUi880=
|
||||
github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
|
||||
github.com/go-openapi/validate v0.17.0 h1:pqoViQz3YLOGIhAmD0N4Lt6pa/3Gnj3ymKqQwq8iS6U=
|
||||
github.com/go-openapi/validate v0.17.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4=
|
||||
github.com/golang/mock v1.4.3 h1:GV+pQPG/EUUbkh47niozDcADz6go/dUwhVzdUQHIVRw=
|
||||
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||
github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc=
|
||||
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
|
||||
github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8=
|
||||
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
|
||||
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
|
||||
github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/gotify/go-api-client/v2 v2.0.4 h1:0w8skCr8aLBDKaQDg31LKKHUGF7rt7zdRpR+6cqIAlE=
|
||||
github.com/gotify/go-api-client/v2 v2.0.4/go.mod h1:VKiah/UK20bXsr0JObE1eBVLW44zbBouzjuri9iwjFU=
|
||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
|
||||
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
|
||||
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kyokomi/emoji v2.2.4+incompatible h1:np0woGKwx9LiHAQmwZx79Oc0rHpNw3o+3evou4BEPv4=
|
||||
github.com/kyokomi/emoji v2.2.4+incompatible/go.mod h1:mZ6aGCD7yk8j6QY6KICwnZ2pxoszVseX1DNoGtU2tBA=
|
||||
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 h1:2gxZ0XQIU/5z3Z3bUBu+FXuk2pFbkN6tcwi/pjyaDic=
|
||||
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||
github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA=
|
||||
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
|
||||
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM=
|
||||
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
|
||||
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/miekg/dns v1.1.40 h1:pyyPFfGMnciYUk/mXpKkVmeMQjfXqt3FAJ2hy7tPiLA=
|
||||
github.com/miekg/dns v1.1.40/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
|
||||
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/mr-tron/base58 v1.1.3 h1:v+sk57XuaCKGXpWtVBX8YJzO7hMGx4Aajh4TQbdEFdc=
|
||||
github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
|
||||
github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
|
||||
github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
|
||||
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
|
||||
github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo=
|
||||
github.com/phayes/permbits v0.0.0-20190612203442-39d7c581d2ee h1:P6U24L02WMfj9ymZTxl7CxS73JC99x3ukk+DBkgQGQs=
|
||||
github.com/phayes/permbits v0.0.0-20190612203442-39d7c581d2ee/go.mod h1:3uODdxMgOaPYeWU7RzZLxVtJHZ/x1f/iHkBZuKJDzuY=
|
||||
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/qdm12/dns v1.4.0-rc5 h1:XXjYaFI3pDY1U4YFH5t5AI5IEKlIALmnE34VFhgkdQE=
|
||||
github.com/qdm12/dns v1.4.0-rc5/go.mod h1:WUY4/U8Z2O8888DPrahrIBv8GdYeoIcEy4aUDecZ+UM=
|
||||
github.com/qdm12/golibs v0.0.0-20201227203847-2fd99ffdfdba/go.mod h1:pikkTN7g7zRuuAnERwqW1yAFq6pYmxrxpjiwGvb0Ysc=
|
||||
github.com/qdm12/golibs v0.0.0-20210124192933-79a950eaf217 h1:/eMBq0vbc/KmVPXbwLfssp547pp6APRS1x/JNmPvm0s=
|
||||
github.com/qdm12/golibs v0.0.0-20210124192933-79a950eaf217/go.mod h1:pikkTN7g7zRuuAnERwqW1yAFq6pYmxrxpjiwGvb0Ysc=
|
||||
github.com/qdm12/ss-server v0.1.0 h1:WV9MkHCDEWRwe4WpnYFeR/zcZAxYoTbfntLDnw9AQ50=
|
||||
github.com/qdm12/ss-server v0.1.0/go.mod h1:ABVUkxubboL3vqBkOwDV9glX1/x7SnYrckBe5d+M/zw=
|
||||
github.com/qdm12/updated v0.0.0-20210102005021-dd457d77f94a h1:gkyP+gMEeBgMgyRYGrVNcoy6cL1065IvXsyfB6xboIc=
|
||||
github.com/qdm12/updated v0.0.0-20210102005021-dd457d77f94a/go.mod h1:bbJGxEYCnsA8WU4vBcXYU6mOoHyzdP458FIKP4mfLJM=
|
||||
github.com/qdm12/dns v1.11.0 h1:jpcD5DZXXQSQe5a263PL09ghukiIdptvXFOZvyKEm6Q=
|
||||
github.com/qdm12/dns v1.11.0/go.mod h1:FmQsNOUcrrZ4UFzWAiED56AKXeNgaX3ySbmPwEfNjjE=
|
||||
github.com/qdm12/golibs v0.0.0-20210603202746-e5494e9c2ebb/go.mod h1:15RBzkun0i8XB7ADIoLJWp9ITRgsz3LroEI2FiOXLRg=
|
||||
github.com/qdm12/golibs v0.0.0-20210723175634-a75ca7fd74c2 h1:FMeOhe/bGloI0T5Wb6QB7/rfOqgFeI//UF/N/f7PUCI=
|
||||
github.com/qdm12/golibs v0.0.0-20210723175634-a75ca7fd74c2/go.mod h1:6aRbg4Z/bTbm9JfxsGXfWKHi7zsOvPfUTK1S5HuAFKg=
|
||||
github.com/qdm12/goshutdown v0.1.0 h1:lmwnygdXtnr2pa6VqfR/bm8077/BnBef1+7CP96B7Sw=
|
||||
github.com/qdm12/goshutdown v0.1.0/go.mod h1:/LP3MWLqI+wGH/ijfaUG+RHzBbKXIiVKnrg5vXOCf6Q=
|
||||
github.com/qdm12/gosplash v0.1.0 h1:Sfl+zIjFZFP7b0iqf2l5UkmEY97XBnaKkH3FNY6Gf7g=
|
||||
github.com/qdm12/gosplash v0.1.0/go.mod h1:+A3fWW4/rUeDXhY3ieBzwghKdnIPFJgD8K3qQkenJlw=
|
||||
github.com/qdm12/ss-server v0.2.0 h1:+togLzeeLAJ68MD1JqOWvYi9rl9t/fx1Qh7wKzZhY1g=
|
||||
github.com/qdm12/ss-server v0.2.0/go.mod h1:+1bWO1EfWNvsGM5Cuep6vneChK2OHniqtAsED9Fh1y0=
|
||||
github.com/qdm12/updated v0.0.0-20210603204757-205acfe6937e h1:4q+uFLawkaQRq3yARYLsjJPZd2wYwxn4g6G/5v0xW1g=
|
||||
github.com/qdm12/updated v0.0.0-20210603204757-205acfe6937e/go.mod h1:UvJRGkZ9XL3/D7e7JiTTVLm1F3Cymd3/gFpD6frEpBo=
|
||||
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 h1:f/FNXud6gA3MNr8meMVVGxhp+QBTqY91tM8HjEuMjGg=
|
||||
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3/go.mod h1:HgjTstvQsPGkxUsCd2KWxErBblirPizecHcpD3ffK+s=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
|
||||
github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI=
|
||||
github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/vishvananda/netlink v1.1.0 h1:1iyaYNBLmP6L0220aDnYQpo1QEV4t4hJ+xEEhhJH8j0=
|
||||
@@ -122,60 +93,69 @@ github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df h1:OviZH7qLw/7Zo
|
||||
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
|
||||
github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4=
|
||||
github.com/yl2chen/cidranger v1.0.2/go.mod h1:9U1yz7WPYDwf0vpNWFaeRh0bjwz5RVgRy/9UEQfHl0g=
|
||||
go.uber.org/atomic v1.5.0 h1:OI5t8sDa1Or+q8AeE+yKeB/SDYioSHAgcVljj9JIETY=
|
||||
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
|
||||
go.uber.org/multierr v1.3.0 h1:sFPn2GLc3poCkfrpIXGhBD2X0CMIo4Q/zSULXrj/+uc=
|
||||
go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
|
||||
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4=
|
||||
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
|
||||
go.uber.org/zap v1.13.0 h1:nR6NoDBgAf67s68NhaXbsojM+2gxp3S1hWkHDl27pVU=
|
||||
go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
go4.org/intern v0.0.0-20210108033219-3eb7198706b2 h1:VFTf+jjIgsldaz/Mr00VaCSswHJrI2hIjQygE/W4IMg=
|
||||
go4.org/intern v0.0.0-20210108033219-3eb7198706b2/go.mod h1:vLqJ+12kCw61iCWsPto0EOHhBS+o4rO5VIucbc9g2Cc=
|
||||
go4.org/unsafe/assume-no-moving-gc v0.0.0-20201222175341-b30ae309168e/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E=
|
||||
go4.org/unsafe/assume-no-moving-gc v0.0.0-20201222180813-1025295fd063 h1:1tk03FUNpulq2cuWpXZWj649rwJpk0d20rxWiopKRmc=
|
||||
go4.org/unsafe/assume-no-moving-gc v0.0.0-20201222180813-1025295fd063/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E=
|
||||
golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de h1:ikNHVSjEfnvz6sxdSPCaPt572qowuyMDMJLLm3Db3ig=
|
||||
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY=
|
||||
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
|
||||
golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs=
|
||||
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
|
||||
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 h1:/UOmuWzQfxxo9UtlXMwuQU8CMgg1eZXqTRwkSQJWKOI=
|
||||
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0=
|
||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201223074533-0d417f636930 h1:vRgIt+nup/B/BwIS0g2oC0haq0iqbV3ZA+u6+0TlNCo=
|
||||
golang.org/x/sys v0.0.0-20201223074533-0d417f636930/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190729092621-ff9f1409240a/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
|
||||
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 h1:hKsoRgsbwY1NafxrwTs+k64bikrLBkAgPir1TNCj3Zs=
|
||||
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
|
||||
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
gopkg.in/src-d/go-billy.v4 v4.3.2/go.mod h1:nDjArDMp+XMs1aFAESLRjfGSgfvoYN0hDfzEk0GjC98=
|
||||
gopkg.in/src-d/go-git-fixtures.v3 v3.5.0/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g=
|
||||
gopkg.in/src-d/go-git.v4 v4.13.1/go.mod h1:nx5NYcxdKxq5fpltdHnPa2Exj4Sx0EclMWZQbYDu2z8=
|
||||
@@ -184,7 +164,6 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM=
|
||||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
||||
inet.af/netaddr v0.0.0-20210511181906-37180328850c/go.mod h1:z0nx+Dh+7N7CC8V5ayHtHGpZpxLQZZxkIaaz6HN65Ls=
|
||||
inet.af/netaddr v0.0.0-20210718074554-06ca8145d722 h1:Qws2rZnQudC58cIagVucPQDLmMi3kAXgxscsgD0v6DU=
|
||||
inet.af/netaddr v0.0.0-20210718074554-06ca8145d722/go.mod h1:z0nx+Dh+7N7CC8V5ayHtHGpZpxLQZZxkIaaz6HN65Ls=
|
||||
|
||||
@@ -1,22 +1,29 @@
|
||||
// Package alpine defines a configurator to interact with the Alpine operating system.
|
||||
package alpine
|
||||
|
||||
import (
|
||||
"github.com/qdm12/golibs/os"
|
||||
"github.com/qdm12/golibs/os/user"
|
||||
"os/user"
|
||||
)
|
||||
|
||||
type Configurator interface {
|
||||
CreateUser(username string, uid int) (createdUsername string, err error)
|
||||
var _ Alpiner = (*Alpine)(nil)
|
||||
|
||||
type Alpiner interface {
|
||||
UserCreater
|
||||
VersionGetter
|
||||
}
|
||||
|
||||
type configurator struct {
|
||||
openFile os.OpenFileFunc
|
||||
osUser user.OSUser
|
||||
type Alpine struct {
|
||||
alpineReleasePath string
|
||||
passwdPath string
|
||||
lookupID func(uid string) (*user.User, error)
|
||||
lookup func(username string) (*user.User, error)
|
||||
}
|
||||
|
||||
func NewConfigurator(openFile os.OpenFileFunc, osUser user.OSUser) Configurator {
|
||||
return &configurator{
|
||||
openFile: openFile,
|
||||
osUser: osUser,
|
||||
func New() *Alpine {
|
||||
return &Alpine{
|
||||
alpineReleasePath: "/etc/alpine-release",
|
||||
passwdPath: "/etc/passwd",
|
||||
lookupID: user.LookupId,
|
||||
lookup: user.Lookup,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +1,51 @@
|
||||
package alpine
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/user"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
var (
|
||||
ErrUserAlreadyExists = errors.New("user already exists")
|
||||
)
|
||||
|
||||
type UserCreater interface {
|
||||
CreateUser(username string, uid int) (createdUsername string, err error)
|
||||
}
|
||||
|
||||
// CreateUser creates a user in Alpine with the given UID.
|
||||
func (c *configurator) CreateUser(username string, uid int) (createdUsername string, err error) {
|
||||
UIDStr := fmt.Sprintf("%d", uid)
|
||||
u, err := c.osUser.LookupID(UIDStr)
|
||||
func (a *Alpine) CreateUser(username string, uid int) (createdUsername string, err error) {
|
||||
UIDStr := strconv.Itoa(uid)
|
||||
u, err := a.lookupID(UIDStr)
|
||||
_, unknownUID := err.(user.UnknownUserIdError)
|
||||
if err != nil && !unknownUID {
|
||||
return "", fmt.Errorf("cannot create user: %w", err)
|
||||
} else if u != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if u != nil {
|
||||
if u.Username == username {
|
||||
return "", nil
|
||||
}
|
||||
return u.Username, nil
|
||||
}
|
||||
u, err = c.osUser.Lookup(username)
|
||||
|
||||
u, err = a.lookup(username)
|
||||
_, unknownUsername := err.(user.UnknownUserError)
|
||||
if err != nil && !unknownUsername {
|
||||
return "", fmt.Errorf("cannot create user: %w", err)
|
||||
} else if u != nil {
|
||||
return "", fmt.Errorf("cannot create user: user with name %s already exists for ID %s instead of %d",
|
||||
username, u.Uid, uid)
|
||||
return "", err
|
||||
}
|
||||
file, err := c.openFile("/etc/passwd", os.O_APPEND|os.O_WRONLY, 0644)
|
||||
|
||||
if u != nil {
|
||||
return "", fmt.Errorf("%w: with name %s for ID %s instead of %d",
|
||||
ErrUserAlreadyExists, username, u.Uid, uid)
|
||||
}
|
||||
|
||||
file, err := os.OpenFile(a.passwdPath, os.O_APPEND|os.O_WRONLY, 0644)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("cannot create user: %w", err)
|
||||
return "", err
|
||||
}
|
||||
s := fmt.Sprintf("%s:x:%d:::/dev/null:/sbin/nologin\n", username, uid)
|
||||
_, err = file.WriteString(s)
|
||||
@@ -37,5 +53,6 @@ func (c *configurator) CreateUser(username string, uid int) (createdUsername str
|
||||
_ = file.Close()
|
||||
return "", err
|
||||
}
|
||||
|
||||
return username, file.Close()
|
||||
}
|
||||
|
||||
31
internal/alpine/version.go
Normal file
31
internal/alpine/version.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package alpine
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type VersionGetter interface {
|
||||
Version(ctx context.Context) (version string, err error)
|
||||
}
|
||||
|
||||
func (a *Alpine) Version(ctx context.Context) (version string, err error) {
|
||||
file, err := os.OpenFile(a.alpineReleasePath, os.O_RDONLY, 0)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
b, err := io.ReadAll(file)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if err := file.Close(); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
version = strings.ReplaceAll(string(b), "\n", "")
|
||||
return version, nil
|
||||
}
|
||||
@@ -2,6 +2,6 @@ package cli
|
||||
|
||||
import "context"
|
||||
|
||||
func (c *cli) CI(context context.Context) error {
|
||||
func (c *CLI) CI(context context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
// Package cli defines an interface CLI to run command line operations.
|
||||
package cli
|
||||
|
||||
import (
|
||||
"context"
|
||||
var _ CLIer = (*CLI)(nil)
|
||||
|
||||
"github.com/qdm12/golibs/os"
|
||||
)
|
||||
|
||||
type CLI interface {
|
||||
ClientKey(args []string, openFile os.OpenFileFunc) error
|
||||
HealthCheck(ctx context.Context) error
|
||||
OpenvpnConfig(os os.OS) error
|
||||
Update(ctx context.Context, args []string, os os.OS) error
|
||||
type CLIer interface {
|
||||
ClientKeyFormatter
|
||||
HealthChecker
|
||||
OpenvpnConfigMaker
|
||||
Updater
|
||||
}
|
||||
|
||||
type cli struct{}
|
||||
|
||||
func New() CLI {
|
||||
return &cli{}
|
||||
type CLI struct {
|
||||
repoServersPath string
|
||||
}
|
||||
|
||||
func New() *CLI {
|
||||
return &CLI{
|
||||
repoServersPath: "./internal/constants/servers.json",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,24 +3,28 @@ package cli
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
"github.com/qdm12/golibs/os"
|
||||
)
|
||||
|
||||
func (c *cli) ClientKey(args []string, openFile os.OpenFileFunc) error {
|
||||
type ClientKeyFormatter interface {
|
||||
ClientKey(args []string) error
|
||||
}
|
||||
|
||||
func (c *CLI) ClientKey(args []string) error {
|
||||
flagSet := flag.NewFlagSet("clientkey", flag.ExitOnError)
|
||||
filepath := flagSet.String("path", string(constants.ClientKey), "file path to the client.key file")
|
||||
filepath := flagSet.String("path", constants.ClientKey, "file path to the client.key file")
|
||||
if err := flagSet.Parse(args); err != nil {
|
||||
return err
|
||||
}
|
||||
file, err := openFile(*filepath, os.O_RDONLY, 0)
|
||||
file, err := os.OpenFile(*filepath, os.O_RDONLY, 0)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
data, err := ioutil.ReadAll(file)
|
||||
data, err := io.ReadAll(file)
|
||||
if err != nil {
|
||||
_ = file.Close()
|
||||
return err
|
||||
|
||||
@@ -2,19 +2,39 @@ package cli
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
"github.com/qdm12/gluetun/internal/configuration"
|
||||
"github.com/qdm12/gluetun/internal/healthcheck"
|
||||
"github.com/qdm12/golibs/logging"
|
||||
"github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
func (c *cli) HealthCheck(ctx context.Context) error {
|
||||
type HealthChecker interface {
|
||||
HealthCheck(ctx context.Context, env params.Env, logger logging.Logger) error
|
||||
}
|
||||
|
||||
func (c *CLI) HealthCheck(ctx context.Context, env params.Env,
|
||||
logger logging.Logger) error {
|
||||
// Extract the health server port from the configuration.
|
||||
config := configuration.Health{}
|
||||
err := config.Read(env, logger)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, port, err := net.SplitHostPort(config.ServerAddress)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
const timeout = 10 * time.Second
|
||||
httpClient := &http.Client{Timeout: timeout}
|
||||
healthchecker := healthcheck.NewChecker(httpClient)
|
||||
client := healthcheck.NewClient(httpClient)
|
||||
ctx, cancel := context.WithTimeout(ctx, timeout)
|
||||
defer cancel()
|
||||
const url = "http://" + constants.HealthcheckAddress
|
||||
return healthchecker.Check(ctx, url)
|
||||
|
||||
url := "http://127.0.0.1:" + port
|
||||
return client.Check(ctx, url)
|
||||
}
|
||||
|
||||
@@ -5,26 +5,25 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/configuration"
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
"github.com/qdm12/gluetun/internal/params"
|
||||
"github.com/qdm12/gluetun/internal/provider"
|
||||
"github.com/qdm12/gluetun/internal/settings"
|
||||
"github.com/qdm12/gluetun/internal/storage"
|
||||
"github.com/qdm12/golibs/logging"
|
||||
"github.com/qdm12/golibs/os"
|
||||
"github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
func (c *cli) OpenvpnConfig(os os.OS) error {
|
||||
logger, err := logging.NewLogger(logging.ConsoleEncoding, logging.InfoLevel)
|
||||
type OpenvpnConfigMaker interface {
|
||||
OpenvpnConfig(logger logging.Logger) error
|
||||
}
|
||||
|
||||
func (c *CLI) OpenvpnConfig(logger logging.Logger) error {
|
||||
var allSettings configuration.Settings
|
||||
err := allSettings.Read(params.NewEnv(), logger)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
paramsReader := params.NewReader(logger, os)
|
||||
allSettings, _, err := settings.GetAllSettings(paramsReader)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
allServers, err := storage.New(logger, os, constants.ServersData).
|
||||
allServers, err := storage.New(logger, constants.ServersData).
|
||||
SyncServers(constants.GetAllServers())
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -2,63 +2,110 @@ package cli
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/configuration"
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
"github.com/qdm12/gluetun/internal/settings"
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
"github.com/qdm12/gluetun/internal/storage"
|
||||
"github.com/qdm12/gluetun/internal/updater"
|
||||
"github.com/qdm12/golibs/logging"
|
||||
"github.com/qdm12/golibs/os"
|
||||
)
|
||||
|
||||
func (c *cli) Update(ctx context.Context, args []string, os os.OS) error {
|
||||
options := settings.Updater{CLI: true}
|
||||
var flushToFile bool
|
||||
var (
|
||||
ErrModeUnspecified = errors.New("at least one of -enduser or -maintainers must be specified")
|
||||
ErrSyncServers = errors.New("cannot sync hardcoded and persisted servers")
|
||||
ErrUpdateServerInformation = errors.New("cannot update server information")
|
||||
ErrWriteToFile = errors.New("cannot write updated information to file")
|
||||
)
|
||||
|
||||
type Updater interface {
|
||||
Update(ctx context.Context, args []string, logger logging.Logger) error
|
||||
}
|
||||
|
||||
func (c *CLI) Update(ctx context.Context, args []string, logger logging.Logger) error {
|
||||
options := configuration.Updater{CLI: true}
|
||||
var endUserMode, maintainerMode, updateAll bool
|
||||
flagSet := flag.NewFlagSet("update", flag.ExitOnError)
|
||||
flagSet.BoolVar(&flushToFile, "file", false, "Write results to /gluetun/servers.json (for end users)")
|
||||
flagSet.BoolVar(&options.Stdout, "stdout", false, "Write results to console to modify the program (for maintainers)")
|
||||
flagSet.StringVar(&options.DNSAddress, "dns", "1.1.1.1", "DNS resolver address to use")
|
||||
flagSet.BoolVar(&endUserMode, "enduser", false, "Write results to /gluetun/servers.json (for end users)")
|
||||
flagSet.BoolVar(&maintainerMode, "maintainer", false,
|
||||
"Write results to ./internal/constants/servers.json to modify the program (for maintainers)")
|
||||
flagSet.StringVar(&options.DNSAddress, "dns", "8.8.8.8", "DNS resolver address to use")
|
||||
flagSet.BoolVar(&updateAll, "all", false, "Update servers for all VPN providers")
|
||||
flagSet.BoolVar(&options.Cyberghost, "cyberghost", false, "Update Cyberghost servers")
|
||||
flagSet.BoolVar(&options.Fastestvpn, "fastestvpn", false, "Update FastestVPN servers")
|
||||
flagSet.BoolVar(&options.HideMyAss, "hidemyass", false, "Update HideMyAss servers")
|
||||
flagSet.BoolVar(&options.Ipvanish, "ipvanish", false, "Update IpVanish servers")
|
||||
flagSet.BoolVar(&options.Ivpn, "ivpn", false, "Update IVPN servers")
|
||||
flagSet.BoolVar(&options.Mullvad, "mullvad", false, "Update Mullvad servers")
|
||||
flagSet.BoolVar(&options.Nordvpn, "nordvpn", false, "Update Nordvpn servers")
|
||||
flagSet.BoolVar(&options.PIA, "pia", false, "Update Private Internet Access post-summer 2020 servers")
|
||||
flagSet.BoolVar(&options.Privado, "privado", false, "Update Privado servers")
|
||||
flagSet.BoolVar(&options.Privatevpn, "privatevpn", false, "Update Private VPN servers")
|
||||
flagSet.BoolVar(&options.Protonvpn, "protonvpn", false, "Update Protonvpn servers")
|
||||
flagSet.BoolVar(&options.Purevpn, "purevpn", false, "Update Purevpn servers")
|
||||
flagSet.BoolVar(&options.Surfshark, "surfshark", false, "Update Surfshark servers")
|
||||
flagSet.BoolVar(&options.Torguard, "torguard", false, "Update Torguard servers")
|
||||
flagSet.BoolVar(&options.VPNUnlimited, "vpnunlimited", false, "Update VPN Unlimited servers")
|
||||
flagSet.BoolVar(&options.Vyprvpn, "vyprvpn", false, "Update Vyprvpn servers")
|
||||
flagSet.BoolVar(&options.Windscribe, "windscribe", false, "Update Windscribe servers")
|
||||
if err := flagSet.Parse(args); err != nil {
|
||||
return err
|
||||
}
|
||||
logger, err := logging.NewLogger(logging.ConsoleEncoding, logging.InfoLevel)
|
||||
if err != nil {
|
||||
return err
|
||||
if !endUserMode && !maintainerMode {
|
||||
return ErrModeUnspecified
|
||||
}
|
||||
if !flushToFile && !options.Stdout {
|
||||
return fmt.Errorf("at least one of -file or -stdout must be specified")
|
||||
|
||||
if updateAll {
|
||||
options.EnableAll()
|
||||
}
|
||||
|
||||
const clientTimeout = 10 * time.Second
|
||||
httpClient := &http.Client{Timeout: clientTimeout}
|
||||
storage := storage.New(logger, os, constants.ServersData)
|
||||
storage := storage.New(logger, constants.ServersData)
|
||||
currentServers, err := storage.SyncServers(constants.GetAllServers())
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot update servers: %w", err)
|
||||
return fmt.Errorf("%w: %s", ErrSyncServers, err)
|
||||
}
|
||||
updater := updater.New(options, httpClient, currentServers, logger)
|
||||
allServers, err := updater.UpdateServers(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
return fmt.Errorf("%w: %s", ErrUpdateServerInformation, err)
|
||||
}
|
||||
if flushToFile {
|
||||
|
||||
if endUserMode {
|
||||
if err := storage.FlushToFile(allServers); err != nil {
|
||||
return fmt.Errorf("cannot update servers: %w", err)
|
||||
return fmt.Errorf("%w: %s", ErrWriteToFile, err)
|
||||
}
|
||||
}
|
||||
|
||||
if maintainerMode {
|
||||
if err := writeToEmbeddedJSON(c.repoServersPath, allServers); err != nil {
|
||||
return fmt.Errorf("%w: %s", ErrWriteToFile, err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func writeToEmbeddedJSON(repoServersPath string,
|
||||
allServers models.AllServers) error {
|
||||
const perms = 0600
|
||||
f, err := os.OpenFile(repoServersPath,
|
||||
os.O_TRUNC|os.O_WRONLY|os.O_CREATE, perms)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
defer f.Close()
|
||||
|
||||
encoder := json.NewEncoder(f)
|
||||
encoder.SetIndent("", " ")
|
||||
return encoder.Encode(allServers)
|
||||
}
|
||||
|
||||
3
internal/configuration/configuration.go
Normal file
3
internal/configuration/configuration.go
Normal file
@@ -0,0 +1,3 @@
|
||||
// Package configuration reads initial settings from environment variables
|
||||
// and secret files.
|
||||
package configuration
|
||||
6
internal/configuration/constants.go
Normal file
6
internal/configuration/constants.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package configuration
|
||||
|
||||
const (
|
||||
lastIndent = "|--"
|
||||
indent = " "
|
||||
)
|
||||
72
internal/configuration/cyberghost.go
Normal file
72
internal/configuration/cyberghost.go
Normal file
@@ -0,0 +1,72 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
"github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
func (settings *Provider) cyberghostLines() (lines []string) {
|
||||
lines = append(lines, lastIndent+"Server group: "+settings.ServerSelection.Group)
|
||||
|
||||
if len(settings.ServerSelection.Regions) > 0 {
|
||||
lines = append(lines, lastIndent+"Regions: "+commaJoin(settings.ServerSelection.Regions))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Hostnames) > 0 {
|
||||
lines = append(lines, lastIndent+"Hostnames: "+commaJoin(settings.ServerSelection.Hostnames))
|
||||
}
|
||||
|
||||
if settings.ExtraConfigOptions.ClientKey != "" {
|
||||
lines = append(lines, lastIndent+"Client key is set")
|
||||
}
|
||||
|
||||
if settings.ExtraConfigOptions.ClientCertificate != "" {
|
||||
lines = append(lines, lastIndent+"Client certificate is set")
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
func (settings *Provider) readCyberghost(r reader) (err error) {
|
||||
settings.Name = constants.Cyberghost
|
||||
|
||||
settings.ServerSelection.TCP, err = readProtocol(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.TargetIP, err = readTargetIP(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ExtraConfigOptions.ClientKey, err = readClientKey(r)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ExtraConfigOptions.ClientCertificate, err = readClientCertificate(r)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.Group, err = r.env.Inside("CYBERGHOST_GROUP",
|
||||
constants.CyberghostGroupChoices(), params.Default("Premium UDP Europe"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable CYBERGHOST_GROUP: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Regions, err = r.env.CSVInside("REGION", constants.CyberghostRegionChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable REGION: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Hostnames, err = r.env.CSVInside("SERVER_HOSTNAME", constants.CyberghostHostnameChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable SERVER_HOSTNAME: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
117
internal/configuration/dns.go
Normal file
117
internal/configuration/dns.go
Normal file
@@ -0,0 +1,117 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/qdm12/dns/pkg/blacklist"
|
||||
"github.com/qdm12/dns/pkg/unbound"
|
||||
"github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
// DNS contains settings to configure Unbound for DNS over TLS operation.
|
||||
type DNS struct { //nolint:maligned
|
||||
Enabled bool
|
||||
PlaintextAddress net.IP
|
||||
KeepNameserver bool
|
||||
UpdatePeriod time.Duration
|
||||
Unbound unbound.Settings
|
||||
BlacklistBuild blacklist.BuilderSettings
|
||||
}
|
||||
|
||||
func (settings *DNS) String() string {
|
||||
return strings.Join(settings.lines(), "\n")
|
||||
}
|
||||
|
||||
func (settings *DNS) lines() (lines []string) {
|
||||
lines = append(lines, lastIndent+"DNS:")
|
||||
|
||||
if settings.PlaintextAddress != nil {
|
||||
lines = append(lines, indent+lastIndent+"Plaintext address: "+settings.PlaintextAddress.String())
|
||||
}
|
||||
|
||||
if settings.KeepNameserver {
|
||||
lines = append(lines, indent+lastIndent+"Keep nameserver (disabled blocking): yes")
|
||||
}
|
||||
|
||||
if !settings.Enabled {
|
||||
return lines
|
||||
}
|
||||
|
||||
lines = append(lines, indent+lastIndent+"DNS over TLS:")
|
||||
|
||||
lines = append(lines, indent+indent+lastIndent+"Unbound:")
|
||||
for _, line := range settings.Unbound.Lines() {
|
||||
lines = append(lines, indent+indent+indent+line)
|
||||
}
|
||||
|
||||
lines = append(lines, indent+indent+lastIndent+"Blacklist:")
|
||||
for _, line := range settings.BlacklistBuild.Lines(indent, lastIndent) {
|
||||
lines = append(lines, indent+indent+indent+line)
|
||||
}
|
||||
|
||||
if settings.UpdatePeriod > 0 {
|
||||
lines = append(lines, indent+indent+lastIndent+"Update: every "+settings.UpdatePeriod.String())
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
var (
|
||||
ErrUnboundSettings = errors.New("failed getting Unbound settings")
|
||||
ErrBlacklistSettings = errors.New("failed getting DNS blacklist settings")
|
||||
)
|
||||
|
||||
func (settings *DNS) read(r reader) (err error) {
|
||||
settings.Enabled, err = r.env.OnOff("DOT", params.Default("on"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable DOT: %w", err)
|
||||
}
|
||||
|
||||
// Plain DNS settings
|
||||
if err := settings.readDNSPlaintext(r.env); err != nil {
|
||||
return err
|
||||
}
|
||||
settings.KeepNameserver, err = r.env.OnOff("DNS_KEEP_NAMESERVER", params.Default("off"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable DNS_KEEP_NAMESERVER: %w", err)
|
||||
}
|
||||
|
||||
// DNS over TLS external settings
|
||||
if err := settings.readBlacklistBuilding(r); err != nil {
|
||||
return fmt.Errorf("%w: %s", ErrBlacklistSettings, err)
|
||||
}
|
||||
|
||||
settings.UpdatePeriod, err = r.env.Duration("DNS_UPDATE_PERIOD", params.Default("24h"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable DNS_UPDATE_PERIOD: %w", err)
|
||||
}
|
||||
|
||||
// Unbound settings
|
||||
if err := settings.readUnbound(r); err != nil {
|
||||
return fmt.Errorf("%w: %s", ErrUnboundSettings, err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
ErrDNSAddressNotAnIP = errors.New("DNS plaintext address is not an IP address")
|
||||
)
|
||||
|
||||
func (settings *DNS) readDNSPlaintext(env params.Env) error {
|
||||
s, err := env.Get("DNS_PLAINTEXT_ADDRESS", params.Default("1.1.1.1"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable DNS_PLAINTEXT_ADDRESS: %w", err)
|
||||
}
|
||||
|
||||
settings.PlaintextAddress = net.ParseIP(s)
|
||||
if settings.PlaintextAddress == nil {
|
||||
return fmt.Errorf("%w: %s", ErrDNSAddressNotAnIP, s)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
76
internal/configuration/dns_test.go
Normal file
76
internal/configuration/dns_test.go
Normal file
@@ -0,0 +1,76 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"net"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/qdm12/dns/pkg/blacklist"
|
||||
"github.com/qdm12/dns/pkg/provider"
|
||||
"github.com/qdm12/dns/pkg/unbound"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func Test_DNS_Lines(t *testing.T) {
|
||||
t.Parallel()
|
||||
testCases := map[string]struct {
|
||||
settings DNS
|
||||
lines []string
|
||||
}{
|
||||
"disabled DOT": {
|
||||
settings: DNS{
|
||||
PlaintextAddress: net.IP{1, 1, 1, 1},
|
||||
},
|
||||
lines: []string{
|
||||
"|--DNS:",
|
||||
" |--Plaintext address: 1.1.1.1",
|
||||
},
|
||||
},
|
||||
"enabled DOT": {
|
||||
settings: DNS{
|
||||
Enabled: true,
|
||||
KeepNameserver: true,
|
||||
Unbound: unbound.Settings{
|
||||
Providers: []provider.Provider{
|
||||
provider.Cloudflare(),
|
||||
},
|
||||
},
|
||||
BlacklistBuild: blacklist.BuilderSettings{
|
||||
BlockMalicious: true,
|
||||
BlockAds: true,
|
||||
BlockSurveillance: true,
|
||||
},
|
||||
UpdatePeriod: time.Hour,
|
||||
},
|
||||
lines: []string{
|
||||
"|--DNS:",
|
||||
" |--Keep nameserver (disabled blocking): yes",
|
||||
" |--DNS over TLS:",
|
||||
" |--Unbound:",
|
||||
" |--DNS over TLS providers:",
|
||||
" |--Cloudflare",
|
||||
" |--Listening port: 0",
|
||||
" |--Access control:",
|
||||
" |--Allowed:",
|
||||
" |--Caching: disabled",
|
||||
" |--IPv4 resolution: disabled",
|
||||
" |--IPv6 resolution: disabled",
|
||||
" |--Verbosity level: 0/5",
|
||||
" |--Verbosity details level: 0/4",
|
||||
" |--Validation log level: 0/2",
|
||||
" |--Username: ",
|
||||
" |--Blacklist:",
|
||||
" |--Blocked categories: malicious, surveillance, ads",
|
||||
" |--Update: every 1h0m0s",
|
||||
},
|
||||
},
|
||||
}
|
||||
for name, testCase := range testCases {
|
||||
testCase := testCase
|
||||
t.Run(name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
lines := testCase.settings.lines()
|
||||
assert.Equal(t, testCase.lines, lines)
|
||||
})
|
||||
}
|
||||
}
|
||||
87
internal/configuration/dnsblacklist.go
Normal file
87
internal/configuration/dnsblacklist.go
Normal file
@@ -0,0 +1,87 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/qdm12/golibs/params"
|
||||
"inet.af/netaddr"
|
||||
)
|
||||
|
||||
func (settings *DNS) readBlacklistBuilding(r reader) (err error) {
|
||||
settings.BlacklistBuild.BlockMalicious, err = r.env.OnOff("BLOCK_MALICIOUS", params.Default("on"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable BLOCK_MALICIOUS: %w", err)
|
||||
}
|
||||
|
||||
settings.BlacklistBuild.BlockSurveillance, err = r.env.OnOff("BLOCK_SURVEILLANCE", params.Default("on"),
|
||||
params.RetroKeys([]string{"BLOCK_NSA"}, r.onRetroActive))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable BLOCK_SURVEILLANCE (or BLOCK_NSA): %w", err)
|
||||
}
|
||||
|
||||
settings.BlacklistBuild.BlockAds, err = r.env.OnOff("BLOCK_ADS", params.Default("off"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable BLOCK_ADS: %w", err)
|
||||
}
|
||||
|
||||
if err := settings.readPrivateAddresses(r.env); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return settings.readBlacklistUnblockedHostnames(r)
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidPrivateAddress = errors.New("private address is not a valid IP or CIDR range")
|
||||
)
|
||||
|
||||
func (settings *DNS) readPrivateAddresses(env params.Env) (err error) {
|
||||
privateAddresses, err := env.CSV("DOT_PRIVATE_ADDRESS")
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable DOT_PRIVATE_ADDRESS: %w", err)
|
||||
} else if len(privateAddresses) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
ips := make([]netaddr.IP, 0, len(privateAddresses))
|
||||
ipPrefixes := make([]netaddr.IPPrefix, 0, len(privateAddresses))
|
||||
|
||||
for _, address := range privateAddresses {
|
||||
ip, err := netaddr.ParseIP(address)
|
||||
if err == nil {
|
||||
ips = append(ips, ip)
|
||||
continue
|
||||
}
|
||||
|
||||
ipPrefix, err := netaddr.ParseIPPrefix(address)
|
||||
if err == nil {
|
||||
ipPrefixes = append(ipPrefixes, ipPrefix)
|
||||
continue
|
||||
}
|
||||
|
||||
return fmt.Errorf("%w: %s", ErrInvalidPrivateAddress, address)
|
||||
}
|
||||
|
||||
settings.BlacklistBuild.AddBlockedIPs = append(settings.BlacklistBuild.AddBlockedIPs, ips...)
|
||||
settings.BlacklistBuild.AddBlockedIPPrefixes = append(settings.BlacklistBuild.AddBlockedIPPrefixes, ipPrefixes...)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (settings *DNS) readBlacklistUnblockedHostnames(r reader) (err error) {
|
||||
hostnames, err := r.env.CSV("UNBLOCK")
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable UNBLOCK: %w", err)
|
||||
} else if len(hostnames) == 0 {
|
||||
return nil
|
||||
}
|
||||
for _, hostname := range hostnames {
|
||||
if !r.regex.MatchHostname(hostname) {
|
||||
return fmt.Errorf("%w: %s", ErrInvalidHostname, hostname)
|
||||
}
|
||||
}
|
||||
|
||||
settings.BlacklistBuild.AllowedHosts = append(settings.BlacklistBuild.AllowedHosts, hostnames...)
|
||||
return nil
|
||||
}
|
||||
45
internal/configuration/fastestvpn.go
Normal file
45
internal/configuration/fastestvpn.go
Normal file
@@ -0,0 +1,45 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
)
|
||||
|
||||
func (settings *Provider) fastestvpnLines() (lines []string) {
|
||||
if len(settings.ServerSelection.Hostnames) > 0 {
|
||||
lines = append(lines, lastIndent+"Hostnames: "+commaJoin(settings.ServerSelection.Hostnames))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Countries) > 0 {
|
||||
lines = append(lines, lastIndent+"Countries: "+commaJoin(settings.ServerSelection.Countries))
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
func (settings *Provider) readFastestvpn(r reader) (err error) {
|
||||
settings.Name = constants.Fastestvpn
|
||||
|
||||
settings.ServerSelection.TCP, err = readProtocol(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.TargetIP, err = readTargetIP(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.Hostnames, err = r.env.CSVInside("SERVER_HOSTNAME", constants.FastestvpnHostnameChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable SERVER_HOSTNAME: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Countries, err = r.env.CSVInside("COUNTRY", constants.FastestvpnCountriesChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable COUNTRY: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
99
internal/configuration/firewall.go
Normal file
99
internal/configuration/firewall.go
Normal file
@@ -0,0 +1,99 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"strings"
|
||||
|
||||
"github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
// Firewall contains settings to customize the firewall operation.
|
||||
type Firewall struct {
|
||||
VPNInputPorts []uint16
|
||||
InputPorts []uint16
|
||||
OutboundSubnets []net.IPNet
|
||||
Enabled bool
|
||||
Debug bool
|
||||
}
|
||||
|
||||
func (settings *Firewall) String() string {
|
||||
return strings.Join(settings.lines(), "\n")
|
||||
}
|
||||
|
||||
func (settings *Firewall) lines() (lines []string) {
|
||||
if !settings.Enabled {
|
||||
lines = append(lines, lastIndent+"Firewall: disabled ⚠️")
|
||||
return lines
|
||||
}
|
||||
|
||||
lines = append(lines, lastIndent+"Firewall:")
|
||||
|
||||
if settings.Debug {
|
||||
lines = append(lines, indent+lastIndent+"Debug: on")
|
||||
}
|
||||
|
||||
if len(settings.VPNInputPorts) > 0 {
|
||||
lines = append(lines, indent+lastIndent+"VPN input ports: "+
|
||||
strings.Join(uint16sToStrings(settings.VPNInputPorts), ", "))
|
||||
}
|
||||
|
||||
if len(settings.InputPorts) > 0 {
|
||||
lines = append(lines, indent+lastIndent+"Input ports: "+
|
||||
strings.Join(uint16sToStrings(settings.InputPorts), ", "))
|
||||
}
|
||||
|
||||
if len(settings.OutboundSubnets) > 0 {
|
||||
lines = append(lines, indent+lastIndent+"Outbound subnets: "+
|
||||
strings.Join(ipNetsToStrings(settings.OutboundSubnets), ", "))
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
func (settings *Firewall) read(r reader) (err error) {
|
||||
settings.Enabled, err = r.env.OnOff("FIREWALL", params.Default("on"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable FIREWALL: %w", err)
|
||||
}
|
||||
|
||||
settings.Debug, err = r.env.OnOff("FIREWALL_DEBUG", params.Default("off"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable FIREWALL_DEBUG: %w", err)
|
||||
}
|
||||
|
||||
if err := settings.readVPNInputPorts(r.env); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := settings.readInputPorts(r.env); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return settings.readOutboundSubnets(r)
|
||||
}
|
||||
|
||||
func (settings *Firewall) readVPNInputPorts(env params.Env) (err error) {
|
||||
settings.VPNInputPorts, err = readCSVPorts(env, "FIREWALL_VPN_INPUT_PORTS")
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable FIREWALL_VPN_INPUT_PORTS: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (settings *Firewall) readInputPorts(env params.Env) (err error) {
|
||||
settings.InputPorts, err = readCSVPorts(env, "FIREWALL_INPUT_PORTS")
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable FIREWALL_INPUT_PORTS: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (settings *Firewall) readOutboundSubnets(r reader) (err error) {
|
||||
retroOption := params.RetroKeys([]string{"EXTRA_SUBNETS"}, r.onRetroActive)
|
||||
settings.OutboundSubnets, err = readCSVIPNets(r.env, "FIREWALL_OUTBOUND_SUBNETS", retroOption)
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable FIREWALL_OUTBOUND_SUBNETS: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
62
internal/configuration/health.go
Normal file
62
internal/configuration/health.go
Normal file
@@ -0,0 +1,62 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/qdm12/golibs/logging"
|
||||
"github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
// Health contains settings for the healthcheck and health server.
|
||||
type Health struct {
|
||||
ServerAddress string
|
||||
OpenVPN HealthyWait
|
||||
}
|
||||
|
||||
func (settings *Health) String() string {
|
||||
return strings.Join(settings.lines(), "\n")
|
||||
}
|
||||
|
||||
func (settings *Health) lines() (lines []string) {
|
||||
lines = append(lines, lastIndent+"Health:")
|
||||
|
||||
lines = append(lines, indent+lastIndent+"Server address: "+settings.ServerAddress)
|
||||
|
||||
lines = append(lines, indent+lastIndent+"OpenVPN:")
|
||||
for _, line := range settings.OpenVPN.lines() {
|
||||
lines = append(lines, indent+indent+line)
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
// Read is to be used for the healthcheck query mode.
|
||||
func (settings *Health) Read(env params.Env, logger logging.Logger) (err error) {
|
||||
reader := newReader(env, logger)
|
||||
return settings.read(reader)
|
||||
}
|
||||
|
||||
func (settings *Health) read(r reader) (err error) {
|
||||
var warning string
|
||||
settings.ServerAddress, warning, err = r.env.ListeningAddress(
|
||||
"HEALTH_SERVER_ADDRESS", params.Default("127.0.0.1:9999"))
|
||||
if warning != "" {
|
||||
r.logger.Warn("environment variable HEALTH_SERVER_ADDRESS: " + warning)
|
||||
}
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable HEALTH_SERVER_ADDRESS: %w", err)
|
||||
}
|
||||
|
||||
settings.OpenVPN.Initial, err = r.env.Duration("HEALTH_OPENVPN_DURATION_INITIAL", params.Default("6s"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable HEALTH_OPENVPN_DURATION_INITIAL: %w", err)
|
||||
}
|
||||
|
||||
settings.OpenVPN.Addition, err = r.env.Duration("HEALTH_OPENVPN_DURATION_ADDITION", params.Default("5s"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable HEALTH_OPENVPN_DURATION_ADDITION: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
182
internal/configuration/health_test.go
Normal file
182
internal/configuration/health_test.go
Normal file
@@ -0,0 +1,182 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/golang/mock/gomock"
|
||||
"github.com/qdm12/golibs/logging/mock_logging"
|
||||
"github.com/qdm12/golibs/params/mock_params"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func Test_Health_String(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
var health Health
|
||||
const expected = "|--Health:\n |--Server address: \n |--OpenVPN:\n |--Initial duration: 0s"
|
||||
|
||||
s := health.String()
|
||||
|
||||
assert.Equal(t, expected, s)
|
||||
}
|
||||
|
||||
func Test_Health_lines(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
testCases := map[string]struct {
|
||||
settings Health
|
||||
lines []string
|
||||
}{
|
||||
"empty": {
|
||||
lines: []string{
|
||||
"|--Health:",
|
||||
" |--Server address: ",
|
||||
" |--OpenVPN:",
|
||||
" |--Initial duration: 0s",
|
||||
},
|
||||
},
|
||||
"filled settings": {
|
||||
settings: Health{
|
||||
ServerAddress: "address:9999",
|
||||
OpenVPN: HealthyWait{
|
||||
Initial: time.Second,
|
||||
Addition: time.Minute,
|
||||
},
|
||||
},
|
||||
lines: []string{
|
||||
"|--Health:",
|
||||
" |--Server address: address:9999",
|
||||
" |--OpenVPN:",
|
||||
" |--Initial duration: 1s",
|
||||
" |--Addition duration: 1m0s",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for name, testCase := range testCases {
|
||||
testCase := testCase
|
||||
t.Run(name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
lines := testCase.settings.lines()
|
||||
|
||||
assert.Equal(t, testCase.lines, lines)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_Health_read(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
errDummy := errors.New("dummy")
|
||||
|
||||
testCases := map[string]struct {
|
||||
openvpnInitialDuration time.Duration
|
||||
openvpnInitialErr error
|
||||
openvpnAdditionDuration time.Duration
|
||||
openvpnAdditionErr error
|
||||
serverAddress string
|
||||
serverAddressWarning string
|
||||
serverAddressErr error
|
||||
expected Health
|
||||
err error
|
||||
}{
|
||||
"success": {
|
||||
openvpnInitialDuration: time.Second,
|
||||
openvpnAdditionDuration: time.Minute,
|
||||
serverAddress: "127.0.0.1:9999",
|
||||
expected: Health{
|
||||
ServerAddress: "127.0.0.1:9999",
|
||||
OpenVPN: HealthyWait{
|
||||
Initial: time.Second,
|
||||
Addition: time.Minute,
|
||||
},
|
||||
},
|
||||
},
|
||||
"listening address error": {
|
||||
openvpnInitialDuration: time.Second,
|
||||
openvpnAdditionDuration: time.Minute,
|
||||
serverAddress: "127.0.0.1:9999",
|
||||
serverAddressWarning: "warning",
|
||||
serverAddressErr: errDummy,
|
||||
expected: Health{
|
||||
ServerAddress: "127.0.0.1:9999",
|
||||
},
|
||||
err: errors.New("environment variable HEALTH_SERVER_ADDRESS: dummy"),
|
||||
},
|
||||
"initial error": {
|
||||
openvpnInitialDuration: time.Second,
|
||||
openvpnInitialErr: errDummy,
|
||||
openvpnAdditionDuration: time.Minute,
|
||||
expected: Health{
|
||||
OpenVPN: HealthyWait{
|
||||
Initial: time.Second,
|
||||
},
|
||||
},
|
||||
err: errors.New("environment variable HEALTH_OPENVPN_DURATION_INITIAL: dummy"),
|
||||
},
|
||||
"addition error": {
|
||||
openvpnInitialDuration: time.Second,
|
||||
openvpnAdditionDuration: time.Minute,
|
||||
openvpnAdditionErr: errDummy,
|
||||
expected: Health{
|
||||
OpenVPN: HealthyWait{
|
||||
Initial: time.Second,
|
||||
Addition: time.Minute,
|
||||
},
|
||||
},
|
||||
err: errors.New("environment variable HEALTH_OPENVPN_DURATION_ADDITION: dummy"),
|
||||
},
|
||||
}
|
||||
|
||||
for name, testCase := range testCases {
|
||||
testCase := testCase
|
||||
t.Run(name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
ctrl := gomock.NewController(t)
|
||||
|
||||
env := mock_params.NewMockEnv(ctrl)
|
||||
logger := mock_logging.NewMockLogger(ctrl)
|
||||
|
||||
env.EXPECT().ListeningAddress("HEALTH_SERVER_ADDRESS", gomock.Any()).
|
||||
Return(testCase.serverAddress, testCase.serverAddressWarning,
|
||||
testCase.serverAddressErr)
|
||||
if testCase.serverAddressWarning != "" {
|
||||
logger.EXPECT().Warn("environment variable HEALTH_SERVER_ADDRESS: " + testCase.serverAddressWarning)
|
||||
}
|
||||
|
||||
if testCase.serverAddressErr == nil {
|
||||
env.EXPECT().
|
||||
Duration("HEALTH_OPENVPN_DURATION_INITIAL", gomock.Any()).
|
||||
Return(testCase.openvpnInitialDuration, testCase.openvpnInitialErr)
|
||||
if testCase.openvpnInitialErr == nil {
|
||||
env.EXPECT().
|
||||
Duration("HEALTH_OPENVPN_DURATION_ADDITION", gomock.Any()).
|
||||
Return(testCase.openvpnAdditionDuration, testCase.openvpnAdditionErr)
|
||||
}
|
||||
}
|
||||
|
||||
r := reader{
|
||||
env: env,
|
||||
logger: logger,
|
||||
}
|
||||
|
||||
var health Health
|
||||
|
||||
err := health.read(r)
|
||||
|
||||
if testCase.err != nil {
|
||||
require.Error(t, err)
|
||||
assert.Equal(t, testCase.err.Error(), err.Error())
|
||||
} else {
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
assert.Equal(t, testCase.expected, health)
|
||||
})
|
||||
}
|
||||
}
|
||||
55
internal/configuration/healthwait_test.go
Normal file
55
internal/configuration/healthwait_test.go
Normal file
@@ -0,0 +1,55 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func Test_HealthyWait_String(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
var healthyWait HealthyWait
|
||||
const expected = "|--Initial duration: 0s"
|
||||
|
||||
s := healthyWait.String()
|
||||
|
||||
assert.Equal(t, expected, s)
|
||||
}
|
||||
|
||||
func Test_HealthyWait_lines(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
testCases := map[string]struct {
|
||||
settings HealthyWait
|
||||
lines []string
|
||||
}{
|
||||
"empty": {
|
||||
lines: []string{
|
||||
"|--Initial duration: 0s",
|
||||
},
|
||||
},
|
||||
"filled settings": {
|
||||
settings: HealthyWait{
|
||||
Initial: time.Second,
|
||||
Addition: time.Minute,
|
||||
},
|
||||
lines: []string{
|
||||
"|--Initial duration: 1s",
|
||||
"|--Addition duration: 1m0s",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for name, testCase := range testCases {
|
||||
testCase := testCase
|
||||
t.Run(name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
lines := testCase.settings.lines()
|
||||
|
||||
assert.Equal(t, testCase.lines, lines)
|
||||
})
|
||||
}
|
||||
}
|
||||
30
internal/configuration/healthywait.go
Normal file
30
internal/configuration/healthywait.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
type HealthyWait struct {
|
||||
// Initial is the initial duration to wait for the program
|
||||
// to be healthy before taking action.
|
||||
Initial time.Duration
|
||||
// Addition is the duration to add to the Initial duration
|
||||
// after Initial has expired to wait longer for the program
|
||||
// to be healthy.
|
||||
Addition time.Duration
|
||||
}
|
||||
|
||||
func (settings *HealthyWait) String() string {
|
||||
return strings.Join(settings.lines(), "\n")
|
||||
}
|
||||
|
||||
func (settings *HealthyWait) lines() (lines []string) {
|
||||
lines = append(lines, lastIndent+"Initial duration: "+settings.Initial.String())
|
||||
|
||||
if settings.Addition > 0 {
|
||||
lines = append(lines, lastIndent+"Addition duration: "+settings.Addition.String())
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
63
internal/configuration/hidemyass.go
Normal file
63
internal/configuration/hidemyass.go
Normal file
@@ -0,0 +1,63 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
)
|
||||
|
||||
func (settings *Provider) hideMyAssLines() (lines []string) {
|
||||
if len(settings.ServerSelection.Countries) > 0 {
|
||||
lines = append(lines, lastIndent+"Countries: "+commaJoin(settings.ServerSelection.Countries))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Regions) > 0 {
|
||||
lines = append(lines, lastIndent+"Regions: "+commaJoin(settings.ServerSelection.Regions))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Cities) > 0 {
|
||||
lines = append(lines, lastIndent+"Cities: "+commaJoin(settings.ServerSelection.Cities))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Hostnames) > 0 {
|
||||
lines = append(lines, lastIndent+"Hostnames: "+commaJoin(settings.ServerSelection.Hostnames))
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
func (settings *Provider) readHideMyAss(r reader) (err error) {
|
||||
settings.Name = constants.HideMyAss
|
||||
|
||||
settings.ServerSelection.TCP, err = readProtocol(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.TargetIP, err = readTargetIP(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.Countries, err = r.env.CSVInside("COUNTRY", constants.HideMyAssCountryChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable COUNTRY: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Regions, err = r.env.CSVInside("REGION", constants.HideMyAssCountryChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable REGION: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Cities, err = r.env.CSVInside("CITY", constants.HideMyAssCityChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable CITY: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Hostnames, err = r.env.CSVInside("SERVER_HOSTNAME", constants.HideMyAssHostnameChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable SERVER_HOSTNAME: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
106
internal/configuration/httpproxy.go
Normal file
106
internal/configuration/httpproxy.go
Normal file
@@ -0,0 +1,106 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
// HTTPProxy contains settings to configure the HTTP proxy.
|
||||
type HTTPProxy struct {
|
||||
User string
|
||||
Password string
|
||||
Port uint16
|
||||
Enabled bool
|
||||
Stealth bool
|
||||
Log bool
|
||||
}
|
||||
|
||||
func (settings *HTTPProxy) String() string {
|
||||
return strings.Join(settings.lines(), "\n")
|
||||
}
|
||||
|
||||
func (settings *HTTPProxy) lines() (lines []string) {
|
||||
if !settings.Enabled {
|
||||
return nil
|
||||
}
|
||||
|
||||
lines = append(lines, lastIndent+"HTTP proxy:")
|
||||
|
||||
lines = append(lines, indent+lastIndent+"Port: "+strconv.Itoa(int(settings.Port)))
|
||||
|
||||
if settings.User != "" {
|
||||
lines = append(lines, indent+lastIndent+"Authentication: enabled")
|
||||
}
|
||||
|
||||
if settings.Log {
|
||||
lines = append(lines, indent+lastIndent+"Log: enabled")
|
||||
}
|
||||
|
||||
if settings.Stealth {
|
||||
lines = append(lines, indent+lastIndent+"Stealth: enabled")
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
func (settings *HTTPProxy) read(r reader) (err error) {
|
||||
settings.Enabled, err = r.env.OnOff("HTTPPROXY", params.Default("off"),
|
||||
params.RetroKeys([]string{"TINYPROXY", "PROXY"}, r.onRetroActive))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable HTTPPROXY (or TINYPROXY, PROXY): %w", err)
|
||||
}
|
||||
|
||||
settings.User, err = r.getFromEnvOrSecretFile("HTTPPROXY_USER", false, // compulsory
|
||||
[]string{"TINYPROXY_USER", "PROXY_USER"})
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable HTTPPROXY_USER (or TINYPROXY_USER, PROXY_USER): %w", err)
|
||||
}
|
||||
|
||||
settings.Password, err = r.getFromEnvOrSecretFile("HTTPPROXY_PASSWORD", false,
|
||||
[]string{"TINYPROXY_PASSWORD", "PROXY_PASSWORD"})
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable HTTPPROXY_PASSWORD (or TINYPROXY_PASSWORD, PROXY_PASSWORD): %w", err)
|
||||
}
|
||||
|
||||
settings.Stealth, err = r.env.OnOff("HTTPPROXY_STEALTH", params.Default("off"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable HTTPPROXY_STEALTH: %w", err)
|
||||
}
|
||||
|
||||
if err := settings.readLog(r); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var warning string
|
||||
settings.Port, warning, err = r.env.ListeningPort("HTTPPROXY_PORT", params.Default("8888"),
|
||||
params.RetroKeys([]string{"TINYPROXY_PORT", "PROXY_PORT"}, r.onRetroActive))
|
||||
if len(warning) > 0 {
|
||||
r.logger.Warn(warning)
|
||||
}
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable HTTPPROXY_PORT (or TINYPROXY_PORT, PROXY_PORT): %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (settings *HTTPProxy) readLog(r reader) error {
|
||||
s, err := r.env.Get("HTTPPROXY_LOG",
|
||||
params.RetroKeys([]string{"PROXY_LOG_LEVEL", "TINYPROXY_LOG"}, r.onRetroActive))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable HTTPPROXY_LOG (or TINYPROXY_LOG, PROXY_LOG_LEVEL): %w", err)
|
||||
}
|
||||
|
||||
switch strings.ToLower(s) {
|
||||
case "on":
|
||||
settings.Log = true
|
||||
// Retro compatibility
|
||||
case "info", "connect", "notice":
|
||||
settings.Log = true
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
54
internal/configuration/ipvanish.go
Normal file
54
internal/configuration/ipvanish.go
Normal file
@@ -0,0 +1,54 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
)
|
||||
|
||||
func (settings *Provider) ipvanishLines() (lines []string) {
|
||||
if len(settings.ServerSelection.Countries) > 0 {
|
||||
lines = append(lines, lastIndent+"Countries: "+commaJoin(settings.ServerSelection.Countries))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Cities) > 0 {
|
||||
lines = append(lines, lastIndent+"Cities: "+commaJoin(settings.ServerSelection.Cities))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Hostnames) > 0 {
|
||||
lines = append(lines, lastIndent+"Hostnames: "+commaJoin(settings.ServerSelection.Hostnames))
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
func (settings *Provider) readIpvanish(r reader) (err error) {
|
||||
settings.Name = constants.Ipvanish
|
||||
|
||||
settings.ServerSelection.TCP, err = readProtocol(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.TargetIP, err = readTargetIP(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.Countries, err = r.env.CSVInside("COUNTRY", constants.IpvanishCountryChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable COUNTRY: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Cities, err = r.env.CSVInside("CITY", constants.IpvanishCityChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable CITY: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Hostnames, err = r.env.CSVInside("SERVER_HOSTNAME", constants.IpvanishHostnameChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable SERVER_HOSTNAME: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
192
internal/configuration/ipvanish_test.go
Normal file
192
internal/configuration/ipvanish_test.go
Normal file
@@ -0,0 +1,192 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net"
|
||||
"testing"
|
||||
|
||||
"github.com/golang/mock/gomock"
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
"github.com/qdm12/golibs/params/mock_params"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func Test_Provider_ipvanishLines(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
testCases := map[string]struct {
|
||||
settings Provider
|
||||
lines []string
|
||||
}{
|
||||
"empty settings": {},
|
||||
"full settings": {
|
||||
settings: Provider{
|
||||
ServerSelection: ServerSelection{
|
||||
Countries: []string{"A", "B"},
|
||||
Cities: []string{"C", "D"},
|
||||
Hostnames: []string{"E", "F"},
|
||||
},
|
||||
},
|
||||
lines: []string{
|
||||
"|--Countries: A, B",
|
||||
"|--Cities: C, D",
|
||||
"|--Hostnames: E, F",
|
||||
},
|
||||
},
|
||||
}
|
||||
for name, testCase := range testCases {
|
||||
testCase := testCase
|
||||
t.Run(name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
lines := testCase.settings.ipvanishLines()
|
||||
|
||||
assert.Equal(t, testCase.lines, lines)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_Provider_readIpvanish(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
var errDummy = errors.New("dummy test error")
|
||||
|
||||
type singleStringCall struct {
|
||||
call bool
|
||||
value string
|
||||
err error
|
||||
}
|
||||
|
||||
type sliceStringCall struct {
|
||||
call bool
|
||||
values []string
|
||||
err error
|
||||
}
|
||||
|
||||
testCases := map[string]struct {
|
||||
protocol singleStringCall
|
||||
targetIP singleStringCall
|
||||
countries sliceStringCall
|
||||
cities sliceStringCall
|
||||
hostnames sliceStringCall
|
||||
settings Provider
|
||||
err error
|
||||
}{
|
||||
"protocol error": {
|
||||
protocol: singleStringCall{call: true, err: errDummy},
|
||||
settings: Provider{
|
||||
Name: constants.Ipvanish,
|
||||
},
|
||||
err: errors.New("environment variable PROTOCOL: dummy test error"),
|
||||
},
|
||||
"target IP error": {
|
||||
protocol: singleStringCall{call: true},
|
||||
targetIP: singleStringCall{call: true, value: "something", err: errDummy},
|
||||
settings: Provider{
|
||||
Name: constants.Ipvanish,
|
||||
},
|
||||
err: errors.New("environment variable OPENVPN_TARGET_IP: dummy test error"),
|
||||
},
|
||||
"countries error": {
|
||||
protocol: singleStringCall{call: true},
|
||||
targetIP: singleStringCall{call: true},
|
||||
countries: sliceStringCall{call: true, err: errDummy},
|
||||
settings: Provider{
|
||||
Name: constants.Ipvanish,
|
||||
},
|
||||
err: errors.New("environment variable COUNTRY: dummy test error"),
|
||||
},
|
||||
"cities error": {
|
||||
protocol: singleStringCall{call: true},
|
||||
targetIP: singleStringCall{call: true},
|
||||
countries: sliceStringCall{call: true},
|
||||
cities: sliceStringCall{call: true, err: errDummy},
|
||||
settings: Provider{
|
||||
Name: constants.Ipvanish,
|
||||
},
|
||||
err: errors.New("environment variable CITY: dummy test error"),
|
||||
},
|
||||
"hostnames error": {
|
||||
protocol: singleStringCall{call: true},
|
||||
targetIP: singleStringCall{call: true},
|
||||
countries: sliceStringCall{call: true},
|
||||
cities: sliceStringCall{call: true},
|
||||
hostnames: sliceStringCall{call: true, err: errDummy},
|
||||
settings: Provider{
|
||||
Name: constants.Ipvanish,
|
||||
},
|
||||
err: errors.New("environment variable SERVER_HOSTNAME: dummy test error"),
|
||||
},
|
||||
"default settings": {
|
||||
protocol: singleStringCall{call: true},
|
||||
targetIP: singleStringCall{call: true},
|
||||
countries: sliceStringCall{call: true},
|
||||
cities: sliceStringCall{call: true},
|
||||
hostnames: sliceStringCall{call: true},
|
||||
settings: Provider{
|
||||
Name: constants.Ipvanish,
|
||||
},
|
||||
},
|
||||
"set settings": {
|
||||
protocol: singleStringCall{call: true, value: constants.TCP},
|
||||
targetIP: singleStringCall{call: true, value: "1.2.3.4"},
|
||||
countries: sliceStringCall{call: true, values: []string{"A", "B"}},
|
||||
cities: sliceStringCall{call: true, values: []string{"C", "D"}},
|
||||
hostnames: sliceStringCall{call: true, values: []string{"E", "F"}},
|
||||
settings: Provider{
|
||||
Name: constants.Ipvanish,
|
||||
ServerSelection: ServerSelection{
|
||||
TCP: true,
|
||||
TargetIP: net.IPv4(1, 2, 3, 4),
|
||||
Countries: []string{"A", "B"},
|
||||
Cities: []string{"C", "D"},
|
||||
Hostnames: []string{"E", "F"},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
for name, testCase := range testCases {
|
||||
testCase := testCase
|
||||
t.Run(name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctrl := gomock.NewController(t)
|
||||
|
||||
env := mock_params.NewMockEnv(ctrl)
|
||||
if testCase.protocol.call {
|
||||
env.EXPECT().Inside("PROTOCOL", []string{constants.TCP, constants.UDP}, gomock.Any()).
|
||||
Return(testCase.protocol.value, testCase.protocol.err)
|
||||
}
|
||||
if testCase.targetIP.call {
|
||||
env.EXPECT().Get("OPENVPN_TARGET_IP").
|
||||
Return(testCase.targetIP.value, testCase.targetIP.err)
|
||||
}
|
||||
if testCase.countries.call {
|
||||
env.EXPECT().CSVInside("COUNTRY", constants.IpvanishCountryChoices()).
|
||||
Return(testCase.countries.values, testCase.countries.err)
|
||||
}
|
||||
if testCase.cities.call {
|
||||
env.EXPECT().CSVInside("CITY", constants.IpvanishCityChoices()).
|
||||
Return(testCase.cities.values, testCase.cities.err)
|
||||
}
|
||||
if testCase.hostnames.call {
|
||||
env.EXPECT().CSVInside("SERVER_HOSTNAME", constants.IpvanishHostnameChoices()).
|
||||
Return(testCase.hostnames.values, testCase.hostnames.err)
|
||||
}
|
||||
|
||||
r := reader{env: env}
|
||||
|
||||
var settings Provider
|
||||
err := settings.readIpvanish(r)
|
||||
|
||||
if testCase.err != nil {
|
||||
require.Error(t, err)
|
||||
assert.Equal(t, testCase.err.Error(), err.Error())
|
||||
} else {
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
assert.Equal(t, testCase.settings, settings)
|
||||
})
|
||||
}
|
||||
}
|
||||
54
internal/configuration/ivpn.go
Normal file
54
internal/configuration/ivpn.go
Normal file
@@ -0,0 +1,54 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
)
|
||||
|
||||
func (settings *Provider) ivpnLines() (lines []string) {
|
||||
if len(settings.ServerSelection.Countries) > 0 {
|
||||
lines = append(lines, lastIndent+"Countries: "+commaJoin(settings.ServerSelection.Countries))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Cities) > 0 {
|
||||
lines = append(lines, lastIndent+"Cities: "+commaJoin(settings.ServerSelection.Cities))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Hostnames) > 0 {
|
||||
lines = append(lines, lastIndent+"Hostnames: "+commaJoin(settings.ServerSelection.Hostnames))
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
func (settings *Provider) readIvpn(r reader) (err error) {
|
||||
settings.Name = constants.Ivpn
|
||||
|
||||
settings.ServerSelection.TCP, err = readProtocol(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.TargetIP, err = readTargetIP(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.Countries, err = r.env.CSVInside("COUNTRY", constants.IvpnCountryChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable COUNTRY: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Cities, err = r.env.CSVInside("CITY", constants.IvpnCityChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable CITY: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Hostnames, err = r.env.CSVInside("SERVER_HOSTNAME", constants.IvpnHostnameChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable SERVER_HOSTNAME: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
192
internal/configuration/ivpn_test.go
Normal file
192
internal/configuration/ivpn_test.go
Normal file
@@ -0,0 +1,192 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net"
|
||||
"testing"
|
||||
|
||||
"github.com/golang/mock/gomock"
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
"github.com/qdm12/golibs/params/mock_params"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func Test_Provider_ivpnLines(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
testCases := map[string]struct {
|
||||
settings Provider
|
||||
lines []string
|
||||
}{
|
||||
"empty settings": {},
|
||||
"full settings": {
|
||||
settings: Provider{
|
||||
ServerSelection: ServerSelection{
|
||||
Countries: []string{"A", "B"},
|
||||
Cities: []string{"C", "D"},
|
||||
Hostnames: []string{"E", "F"},
|
||||
},
|
||||
},
|
||||
lines: []string{
|
||||
"|--Countries: A, B",
|
||||
"|--Cities: C, D",
|
||||
"|--Hostnames: E, F",
|
||||
},
|
||||
},
|
||||
}
|
||||
for name, testCase := range testCases {
|
||||
testCase := testCase
|
||||
t.Run(name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
lines := testCase.settings.ivpnLines()
|
||||
|
||||
assert.Equal(t, testCase.lines, lines)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_Provider_readIvpn(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
var errDummy = errors.New("dummy test error")
|
||||
|
||||
type singleStringCall struct {
|
||||
call bool
|
||||
value string
|
||||
err error
|
||||
}
|
||||
|
||||
type sliceStringCall struct {
|
||||
call bool
|
||||
values []string
|
||||
err error
|
||||
}
|
||||
|
||||
testCases := map[string]struct {
|
||||
protocol singleStringCall
|
||||
targetIP singleStringCall
|
||||
countries sliceStringCall
|
||||
cities sliceStringCall
|
||||
hostnames sliceStringCall
|
||||
settings Provider
|
||||
err error
|
||||
}{
|
||||
"protocol error": {
|
||||
protocol: singleStringCall{call: true, err: errDummy},
|
||||
settings: Provider{
|
||||
Name: constants.Ivpn,
|
||||
},
|
||||
err: errors.New("environment variable PROTOCOL: dummy test error"),
|
||||
},
|
||||
"target IP error": {
|
||||
protocol: singleStringCall{call: true},
|
||||
targetIP: singleStringCall{call: true, value: "something", err: errDummy},
|
||||
settings: Provider{
|
||||
Name: constants.Ivpn,
|
||||
},
|
||||
err: errors.New("environment variable OPENVPN_TARGET_IP: dummy test error"),
|
||||
},
|
||||
"countries error": {
|
||||
protocol: singleStringCall{call: true},
|
||||
targetIP: singleStringCall{call: true},
|
||||
countries: sliceStringCall{call: true, err: errDummy},
|
||||
settings: Provider{
|
||||
Name: constants.Ivpn,
|
||||
},
|
||||
err: errors.New("environment variable COUNTRY: dummy test error"),
|
||||
},
|
||||
"cities error": {
|
||||
protocol: singleStringCall{call: true},
|
||||
targetIP: singleStringCall{call: true},
|
||||
countries: sliceStringCall{call: true},
|
||||
cities: sliceStringCall{call: true, err: errDummy},
|
||||
settings: Provider{
|
||||
Name: constants.Ivpn,
|
||||
},
|
||||
err: errors.New("environment variable CITY: dummy test error"),
|
||||
},
|
||||
"hostnames error": {
|
||||
protocol: singleStringCall{call: true},
|
||||
targetIP: singleStringCall{call: true},
|
||||
countries: sliceStringCall{call: true},
|
||||
cities: sliceStringCall{call: true},
|
||||
hostnames: sliceStringCall{call: true, err: errDummy},
|
||||
settings: Provider{
|
||||
Name: constants.Ivpn,
|
||||
},
|
||||
err: errors.New("environment variable SERVER_HOSTNAME: dummy test error"),
|
||||
},
|
||||
"default settings": {
|
||||
protocol: singleStringCall{call: true},
|
||||
targetIP: singleStringCall{call: true},
|
||||
countries: sliceStringCall{call: true},
|
||||
cities: sliceStringCall{call: true},
|
||||
hostnames: sliceStringCall{call: true},
|
||||
settings: Provider{
|
||||
Name: constants.Ivpn,
|
||||
},
|
||||
},
|
||||
"set settings": {
|
||||
protocol: singleStringCall{call: true, value: constants.TCP},
|
||||
targetIP: singleStringCall{call: true, value: "1.2.3.4"},
|
||||
countries: sliceStringCall{call: true, values: []string{"A", "B"}},
|
||||
cities: sliceStringCall{call: true, values: []string{"C", "D"}},
|
||||
hostnames: sliceStringCall{call: true, values: []string{"E", "F"}},
|
||||
settings: Provider{
|
||||
Name: constants.Ivpn,
|
||||
ServerSelection: ServerSelection{
|
||||
TCP: true,
|
||||
TargetIP: net.IPv4(1, 2, 3, 4),
|
||||
Countries: []string{"A", "B"},
|
||||
Cities: []string{"C", "D"},
|
||||
Hostnames: []string{"E", "F"},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
for name, testCase := range testCases {
|
||||
testCase := testCase
|
||||
t.Run(name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctrl := gomock.NewController(t)
|
||||
|
||||
env := mock_params.NewMockEnv(ctrl)
|
||||
if testCase.protocol.call {
|
||||
env.EXPECT().Inside("PROTOCOL", []string{constants.TCP, constants.UDP}, gomock.Any()).
|
||||
Return(testCase.protocol.value, testCase.protocol.err)
|
||||
}
|
||||
if testCase.targetIP.call {
|
||||
env.EXPECT().Get("OPENVPN_TARGET_IP").
|
||||
Return(testCase.targetIP.value, testCase.targetIP.err)
|
||||
}
|
||||
if testCase.countries.call {
|
||||
env.EXPECT().CSVInside("COUNTRY", constants.IvpnCountryChoices()).
|
||||
Return(testCase.countries.values, testCase.countries.err)
|
||||
}
|
||||
if testCase.cities.call {
|
||||
env.EXPECT().CSVInside("CITY", constants.IvpnCityChoices()).
|
||||
Return(testCase.cities.values, testCase.cities.err)
|
||||
}
|
||||
if testCase.hostnames.call {
|
||||
env.EXPECT().CSVInside("SERVER_HOSTNAME", constants.IvpnHostnameChoices()).
|
||||
Return(testCase.hostnames.values, testCase.hostnames.err)
|
||||
}
|
||||
|
||||
r := reader{env: env}
|
||||
|
||||
var settings Provider
|
||||
err := settings.readIvpn(r)
|
||||
|
||||
if testCase.err != nil {
|
||||
require.Error(t, err)
|
||||
assert.Equal(t, testCase.err.Error(), err.Error())
|
||||
} else {
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
assert.Equal(t, testCase.settings, settings)
|
||||
})
|
||||
}
|
||||
}
|
||||
55
internal/configuration/keys.go
Normal file
55
internal/configuration/keys.go
Normal file
@@ -0,0 +1,55 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"encoding/pem"
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
)
|
||||
|
||||
func readClientKey(r reader) (clientKey string, err error) {
|
||||
b, err := r.getFromFileOrSecretFile("OPENVPN_CLIENTKEY", constants.ClientKey)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return extractClientKey(b)
|
||||
}
|
||||
|
||||
var errDecodePEMBlockClientKey = errors.New("cannot decode PEM block from client key")
|
||||
|
||||
func extractClientKey(b []byte) (key string, err error) {
|
||||
pemBlock, _ := pem.Decode(b)
|
||||
if pemBlock == nil {
|
||||
return "", errDecodePEMBlockClientKey
|
||||
}
|
||||
parsedBytes := pem.EncodeToMemory(pemBlock)
|
||||
s := string(parsedBytes)
|
||||
s = strings.ReplaceAll(s, "\n", "")
|
||||
s = strings.TrimPrefix(s, "-----BEGIN PRIVATE KEY-----")
|
||||
s = strings.TrimSuffix(s, "-----END PRIVATE KEY-----")
|
||||
return s, nil
|
||||
}
|
||||
|
||||
func readClientCertificate(r reader) (clientCertificate string, err error) {
|
||||
b, err := r.getFromFileOrSecretFile("OPENVPN_CLIENTCRT", constants.ClientCertificate)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return extractClientCertificate(b)
|
||||
}
|
||||
|
||||
var errDecodePEMBlockClientCert = errors.New("cannot decode PEM block from client certificate")
|
||||
|
||||
func extractClientCertificate(b []byte) (certificate string, err error) {
|
||||
pemBlock, _ := pem.Decode(b)
|
||||
if pemBlock == nil {
|
||||
return "", errDecodePEMBlockClientCert
|
||||
}
|
||||
parsedBytes := pem.EncodeToMemory(pemBlock)
|
||||
s := string(parsedBytes)
|
||||
s = strings.ReplaceAll(s, "\n", "")
|
||||
s = strings.TrimPrefix(s, "-----BEGIN CERTIFICATE-----")
|
||||
s = strings.TrimSuffix(s, "-----END CERTIFICATE-----")
|
||||
return s, nil
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package params
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
@@ -71,11 +70,11 @@ zZjrL52saevO25cigVl+hxcnY8DTpbk=
|
||||
err error
|
||||
}{
|
||||
"no input": {
|
||||
err: fmt.Errorf("cannot decode PEM block from client key"),
|
||||
err: errDecodePEMBlockClientKey,
|
||||
},
|
||||
"bad input": {
|
||||
b: []byte{1, 2, 3},
|
||||
err: fmt.Errorf("cannot decode PEM block from client key"),
|
||||
err: errDecodePEMBlockClientKey,
|
||||
},
|
||||
"valid key": {
|
||||
b: []byte(validPEM),
|
||||
@@ -147,11 +146,11 @@ iOCYTbretAFZRhh6ycUN5hBeN8GMQxiMreMtDV4PEIQ=
|
||||
err error
|
||||
}{
|
||||
"no input": {
|
||||
err: fmt.Errorf("cannot decode PEM block from client certificate"),
|
||||
err: errDecodePEMBlockClientCert,
|
||||
},
|
||||
"bad input": {
|
||||
b: []byte{1, 2, 3},
|
||||
err: fmt.Errorf("cannot decode PEM block from client certificate"),
|
||||
err: errDecodePEMBlockClientCert,
|
||||
},
|
||||
"valid key": {
|
||||
b: []byte(validPEM),
|
||||
22
internal/configuration/lines.go
Normal file
22
internal/configuration/lines.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"net"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func uint16sToStrings(uint16s []uint16) (strings []string) {
|
||||
strings = make([]string, len(uint16s))
|
||||
for i := range uint16s {
|
||||
strings[i] = strconv.Itoa(int(uint16s[i]))
|
||||
}
|
||||
return strings
|
||||
}
|
||||
|
||||
func ipNetsToStrings(ipNets []net.IPNet) (strings []string) {
|
||||
strings = make([]string, len(ipNets))
|
||||
for i := range ipNets {
|
||||
strings[i] = ipNets[i].String()
|
||||
}
|
||||
return strings
|
||||
}
|
||||
89
internal/configuration/mullvad.go
Normal file
89
internal/configuration/mullvad.go
Normal file
@@ -0,0 +1,89 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
"github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
func (settings *Provider) mullvadLines() (lines []string) {
|
||||
if len(settings.ServerSelection.Countries) > 0 {
|
||||
lines = append(lines, lastIndent+"Countries: "+commaJoin(settings.ServerSelection.Countries))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Cities) > 0 {
|
||||
lines = append(lines, lastIndent+"Cities: "+commaJoin(settings.ServerSelection.Cities))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Hostnames) > 0 {
|
||||
lines = append(lines, lastIndent+"Hostnames: "+commaJoin(settings.ServerSelection.Hostnames))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.ISPs) > 0 {
|
||||
lines = append(lines, lastIndent+"ISPs: "+commaJoin(settings.ServerSelection.ISPs))
|
||||
}
|
||||
|
||||
if settings.ServerSelection.CustomPort > 0 {
|
||||
lines = append(lines, lastIndent+"Custom port: "+strconv.Itoa(int(settings.ServerSelection.CustomPort)))
|
||||
}
|
||||
|
||||
if settings.ExtraConfigOptions.OpenVPNIPv6 {
|
||||
lines = append(lines, lastIndent+"IPv6: enabled")
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
func (settings *Provider) readMullvad(r reader) (err error) {
|
||||
settings.Name = constants.Mullvad
|
||||
|
||||
settings.ServerSelection.TCP, err = readProtocol(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.TargetIP, err = readTargetIP(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.Countries, err = r.env.CSVInside("COUNTRY", constants.MullvadCountryChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable COUNTRY: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Cities, err = r.env.CSVInside("CITY", constants.MullvadCityChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable CITY: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Hostnames, err = r.env.CSVInside("SERVER_HOSTNAME", constants.MullvadHostnameChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable SERVER_HOSTNAME: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.ISPs, err = r.env.CSVInside("ISP", constants.MullvadISPChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable ISP: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.CustomPort, err = readCustomPort(r.env, settings.ServerSelection.TCP,
|
||||
[]uint16{80, 443, 1401}, []uint16{53, 1194, 1195, 1196, 1197, 1300, 1301, 1302, 1303, 1400})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.Owned, err = r.env.YesNo("OWNED", params.Default("no"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable OWNED: %w", err)
|
||||
}
|
||||
|
||||
settings.ExtraConfigOptions.OpenVPNIPv6, err = r.env.OnOff("OPENVPN_IPV6", params.Default("off"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable OPENVPN_IPV6: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
91
internal/configuration/nordvpn.go
Normal file
91
internal/configuration/nordvpn.go
Normal file
@@ -0,0 +1,91 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
"github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
func (settings *Provider) nordvpnLines() (lines []string) {
|
||||
if len(settings.ServerSelection.Regions) > 0 {
|
||||
lines = append(lines, lastIndent+"Regions: "+commaJoin(settings.ServerSelection.Regions))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Hostnames) > 0 {
|
||||
lines = append(lines, lastIndent+"Hostnames: "+commaJoin(settings.ServerSelection.Hostnames))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Names) > 0 {
|
||||
lines = append(lines, lastIndent+"Names: "+commaJoin(settings.ServerSelection.Hostnames))
|
||||
}
|
||||
|
||||
if numbersUint16 := settings.ServerSelection.Numbers; len(numbersUint16) > 0 {
|
||||
numbersString := make([]string, len(numbersUint16))
|
||||
for i, numberUint16 := range numbersUint16 {
|
||||
numbersString[i] = strconv.Itoa(int(numberUint16))
|
||||
}
|
||||
lines = append(lines, lastIndent+"Numbers: "+commaJoin(numbersString))
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
func (settings *Provider) readNordvpn(r reader) (err error) {
|
||||
settings.Name = constants.Nordvpn
|
||||
|
||||
settings.ServerSelection.TCP, err = readProtocol(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.TargetIP, err = readTargetIP(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.Regions, err = r.env.CSVInside("REGION", constants.NordvpnRegionChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable REGION: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Hostnames, err = r.env.CSVInside("SERVER_HOSTNAME", constants.NordvpnHostnameChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable SERVER_HOSTNAME: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Names, err = r.env.CSVInside("SERVER_NAME", constants.NordvpnHostnameChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable SERVER_NAME: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Numbers, err = readNordVPNServerNumbers(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func readNordVPNServerNumbers(env params.Env) (numbers []uint16, err error) {
|
||||
const possiblePortsCount = 65537
|
||||
possibilities := make([]string, possiblePortsCount)
|
||||
for i := range possibilities {
|
||||
possibilities[i] = fmt.Sprintf("%d", i)
|
||||
}
|
||||
possibilities[65536] = ""
|
||||
values, err := env.CSVInside("SERVER_NUMBER", possibilities)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
numbers = make([]uint16, len(values))
|
||||
for i := range values {
|
||||
n, err := strconv.Atoi(values[i])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
numbers[i] = uint16(n)
|
||||
}
|
||||
return numbers, nil
|
||||
}
|
||||
204
internal/configuration/openvpn.go
Normal file
204
internal/configuration/openvpn.go
Normal file
@@ -0,0 +1,204 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
"github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
// OpenVPN contains settings to configure the OpenVPN client.
|
||||
type OpenVPN struct {
|
||||
User string `json:"user"`
|
||||
Password string `json:"password"`
|
||||
Verbosity int `json:"verbosity"`
|
||||
Flags []string `json:"flags"`
|
||||
MSSFix uint16 `json:"mssfix"`
|
||||
Root bool `json:"run_as_root"`
|
||||
Cipher string `json:"cipher"`
|
||||
Auth string `json:"auth"`
|
||||
Provider Provider `json:"provider"`
|
||||
Config string `json:"custom_config"`
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
func (settings *OpenVPN) String() string {
|
||||
return strings.Join(settings.lines(), "\n")
|
||||
}
|
||||
|
||||
func (settings *OpenVPN) lines() (lines []string) {
|
||||
lines = append(lines, lastIndent+"OpenVPN:")
|
||||
|
||||
lines = append(lines, indent+lastIndent+"Version: "+settings.Version)
|
||||
|
||||
lines = append(lines, indent+lastIndent+"Verbosity level: "+strconv.Itoa(settings.Verbosity))
|
||||
|
||||
if len(settings.Flags) > 0 {
|
||||
lines = append(lines, indent+lastIndent+"Flags: "+strings.Join(settings.Flags, " "))
|
||||
}
|
||||
|
||||
if settings.Root {
|
||||
lines = append(lines, indent+lastIndent+"Run as root: enabled")
|
||||
}
|
||||
|
||||
if len(settings.Cipher) > 0 {
|
||||
lines = append(lines, indent+lastIndent+"Custom cipher: "+settings.Cipher)
|
||||
}
|
||||
if len(settings.Auth) > 0 {
|
||||
lines = append(lines, indent+lastIndent+"Custom auth algorithm: "+settings.Auth)
|
||||
}
|
||||
|
||||
if len(settings.Config) > 0 {
|
||||
lines = append(lines, indent+lastIndent+"Custom configuration: "+settings.Config)
|
||||
}
|
||||
|
||||
if settings.Provider.Name == "" {
|
||||
lines = append(lines, indent+lastIndent+"Provider: custom configuration")
|
||||
} else {
|
||||
lines = append(lines, indent+lastIndent+"Provider:")
|
||||
for _, line := range settings.Provider.lines() {
|
||||
lines = append(lines, indent+indent+line)
|
||||
}
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidVPNProvider = errors.New("invalid VPN provider")
|
||||
)
|
||||
|
||||
func (settings *OpenVPN) read(r reader) (err error) {
|
||||
vpnsp, err := r.env.Inside("VPNSP", []string{
|
||||
"cyberghost", "fastestvpn", "hidemyass", "ipvanish", "ivpn", "mullvad", "nordvpn",
|
||||
"privado", "pia", "private internet access", "privatevpn", "protonvpn",
|
||||
"purevpn", "surfshark", "torguard", constants.VPNUnlimited, "vyprvpn", "windscribe"},
|
||||
params.Default("private internet access"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable VPNSP: %w", err)
|
||||
}
|
||||
if vpnsp == "pia" { // retro compatibility
|
||||
vpnsp = "private internet access"
|
||||
}
|
||||
|
||||
settings.Provider.Name = vpnsp
|
||||
|
||||
settings.Config, err = r.env.Get("OPENVPN_CUSTOM_CONFIG", params.CaseSensitiveValue())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable OPENVPN_CUSTOM_CONFIG: %w", err)
|
||||
}
|
||||
customConfig := settings.Config != ""
|
||||
|
||||
if customConfig {
|
||||
settings.Provider.Name = ""
|
||||
}
|
||||
|
||||
credentialsRequired := !customConfig && settings.Provider.Name != constants.VPNUnlimited
|
||||
|
||||
settings.User, err = r.getFromEnvOrSecretFile("OPENVPN_USER", credentialsRequired, []string{"USER"})
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable OPENVPN_USER: %w", err)
|
||||
}
|
||||
// Remove spaces in user ID to simplify user's life, thanks @JeordyR
|
||||
settings.User = strings.ReplaceAll(settings.User, " ", "")
|
||||
|
||||
if settings.Provider.Name == constants.Mullvad {
|
||||
settings.Password = "m"
|
||||
} else {
|
||||
settings.Password, err = r.getFromEnvOrSecretFile("OPENVPN_PASSWORD", credentialsRequired, []string{"PASSWORD"})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
settings.Version, err = r.env.Inside("OPENVPN_VERSION",
|
||||
[]string{constants.Openvpn24, constants.Openvpn25}, params.Default(constants.Openvpn25))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable OPENVPN_VERSION: %w", err)
|
||||
}
|
||||
|
||||
settings.Verbosity, err = r.env.IntRange("OPENVPN_VERBOSITY", 0, 6, params.Default("1")) //nolint:gomnd
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable OPENVPN_VERBOSITY: %w", err)
|
||||
}
|
||||
|
||||
settings.Flags = []string{}
|
||||
flagsStr, err := r.env.Get("OPENVPN_FLAGS")
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable OPENVPN_FLAGS: %w", err)
|
||||
}
|
||||
if flagsStr != "" {
|
||||
settings.Flags = strings.Fields(flagsStr)
|
||||
}
|
||||
|
||||
settings.Root, err = r.env.YesNo("OPENVPN_ROOT", params.Default("yes"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable OPENVPN_ROOT: %w", err)
|
||||
}
|
||||
|
||||
settings.Cipher, err = r.env.Get("OPENVPN_CIPHER")
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable OPENVPN_CIPHER: %w", err)
|
||||
}
|
||||
|
||||
settings.Auth, err = r.env.Get("OPENVPN_AUTH")
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable OPENVPN_AUTH: %w", err)
|
||||
}
|
||||
|
||||
const maxMSSFix = 10000
|
||||
mssFix, err := r.env.IntRange("OPENVPN_MSSFIX", 0, maxMSSFix, params.Default("0"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable OPENVPN_MSSFIX: %w", err)
|
||||
}
|
||||
settings.MSSFix = uint16(mssFix)
|
||||
return settings.readProvider(r)
|
||||
}
|
||||
|
||||
func (settings *OpenVPN) readProvider(r reader) error {
|
||||
var readProvider func(r reader) error
|
||||
switch settings.Provider.Name {
|
||||
case "": // custom config
|
||||
readProvider = func(r reader) error { return nil }
|
||||
case constants.Cyberghost:
|
||||
readProvider = settings.Provider.readCyberghost
|
||||
case constants.Fastestvpn:
|
||||
readProvider = settings.Provider.readFastestvpn
|
||||
case constants.HideMyAss:
|
||||
readProvider = settings.Provider.readHideMyAss
|
||||
case constants.Ipvanish:
|
||||
readProvider = settings.Provider.readIpvanish
|
||||
case constants.Ivpn:
|
||||
readProvider = settings.Provider.readIvpn
|
||||
case constants.Mullvad:
|
||||
readProvider = settings.Provider.readMullvad
|
||||
case constants.Nordvpn:
|
||||
readProvider = settings.Provider.readNordvpn
|
||||
case constants.Privado:
|
||||
readProvider = settings.Provider.readPrivado
|
||||
case constants.PrivateInternetAccess:
|
||||
readProvider = settings.Provider.readPrivateInternetAccess
|
||||
case constants.Privatevpn:
|
||||
readProvider = settings.Provider.readPrivatevpn
|
||||
case constants.Protonvpn:
|
||||
readProvider = settings.Provider.readProtonvpn
|
||||
case constants.Purevpn:
|
||||
readProvider = settings.Provider.readPurevpn
|
||||
case constants.Surfshark:
|
||||
readProvider = settings.Provider.readSurfshark
|
||||
case constants.Torguard:
|
||||
readProvider = settings.Provider.readTorguard
|
||||
case constants.VPNUnlimited:
|
||||
readProvider = settings.Provider.readVPNUnlimited
|
||||
case constants.Vyprvpn:
|
||||
readProvider = settings.Provider.readVyprvpn
|
||||
case constants.Windscribe:
|
||||
readProvider = settings.Provider.readWindscribe
|
||||
default:
|
||||
return fmt.Errorf("%w: %s", ErrInvalidVPNProvider, settings.Provider.Name)
|
||||
}
|
||||
return readProvider(r)
|
||||
}
|
||||
65
internal/configuration/openvpn_test.go
Normal file
65
internal/configuration/openvpn_test.go
Normal file
@@ -0,0 +1,65 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func Test_OpenVPN_JSON(t *testing.T) {
|
||||
t.Parallel()
|
||||
in := OpenVPN{
|
||||
Root: true,
|
||||
Flags: []string{},
|
||||
Provider: Provider{
|
||||
Name: "name",
|
||||
},
|
||||
}
|
||||
data, err := json.MarshalIndent(in, "", " ")
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, `{
|
||||
"user": "",
|
||||
"password": "",
|
||||
"verbosity": 0,
|
||||
"flags": [],
|
||||
"mssfix": 0,
|
||||
"run_as_root": true,
|
||||
"cipher": "",
|
||||
"auth": "",
|
||||
"provider": {
|
||||
"name": "name",
|
||||
"server_selection": {
|
||||
"tcp": false,
|
||||
"regions": null,
|
||||
"group": "",
|
||||
"countries": null,
|
||||
"cities": null,
|
||||
"hostnames": null,
|
||||
"names": null,
|
||||
"isps": null,
|
||||
"owned": false,
|
||||
"custom_port": 0,
|
||||
"numbers": null,
|
||||
"encryption_preset": "",
|
||||
"free_only": false,
|
||||
"stream_only": false
|
||||
},
|
||||
"extra_config": {
|
||||
"encryption_preset": "",
|
||||
"openvpn_ipv6": false
|
||||
},
|
||||
"port_forwarding": {
|
||||
"enabled": false,
|
||||
"filepath": ""
|
||||
}
|
||||
},
|
||||
"custom_config": "",
|
||||
"version": ""
|
||||
}`, string(data))
|
||||
var out OpenVPN
|
||||
err = json.Unmarshal(data, &out)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, in, out)
|
||||
}
|
||||
63
internal/configuration/privado.go
Normal file
63
internal/configuration/privado.go
Normal file
@@ -0,0 +1,63 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
)
|
||||
|
||||
func (settings *Provider) privadoLines() (lines []string) {
|
||||
if len(settings.ServerSelection.Countries) > 0 {
|
||||
lines = append(lines, lastIndent+"Countries: "+commaJoin(settings.ServerSelection.Countries))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Regions) > 0 {
|
||||
lines = append(lines, lastIndent+"Regions: "+commaJoin(settings.ServerSelection.Regions))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Cities) > 0 {
|
||||
lines = append(lines, lastIndent+"Cities: "+commaJoin(settings.ServerSelection.Cities))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Hostnames) > 0 {
|
||||
lines = append(lines, lastIndent+"Hostnames: "+commaJoin(settings.ServerSelection.Hostnames))
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
func (settings *Provider) readPrivado(r reader) (err error) {
|
||||
settings.Name = constants.Privado
|
||||
|
||||
settings.ServerSelection.TCP, err = readProtocol(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.TargetIP, err = readTargetIP(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.Countries, err = r.env.CSVInside("COUNTRY", constants.PrivadoCountryChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable COUNTRY: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Regions, err = r.env.CSVInside("REGION", constants.PrivadoRegionChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable REGION: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Cities, err = r.env.CSVInside("CITY", constants.PrivadoCityChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable CITY: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Hostnames, err = r.env.CSVInside("SERVER_HOSTNAME", constants.PrivadoHostnameChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable SERVER_HOSTNAME: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
98
internal/configuration/privateinternetaccess.go
Normal file
98
internal/configuration/privateinternetaccess.go
Normal file
@@ -0,0 +1,98 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
"github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
func (settings *Provider) privateinternetaccessLines() (lines []string) {
|
||||
if len(settings.ServerSelection.Regions) > 0 {
|
||||
lines = append(lines, lastIndent+"Regions: "+commaJoin(settings.ServerSelection.Regions))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Hostnames) > 0 {
|
||||
lines = append(lines, lastIndent+"Hostnames: "+commaJoin(settings.ServerSelection.Hostnames))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Names) > 0 {
|
||||
lines = append(lines, lastIndent+"Names: "+commaJoin(settings.ServerSelection.Names))
|
||||
}
|
||||
|
||||
lines = append(lines, lastIndent+"Encryption preset: "+settings.ServerSelection.EncryptionPreset)
|
||||
|
||||
if settings.ServerSelection.CustomPort > 0 {
|
||||
lines = append(lines, lastIndent+"Custom port: "+strconv.Itoa(int(settings.ServerSelection.CustomPort)))
|
||||
}
|
||||
|
||||
if settings.PortForwarding.Enabled {
|
||||
lines = append(lines, lastIndent+"Port forwarding:")
|
||||
for _, line := range settings.PortForwarding.lines() {
|
||||
lines = append(lines, indent+line)
|
||||
}
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
func (settings *Provider) readPrivateInternetAccess(r reader) (err error) {
|
||||
settings.Name = constants.PrivateInternetAccess
|
||||
|
||||
settings.ServerSelection.TCP, err = readProtocol(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.TargetIP, err = readTargetIP(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
encryptionPreset, err := r.env.Inside("PIA_ENCRYPTION",
|
||||
[]string{constants.PIAEncryptionPresetNone, constants.PIAEncryptionPresetNormal, constants.PIAEncryptionPresetStrong},
|
||||
params.RetroKeys([]string{"ENCRYPTION"}, r.onRetroActive),
|
||||
params.Default(constants.PIACertificateStrong),
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable PIA_ENCRYPTION: %w", err)
|
||||
}
|
||||
settings.ServerSelection.EncryptionPreset = encryptionPreset
|
||||
settings.ExtraConfigOptions.EncryptionPreset = encryptionPreset
|
||||
|
||||
settings.ServerSelection.Regions, err = r.env.CSVInside("REGION", constants.PIAGeoChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable REGION: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Hostnames, err = r.env.CSVInside("SERVER_HOSTNAME", constants.PIAHostnameChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable SERVER_HOSTNAME: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Hostnames, err = r.env.CSVInside("SERVER_NAME", constants.PIANameChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable SERVER_NAME: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.CustomPort, err = readPortOrZero(r.env, "PORT")
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable PORT: %w", err)
|
||||
}
|
||||
|
||||
settings.PortForwarding.Enabled, err = r.env.OnOff("PORT_FORWARDING", params.Default("off"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable PORT_FORWARDING: %w", err)
|
||||
}
|
||||
|
||||
if settings.PortForwarding.Enabled {
|
||||
settings.PortForwarding.Filepath, err = r.env.Path("PORT_FORWARDING_STATUS_FILE",
|
||||
params.Default("/tmp/gluetun/forwarded_port"), params.CaseSensitiveValue())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable PORT_FORWARDING_STATUS_FILE: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
54
internal/configuration/privatevpn.go
Normal file
54
internal/configuration/privatevpn.go
Normal file
@@ -0,0 +1,54 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
)
|
||||
|
||||
func (settings *Provider) privatevpnLines() (lines []string) {
|
||||
if len(settings.ServerSelection.Countries) > 0 {
|
||||
lines = append(lines, lastIndent+"Countries: "+commaJoin(settings.ServerSelection.Countries))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Cities) > 0 {
|
||||
lines = append(lines, lastIndent+"Cities: "+commaJoin(settings.ServerSelection.Cities))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Hostnames) > 0 {
|
||||
lines = append(lines, lastIndent+"Hostnames: "+commaJoin(settings.ServerSelection.Hostnames))
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
func (settings *Provider) readPrivatevpn(r reader) (err error) {
|
||||
settings.Name = constants.Privatevpn
|
||||
|
||||
settings.ServerSelection.TCP, err = readProtocol(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.TargetIP, err = readTargetIP(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.Countries, err = r.env.CSVInside("COUNTRY", constants.PrivatevpnCountryChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable COUNTRY: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Cities, err = r.env.CSVInside("CITY", constants.PrivatevpnCityChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable CITY: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Hostnames, err = r.env.CSVInside("SERVER_HOSTNAME", constants.PrivatevpnHostnameChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable SERVER_HOSTNAME: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
87
internal/configuration/protonvpn.go
Normal file
87
internal/configuration/protonvpn.go
Normal file
@@ -0,0 +1,87 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
"github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
func (settings *Provider) protonvpnLines() (lines []string) {
|
||||
if len(settings.ServerSelection.Countries) > 0 {
|
||||
lines = append(lines, lastIndent+"Countries: "+commaJoin(settings.ServerSelection.Countries))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Regions) > 0 {
|
||||
lines = append(lines, lastIndent+"Regions: "+commaJoin(settings.ServerSelection.Regions))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Cities) > 0 {
|
||||
lines = append(lines, lastIndent+"Cities: "+commaJoin(settings.ServerSelection.Cities))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Names) > 0 {
|
||||
lines = append(lines, lastIndent+"Names: "+commaJoin(settings.ServerSelection.Names))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Hostnames) > 0 {
|
||||
lines = append(lines, lastIndent+"Hostnames: "+commaJoin(settings.ServerSelection.Hostnames))
|
||||
}
|
||||
|
||||
if settings.ServerSelection.FreeOnly {
|
||||
lines = append(lines, lastIndent+"Free only: yes")
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
func (settings *Provider) readProtonvpn(r reader) (err error) {
|
||||
settings.Name = constants.Protonvpn
|
||||
|
||||
settings.ServerSelection.TCP, err = readProtocol(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.TargetIP, err = readTargetIP(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.CustomPort, err = readPortOrZero(r.env, "PORT")
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable PORT: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Countries, err = r.env.CSVInside("COUNTRY", constants.ProtonvpnCountryChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable COUNTRY: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Regions, err = r.env.CSVInside("REGION", constants.ProtonvpnRegionChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable REGION: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Cities, err = r.env.CSVInside("CITY", constants.ProtonvpnCityChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable CITY: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Names, err = r.env.CSVInside("SERVER_NAME", constants.ProtonvpnNameChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable SERVER_NAME: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Hostnames, err = r.env.CSVInside("SERVER_HOSTNAME", constants.ProtonvpnHostnameChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable SERVER_HOSTNAME: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.FreeOnly, err = r.env.YesNo("FREE_ONLY", params.Default("no"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable FREE_ONLY: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
129
internal/configuration/provider.go
Normal file
129
internal/configuration/provider.go
Normal file
@@ -0,0 +1,129 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"strings"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
"github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
// Provider contains settings specific to a VPN provider.
|
||||
type Provider struct {
|
||||
Name string `json:"name"`
|
||||
ServerSelection ServerSelection `json:"server_selection"`
|
||||
ExtraConfigOptions ExtraConfigOptions `json:"extra_config"`
|
||||
PortForwarding PortForwarding `json:"port_forwarding"`
|
||||
}
|
||||
|
||||
func (settings *Provider) lines() (lines []string) {
|
||||
lines = append(lines, lastIndent+strings.Title(settings.Name)+" settings:")
|
||||
|
||||
selection := settings.ServerSelection
|
||||
|
||||
lines = append(lines, indent+lastIndent+"Network protocol: "+protoToString(selection.TCP))
|
||||
|
||||
if selection.TargetIP != nil {
|
||||
lines = append(lines, indent+lastIndent+"Target IP address: "+selection.TargetIP.String())
|
||||
}
|
||||
|
||||
var providerLines []string
|
||||
switch strings.ToLower(settings.Name) {
|
||||
case "cyberghost":
|
||||
providerLines = settings.cyberghostLines()
|
||||
case "fastestvpn":
|
||||
providerLines = settings.fastestvpnLines()
|
||||
case "hidemyass":
|
||||
providerLines = settings.hideMyAssLines()
|
||||
case "ipvanish":
|
||||
providerLines = settings.ipvanishLines()
|
||||
case "ivpn":
|
||||
providerLines = settings.ivpnLines()
|
||||
case "mullvad":
|
||||
providerLines = settings.mullvadLines()
|
||||
case "nordvpn":
|
||||
providerLines = settings.nordvpnLines()
|
||||
case "privado":
|
||||
providerLines = settings.privadoLines()
|
||||
case "privatevpn":
|
||||
providerLines = settings.privatevpnLines()
|
||||
case "private internet access":
|
||||
providerLines = settings.privateinternetaccessLines()
|
||||
case "protonvpn":
|
||||
providerLines = settings.protonvpnLines()
|
||||
case "purevpn":
|
||||
providerLines = settings.purevpnLines()
|
||||
case "surfshark":
|
||||
providerLines = settings.surfsharkLines()
|
||||
case "torguard":
|
||||
providerLines = settings.torguardLines()
|
||||
case strings.ToLower(constants.VPNUnlimited):
|
||||
providerLines = settings.vpnUnlimitedLines()
|
||||
case "vyprvpn":
|
||||
providerLines = settings.vyprvpnLines()
|
||||
case "windscribe":
|
||||
providerLines = settings.windscribeLines()
|
||||
default:
|
||||
panic(`Missing lines method for provider "` +
|
||||
settings.Name + `"! Please create a Github issue.`)
|
||||
}
|
||||
|
||||
for _, line := range providerLines {
|
||||
lines = append(lines, indent+line)
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
func commaJoin(slice []string) string {
|
||||
return strings.Join(slice, ", ")
|
||||
}
|
||||
|
||||
func readProtocol(env params.Env) (tcp bool, err error) {
|
||||
protocol, err := env.Inside("PROTOCOL", []string{constants.TCP, constants.UDP}, params.Default(constants.UDP))
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("environment variable PROTOCOL: %w", err)
|
||||
}
|
||||
return protocol == constants.TCP, nil
|
||||
}
|
||||
|
||||
func protoToString(tcp bool) string {
|
||||
if tcp {
|
||||
return constants.TCP
|
||||
}
|
||||
return constants.UDP
|
||||
}
|
||||
|
||||
func readTargetIP(env params.Env) (targetIP net.IP, err error) {
|
||||
targetIP, err = readIP(env, "OPENVPN_TARGET_IP")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("environment variable OPENVPN_TARGET_IP: %w", err)
|
||||
}
|
||||
return targetIP, nil
|
||||
}
|
||||
|
||||
func readCustomPort(env params.Env, tcp bool,
|
||||
allowedTCP, allowedUDP []uint16) (port uint16, err error) {
|
||||
port, err = readPortOrZero(env, "PORT")
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("environment variable PORT: %w", err)
|
||||
} else if port == 0 {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
if tcp {
|
||||
for i := range allowedTCP {
|
||||
if allowedTCP[i] == port {
|
||||
return port, nil
|
||||
}
|
||||
}
|
||||
return 0, fmt.Errorf("environment variable PORT: %w: port %d for TCP protocol", ErrInvalidPort, port)
|
||||
}
|
||||
for i := range allowedUDP {
|
||||
if allowedUDP[i] == port {
|
||||
return port, nil
|
||||
}
|
||||
}
|
||||
return 0, fmt.Errorf("environment variable PORT: %w: port %d for UDP protocol", ErrInvalidPort, port)
|
||||
}
|
||||
382
internal/configuration/provider_test.go
Normal file
382
internal/configuration/provider_test.go
Normal file
@@ -0,0 +1,382 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"github.com/golang/mock/gomock"
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
"github.com/qdm12/golibs/params/mock_params"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
var errDummy = errors.New("dummy")
|
||||
|
||||
func Test_Provider_lines(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
testCases := map[string]struct {
|
||||
settings Provider
|
||||
lines []string
|
||||
}{
|
||||
"cyberghost": {
|
||||
settings: Provider{
|
||||
Name: constants.Cyberghost,
|
||||
ServerSelection: ServerSelection{
|
||||
Group: "group",
|
||||
Regions: []string{"a", "El country"},
|
||||
},
|
||||
ExtraConfigOptions: ExtraConfigOptions{
|
||||
ClientKey: "a",
|
||||
ClientCertificate: "a",
|
||||
},
|
||||
},
|
||||
lines: []string{
|
||||
"|--Cyberghost settings:",
|
||||
" |--Network protocol: udp",
|
||||
" |--Server group: group",
|
||||
" |--Regions: a, El country",
|
||||
" |--Client key is set",
|
||||
" |--Client certificate is set",
|
||||
},
|
||||
},
|
||||
"fastestvpn": {
|
||||
settings: Provider{
|
||||
Name: constants.Fastestvpn,
|
||||
ServerSelection: ServerSelection{
|
||||
Hostnames: []string{"a", "b"},
|
||||
Countries: []string{"c", "d"},
|
||||
},
|
||||
},
|
||||
lines: []string{
|
||||
"|--Fastestvpn settings:",
|
||||
" |--Network protocol: udp",
|
||||
" |--Hostnames: a, b",
|
||||
" |--Countries: c, d",
|
||||
},
|
||||
},
|
||||
"hidemyass": {
|
||||
settings: Provider{
|
||||
Name: constants.HideMyAss,
|
||||
ServerSelection: ServerSelection{
|
||||
Countries: []string{"a", "b"},
|
||||
Cities: []string{"c", "d"},
|
||||
Hostnames: []string{"e", "f"},
|
||||
},
|
||||
},
|
||||
lines: []string{
|
||||
"|--Hidemyass settings:",
|
||||
" |--Network protocol: udp",
|
||||
" |--Countries: a, b",
|
||||
" |--Cities: c, d",
|
||||
" |--Hostnames: e, f",
|
||||
},
|
||||
},
|
||||
"ipvanish": {
|
||||
settings: Provider{
|
||||
Name: constants.Ipvanish,
|
||||
ServerSelection: ServerSelection{
|
||||
Countries: []string{"a", "b"},
|
||||
Cities: []string{"c", "d"},
|
||||
Hostnames: []string{"e", "f"},
|
||||
},
|
||||
},
|
||||
lines: []string{
|
||||
"|--Ipvanish settings:",
|
||||
" |--Network protocol: udp",
|
||||
" |--Countries: a, b",
|
||||
" |--Cities: c, d",
|
||||
" |--Hostnames: e, f",
|
||||
},
|
||||
},
|
||||
"ivpn": {
|
||||
settings: Provider{
|
||||
Name: constants.Ivpn,
|
||||
ServerSelection: ServerSelection{
|
||||
Countries: []string{"a", "b"},
|
||||
Cities: []string{"c", "d"},
|
||||
Hostnames: []string{"e", "f"},
|
||||
},
|
||||
},
|
||||
lines: []string{
|
||||
"|--Ivpn settings:",
|
||||
" |--Network protocol: udp",
|
||||
" |--Countries: a, b",
|
||||
" |--Cities: c, d",
|
||||
" |--Hostnames: e, f",
|
||||
},
|
||||
},
|
||||
"mullvad": {
|
||||
settings: Provider{
|
||||
Name: constants.Mullvad,
|
||||
ServerSelection: ServerSelection{
|
||||
Countries: []string{"a", "b"},
|
||||
Cities: []string{"c", "d"},
|
||||
ISPs: []string{"e", "f"},
|
||||
CustomPort: 1,
|
||||
},
|
||||
ExtraConfigOptions: ExtraConfigOptions{
|
||||
OpenVPNIPv6: true,
|
||||
},
|
||||
},
|
||||
lines: []string{
|
||||
"|--Mullvad settings:",
|
||||
" |--Network protocol: udp",
|
||||
" |--Countries: a, b",
|
||||
" |--Cities: c, d",
|
||||
" |--ISPs: e, f",
|
||||
" |--Custom port: 1",
|
||||
" |--IPv6: enabled",
|
||||
},
|
||||
},
|
||||
"nordvpn": {
|
||||
settings: Provider{
|
||||
Name: constants.Nordvpn,
|
||||
ServerSelection: ServerSelection{
|
||||
Regions: []string{"a", "b"},
|
||||
Numbers: []uint16{1, 2},
|
||||
},
|
||||
},
|
||||
lines: []string{
|
||||
"|--Nordvpn settings:",
|
||||
" |--Network protocol: udp",
|
||||
" |--Regions: a, b",
|
||||
" |--Numbers: 1, 2",
|
||||
},
|
||||
},
|
||||
"privado": {
|
||||
settings: Provider{
|
||||
Name: constants.Privado,
|
||||
ServerSelection: ServerSelection{
|
||||
Hostnames: []string{"a", "b"},
|
||||
},
|
||||
},
|
||||
lines: []string{
|
||||
"|--Privado settings:",
|
||||
" |--Network protocol: udp",
|
||||
" |--Hostnames: a, b",
|
||||
},
|
||||
},
|
||||
"privatevpn": {
|
||||
settings: Provider{
|
||||
Name: constants.Privatevpn,
|
||||
ServerSelection: ServerSelection{
|
||||
Hostnames: []string{"a", "b"},
|
||||
Countries: []string{"c", "d"},
|
||||
Cities: []string{"e", "f"},
|
||||
},
|
||||
},
|
||||
lines: []string{
|
||||
"|--Privatevpn settings:",
|
||||
" |--Network protocol: udp",
|
||||
" |--Countries: c, d",
|
||||
" |--Cities: e, f",
|
||||
" |--Hostnames: a, b",
|
||||
},
|
||||
},
|
||||
"protonvpn": {
|
||||
settings: Provider{
|
||||
Name: constants.Protonvpn,
|
||||
ServerSelection: ServerSelection{
|
||||
Countries: []string{"a", "b"},
|
||||
Regions: []string{"c", "d"},
|
||||
Cities: []string{"e", "f"},
|
||||
Names: []string{"g", "h"},
|
||||
Hostnames: []string{"i", "j"},
|
||||
},
|
||||
},
|
||||
lines: []string{
|
||||
"|--Protonvpn settings:",
|
||||
" |--Network protocol: udp",
|
||||
" |--Countries: a, b",
|
||||
" |--Regions: c, d",
|
||||
" |--Cities: e, f",
|
||||
" |--Names: g, h",
|
||||
" |--Hostnames: i, j",
|
||||
},
|
||||
},
|
||||
"private internet access": {
|
||||
settings: Provider{
|
||||
Name: constants.PrivateInternetAccess,
|
||||
ServerSelection: ServerSelection{
|
||||
Regions: []string{"a", "b"},
|
||||
EncryptionPreset: constants.PIAEncryptionPresetStrong,
|
||||
CustomPort: 1,
|
||||
},
|
||||
PortForwarding: PortForwarding{
|
||||
Enabled: true,
|
||||
Filepath: string("/here"),
|
||||
},
|
||||
},
|
||||
lines: []string{
|
||||
"|--Private Internet Access settings:",
|
||||
" |--Network protocol: udp",
|
||||
" |--Regions: a, b",
|
||||
" |--Encryption preset: strong",
|
||||
" |--Custom port: 1",
|
||||
" |--Port forwarding:",
|
||||
" |--File path: /here",
|
||||
},
|
||||
},
|
||||
"purevpn": {
|
||||
settings: Provider{
|
||||
Name: constants.Purevpn,
|
||||
ServerSelection: ServerSelection{
|
||||
Regions: []string{"a", "b"},
|
||||
Countries: []string{"c", "d"},
|
||||
Cities: []string{"e", "f"},
|
||||
},
|
||||
},
|
||||
lines: []string{
|
||||
"|--Purevpn settings:",
|
||||
" |--Network protocol: udp",
|
||||
" |--Regions: a, b",
|
||||
" |--Countries: c, d",
|
||||
" |--Cities: e, f",
|
||||
},
|
||||
},
|
||||
"surfshark": {
|
||||
settings: Provider{
|
||||
Name: constants.Surfshark,
|
||||
ServerSelection: ServerSelection{
|
||||
Regions: []string{"a", "b"},
|
||||
},
|
||||
},
|
||||
lines: []string{
|
||||
"|--Surfshark settings:",
|
||||
" |--Network protocol: udp",
|
||||
" |--Regions: a, b",
|
||||
},
|
||||
},
|
||||
"torguard": {
|
||||
settings: Provider{
|
||||
Name: constants.Torguard,
|
||||
ServerSelection: ServerSelection{
|
||||
Countries: []string{"a", "b"},
|
||||
Cities: []string{"c", "d"},
|
||||
Hostnames: []string{"e"},
|
||||
},
|
||||
},
|
||||
lines: []string{
|
||||
"|--Torguard settings:",
|
||||
" |--Network protocol: udp",
|
||||
" |--Countries: a, b",
|
||||
" |--Cities: c, d",
|
||||
" |--Hostnames: e",
|
||||
},
|
||||
},
|
||||
constants.VPNUnlimited: {
|
||||
settings: Provider{
|
||||
Name: constants.VPNUnlimited,
|
||||
ServerSelection: ServerSelection{
|
||||
Countries: []string{"a", "b"},
|
||||
Cities: []string{"c", "d"},
|
||||
Hostnames: []string{"e", "f"},
|
||||
FreeOnly: true,
|
||||
StreamOnly: true,
|
||||
},
|
||||
ExtraConfigOptions: ExtraConfigOptions{
|
||||
ClientKey: "a",
|
||||
},
|
||||
},
|
||||
lines: []string{
|
||||
"|--Vpn Unlimited settings:",
|
||||
" |--Network protocol: udp",
|
||||
" |--Countries: a, b",
|
||||
" |--Cities: c, d",
|
||||
" |--Hostnames: e, f",
|
||||
" |--Free servers only",
|
||||
" |--Stream servers only",
|
||||
" |--Client key is set",
|
||||
},
|
||||
},
|
||||
"vyprvpn": {
|
||||
settings: Provider{
|
||||
Name: constants.Vyprvpn,
|
||||
ServerSelection: ServerSelection{
|
||||
Regions: []string{"a", "b"},
|
||||
},
|
||||
},
|
||||
lines: []string{
|
||||
"|--Vyprvpn settings:",
|
||||
" |--Network protocol: udp",
|
||||
" |--Regions: a, b",
|
||||
},
|
||||
},
|
||||
"windscribe": {
|
||||
settings: Provider{
|
||||
Name: constants.Windscribe,
|
||||
ServerSelection: ServerSelection{
|
||||
Regions: []string{"a", "b"},
|
||||
Cities: []string{"c", "d"},
|
||||
Hostnames: []string{"e", "f"},
|
||||
CustomPort: 1,
|
||||
},
|
||||
},
|
||||
lines: []string{
|
||||
"|--Windscribe settings:",
|
||||
" |--Network protocol: udp",
|
||||
" |--Regions: a, b",
|
||||
" |--Cities: c, d",
|
||||
" |--Hostnames: e, f",
|
||||
" |--Custom port: 1",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for name, testCase := range testCases {
|
||||
testCase := testCase
|
||||
t.Run(name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
lines := testCase.settings.lines()
|
||||
|
||||
assert.Equal(t, testCase.lines, lines)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_readProtocol(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
testCases := map[string]struct {
|
||||
mockStr string
|
||||
mockErr error
|
||||
tcp bool
|
||||
err error
|
||||
}{
|
||||
"error": {
|
||||
mockErr: errDummy,
|
||||
err: errors.New("environment variable PROTOCOL: dummy"),
|
||||
},
|
||||
"success": {
|
||||
mockStr: "tcp",
|
||||
tcp: true,
|
||||
},
|
||||
}
|
||||
|
||||
for name, testCase := range testCases {
|
||||
testCase := testCase
|
||||
t.Run(name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctrl := gomock.NewController(t)
|
||||
|
||||
env := mock_params.NewMockEnv(ctrl)
|
||||
env.EXPECT().
|
||||
Inside("PROTOCOL", []string{"tcp", "udp"}, gomock.Any()).
|
||||
Return(testCase.mockStr, testCase.mockErr)
|
||||
|
||||
tcp, err := readProtocol(env)
|
||||
|
||||
if testCase.err != nil {
|
||||
require.Error(t, err)
|
||||
assert.Equal(t, testCase.err.Error(), err.Error())
|
||||
} else {
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
assert.Equal(t, testCase.tcp, tcp)
|
||||
})
|
||||
}
|
||||
}
|
||||
47
internal/configuration/publicip.go
Normal file
47
internal/configuration/publicip.go
Normal file
@@ -0,0 +1,47 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
type PublicIP struct {
|
||||
Period time.Duration `json:"period"`
|
||||
IPFilepath string `json:"ip_filepath"`
|
||||
}
|
||||
|
||||
func (settings *PublicIP) String() string {
|
||||
return strings.Join(settings.lines(), "\n")
|
||||
}
|
||||
|
||||
func (settings *PublicIP) lines() (lines []string) {
|
||||
if settings.Period == 0 {
|
||||
lines = append(lines, lastIndent+"Public IP getter: disabled")
|
||||
return lines
|
||||
}
|
||||
|
||||
lines = append(lines, lastIndent+"Public IP getter:")
|
||||
lines = append(lines, indent+lastIndent+"Fetch period: "+settings.Period.String())
|
||||
lines = append(lines, indent+lastIndent+"IP file: "+settings.IPFilepath)
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
func (settings *PublicIP) read(r reader) (err error) {
|
||||
settings.Period, err = r.env.Duration("PUBLICIP_PERIOD", params.Default("12h"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable PUBLICIP_PERIOD: %w", err)
|
||||
}
|
||||
|
||||
settings.IPFilepath, err = r.env.Path("PUBLICIP_FILE", params.CaseSensitiveValue(),
|
||||
params.Default("/tmp/gluetun/ip"),
|
||||
params.RetroKeys([]string{"IP_STATUS_FILE"}, r.onRetroActive))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable PUBLICIP_FILE (or IP_STATUS_FILE): %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
63
internal/configuration/purevpn.go
Normal file
63
internal/configuration/purevpn.go
Normal file
@@ -0,0 +1,63 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
)
|
||||
|
||||
func (settings *Provider) purevpnLines() (lines []string) {
|
||||
if len(settings.ServerSelection.Regions) > 0 {
|
||||
lines = append(lines, lastIndent+"Regions: "+commaJoin(settings.ServerSelection.Regions))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Countries) > 0 {
|
||||
lines = append(lines, lastIndent+"Countries: "+commaJoin(settings.ServerSelection.Countries))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Cities) > 0 {
|
||||
lines = append(lines, lastIndent+"Cities: "+commaJoin(settings.ServerSelection.Cities))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Hostnames) > 0 {
|
||||
lines = append(lines, lastIndent+"Hostnames: "+commaJoin(settings.ServerSelection.Hostnames))
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
func (settings *Provider) readPurevpn(r reader) (err error) {
|
||||
settings.Name = constants.Purevpn
|
||||
|
||||
settings.ServerSelection.TCP, err = readProtocol(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.TargetIP, err = readTargetIP(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.Regions, err = r.env.CSVInside("REGION", constants.PurevpnRegionChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable REGION: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Countries, err = r.env.CSVInside("COUNTRY", constants.PurevpnCountryChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable COUNTRY: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Cities, err = r.env.CSVInside("CITY", constants.PurevpnCityChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable CITY: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Hostnames, err = r.env.CSVInside("SERVER_HOSTNAME", constants.PurevpnHostnameChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable SERVER_HOSTNAME: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
122
internal/configuration/reader.go
Normal file
122
internal/configuration/reader.go
Normal file
@@ -0,0 +1,122 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/qdm12/golibs/logging"
|
||||
"github.com/qdm12/golibs/params"
|
||||
"github.com/qdm12/golibs/verification"
|
||||
)
|
||||
|
||||
type reader struct {
|
||||
env params.Env
|
||||
logger logging.Logger
|
||||
regex verification.Regex
|
||||
}
|
||||
|
||||
func newReader(env params.Env, logger logging.Logger) reader {
|
||||
return reader{
|
||||
env: env,
|
||||
logger: logger,
|
||||
regex: verification.NewRegex(),
|
||||
}
|
||||
}
|
||||
|
||||
func (r *reader) onRetroActive(oldKey, newKey string) {
|
||||
r.logger.Warn(
|
||||
"You are using the old environment variable " + oldKey +
|
||||
", please consider changing it to " + newKey)
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidPort = errors.New("invalid port")
|
||||
)
|
||||
|
||||
func readCSVPorts(env params.Env, key string) (ports []uint16, err error) {
|
||||
s, err := env.Get(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if s == "" {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
portsStr := strings.Split(s, ",")
|
||||
ports = make([]uint16, len(portsStr))
|
||||
for i, portStr := range portsStr {
|
||||
portInt, err := strconv.Atoi(portStr)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%w: %s: %s", ErrInvalidPort, portStr, err)
|
||||
} else if portInt <= 0 || portInt > 65535 {
|
||||
return nil, fmt.Errorf("%w: %d: must be between 1 and 65535", ErrInvalidPort, portInt)
|
||||
}
|
||||
ports[i] = uint16(portInt)
|
||||
}
|
||||
|
||||
return ports, nil
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidIPNet = errors.New("invalid IP network")
|
||||
)
|
||||
|
||||
func readCSVIPNets(env params.Env, key string, options ...params.OptionSetter) (
|
||||
ipNets []net.IPNet, err error) {
|
||||
s, err := env.Get(key, options...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if s == "" {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
ipNetsStr := strings.Split(s, ",")
|
||||
ipNets = make([]net.IPNet, len(ipNetsStr))
|
||||
for i, ipNetStr := range ipNetsStr {
|
||||
_, ipNet, err := net.ParseCIDR(ipNetStr)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%w: %s: %s",
|
||||
ErrInvalidIPNet, ipNetStr, err)
|
||||
} else if ipNet == nil {
|
||||
return nil, fmt.Errorf("%w: %s: subnet is nil", ErrInvalidIPNet, ipNetStr)
|
||||
}
|
||||
ipNets[i] = *ipNet
|
||||
}
|
||||
|
||||
return ipNets, nil
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidIP = errors.New("invalid IP address")
|
||||
)
|
||||
|
||||
func readIP(env params.Env, key string) (ip net.IP, err error) {
|
||||
s, err := env.Get(key)
|
||||
if s == "" {
|
||||
return nil, nil
|
||||
} else if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ip = net.ParseIP(s)
|
||||
if ip == nil {
|
||||
return nil, fmt.Errorf("%w: %s", ErrInvalidIP, s)
|
||||
}
|
||||
|
||||
return ip, nil
|
||||
}
|
||||
|
||||
func readPortOrZero(env params.Env, key string) (port uint16, err error) {
|
||||
s, err := env.Get(key)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
if s == "" || s == "0" {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
return env.Port(key)
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
package params
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/qdm12/golibs/os"
|
||||
libparams "github.com/qdm12/golibs/params"
|
||||
"github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -18,28 +18,37 @@ var (
|
||||
ErrFilesDoNotExist = errors.New("files do not exist")
|
||||
)
|
||||
|
||||
func cleanSuffix(value string) string {
|
||||
value = strings.TrimSuffix(value, "\n")
|
||||
value = strings.TrimSuffix(value, "\r")
|
||||
return value
|
||||
}
|
||||
|
||||
func (r *reader) getFromEnvOrSecretFile(envKey string, compulsory bool, retroKeys []string) (value string, err error) {
|
||||
envOptions := []libparams.OptionSetter{
|
||||
libparams.Compulsory(), // to fallback on file reading
|
||||
libparams.CaseSensitiveValue(),
|
||||
libparams.Unset(),
|
||||
libparams.RetroKeys(retroKeys, r.onRetroActive),
|
||||
envOptions := []params.OptionSetter{
|
||||
params.Compulsory(), // to fallback on file reading
|
||||
params.CaseSensitiveValue(),
|
||||
params.Unset(),
|
||||
params.RetroKeys(retroKeys, r.onRetroActive),
|
||||
}
|
||||
value, envErr := r.env.Get(envKey, envOptions...)
|
||||
if envErr == nil {
|
||||
value = cleanSuffix(value)
|
||||
return value, nil
|
||||
}
|
||||
|
||||
secretFilepathEnvKey := envKey + "_SECRETFILE"
|
||||
defaultSecretFile := "/run/secrets/" + strings.ToLower(envKey)
|
||||
filepath, err := r.env.Get(envKey+"_SECRETFILE",
|
||||
libparams.CaseSensitiveValue(),
|
||||
libparams.Default(defaultSecretFile),
|
||||
filepath, err := r.env.Get(secretFilepathEnvKey,
|
||||
params.CaseSensitiveValue(),
|
||||
params.Default(defaultSecretFile),
|
||||
)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("%w: %s", ErrGetSecretFilepath, err)
|
||||
return "", fmt.Errorf("%w: environment variable %s: %s",
|
||||
ErrGetSecretFilepath, secretFilepathEnvKey, err)
|
||||
}
|
||||
|
||||
file, fileErr := r.os.OpenFile(filepath, os.O_RDONLY, 0)
|
||||
file, fileErr := os.OpenFile(filepath, os.O_RDONLY, 0)
|
||||
if os.IsNotExist(fileErr) {
|
||||
if compulsory {
|
||||
return "", envErr
|
||||
@@ -49,14 +58,14 @@ func (r *reader) getFromEnvOrSecretFile(envKey string, compulsory bool, retroKey
|
||||
return "", fmt.Errorf("%w: %s", ErrReadSecretFile, fileErr)
|
||||
}
|
||||
|
||||
b, err := ioutil.ReadAll(file)
|
||||
b, err := io.ReadAll(file)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("%w: %s", ErrReadSecretFile, err)
|
||||
}
|
||||
|
||||
value = string(b)
|
||||
value = strings.TrimSuffix(value, "\n")
|
||||
if compulsory && len(value) == 0 {
|
||||
value = cleanSuffix(value)
|
||||
if compulsory && value == "" {
|
||||
return "", ErrSecretFileIsEmpty
|
||||
}
|
||||
|
||||
@@ -67,15 +76,16 @@ func (r *reader) getFromEnvOrSecretFile(envKey string, compulsory bool, retroKey
|
||||
func (r *reader) getFromFileOrSecretFile(secretName, filepath string) (
|
||||
b []byte, err error) {
|
||||
defaultSecretFile := "/run/secrets/" + strings.ToLower(secretName)
|
||||
secretFilepath, err := r.env.Get(strings.ToUpper(secretName)+"_SECRETFILE",
|
||||
libparams.CaseSensitiveValue(),
|
||||
libparams.Default(defaultSecretFile),
|
||||
key := strings.ToUpper(secretName) + "_SECRETFILE"
|
||||
secretFilepath, err := r.env.Get(key,
|
||||
params.CaseSensitiveValue(),
|
||||
params.Default(defaultSecretFile),
|
||||
)
|
||||
if err != nil {
|
||||
return b, fmt.Errorf("%w: %s", ErrGetSecretFilepath, err)
|
||||
return b, fmt.Errorf("environment variable %s: %w: %s", key, ErrGetSecretFilepath, err)
|
||||
}
|
||||
|
||||
b, err = readFromFile(r.os.OpenFile, secretFilepath)
|
||||
b, err = readFromFile(secretFilepath)
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
return b, fmt.Errorf("%w: %s", ErrReadSecretFile, err)
|
||||
} else if err == nil {
|
||||
@@ -83,7 +93,7 @@ func (r *reader) getFromFileOrSecretFile(secretName, filepath string) (
|
||||
}
|
||||
|
||||
// Secret file does not exist, try the non secret file
|
||||
b, err = readFromFile(r.os.OpenFile, filepath)
|
||||
b, err = readFromFile(filepath)
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
return nil, fmt.Errorf("%w: %s", ErrReadSecretFile, err)
|
||||
} else if err == nil {
|
||||
@@ -92,12 +102,12 @@ func (r *reader) getFromFileOrSecretFile(secretName, filepath string) (
|
||||
return nil, fmt.Errorf("%w: %s and %s", ErrFilesDoNotExist, secretFilepath, filepath)
|
||||
}
|
||||
|
||||
func readFromFile(openFile os.OpenFileFunc, filepath string) (b []byte, err error) {
|
||||
file, err := openFile(filepath, os.O_RDONLY, 0)
|
||||
func readFromFile(filepath string) (b []byte, err error) {
|
||||
file, err := os.Open(filepath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b, err = ioutil.ReadAll(file)
|
||||
b, err = io.ReadAll(file)
|
||||
if err != nil {
|
||||
_ = file.Close()
|
||||
return nil, err
|
||||
63
internal/configuration/selection.go
Normal file
63
internal/configuration/selection.go
Normal file
@@ -0,0 +1,63 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"net"
|
||||
)
|
||||
|
||||
type ServerSelection struct { //nolint:maligned
|
||||
// Common
|
||||
TCP bool `json:"tcp"` // UDP if TCP is false
|
||||
TargetIP net.IP `json:"target_ip,omitempty"`
|
||||
// TODO comments
|
||||
// Cyberghost, PIA, Protonvpn, Surfshark, Windscribe, Vyprvpn, NordVPN
|
||||
Regions []string `json:"regions"`
|
||||
|
||||
// Cyberghost
|
||||
Group string `json:"group"`
|
||||
|
||||
// Fastestvpn, HideMyAss, IPVanish, IVPN, Mullvad, PrivateVPN, Protonvpn, PureVPN, VPNUnlimited
|
||||
Countries []string `json:"countries"`
|
||||
// HideMyAss, IPVanish, IVPN, Mullvad, PrivateVPN, Protonvpn, PureVPN, VPNUnlimited, Windscribe
|
||||
Cities []string `json:"cities"`
|
||||
// Fastestvpn, HideMyAss, IPVanish, IVPN, PrivateVPN, Windscribe, Privado, Protonvpn, VPNUnlimited
|
||||
Hostnames []string `json:"hostnames"`
|
||||
Names []string `json:"names"` // Protonvpn
|
||||
|
||||
// Mullvad
|
||||
ISPs []string `json:"isps"`
|
||||
Owned bool `json:"owned"`
|
||||
|
||||
// Mullvad, Windscribe, PIA
|
||||
CustomPort uint16 `json:"custom_port"`
|
||||
|
||||
// NordVPN
|
||||
Numbers []uint16 `json:"numbers"`
|
||||
|
||||
// PIA
|
||||
EncryptionPreset string `json:"encryption_preset"`
|
||||
|
||||
// ProtonVPN
|
||||
FreeOnly bool `json:"free_only"`
|
||||
|
||||
// VPNUnlimited
|
||||
StreamOnly bool `json:"stream_only"`
|
||||
}
|
||||
|
||||
type ExtraConfigOptions struct {
|
||||
ClientCertificate string `json:"-"` // Cyberghost
|
||||
ClientKey string `json:"-"` // Cyberghost, VPNUnlimited
|
||||
EncryptionPreset string `json:"encryption_preset"` // PIA
|
||||
OpenVPNIPv6 bool `json:"openvpn_ipv6"` // Mullvad
|
||||
}
|
||||
|
||||
// PortForwarding contains settings for port forwarding.
|
||||
type PortForwarding struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
Filepath string `json:"filepath"`
|
||||
}
|
||||
|
||||
func (p *PortForwarding) lines() (lines []string) {
|
||||
return []string{
|
||||
lastIndent + "File path: " + p.Filepath,
|
||||
}
|
||||
}
|
||||
50
internal/configuration/server.go
Normal file
50
internal/configuration/server.go
Normal file
@@ -0,0 +1,50 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
// ControlServer contains settings to customize the control server operation.
|
||||
type ControlServer struct {
|
||||
Port uint16
|
||||
Log bool
|
||||
}
|
||||
|
||||
func (settings *ControlServer) String() string {
|
||||
return strings.Join(settings.lines(), "\n")
|
||||
}
|
||||
|
||||
func (settings *ControlServer) lines() (lines []string) {
|
||||
lines = append(lines, lastIndent+"HTTP control server:")
|
||||
|
||||
lines = append(lines, indent+lastIndent+"Listening port: "+strconv.Itoa(int(settings.Port)))
|
||||
|
||||
if settings.Log {
|
||||
lines = append(lines, indent+lastIndent+"Logging: enabled")
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
func (settings *ControlServer) read(r reader) (err error) {
|
||||
settings.Log, err = r.env.OnOff("HTTP_CONTROL_SERVER_LOG", params.Default("on"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable HTTP_CONTROL_SERVER_LOG: %w", err)
|
||||
}
|
||||
|
||||
var warning string
|
||||
settings.Port, warning, err = r.env.ListeningPort(
|
||||
"HTTP_CONTROL_SERVER_PORT", params.Default("8000"))
|
||||
if len(warning) > 0 {
|
||||
r.logger.Warn(warning)
|
||||
}
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable HTTP_CONTROL_SERVER_PORT: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
117
internal/configuration/settings.go
Normal file
117
internal/configuration/settings.go
Normal file
@@ -0,0 +1,117 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/qdm12/golibs/logging"
|
||||
"github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
// Settings contains all settings for the program to run.
|
||||
type Settings struct {
|
||||
OpenVPN OpenVPN
|
||||
System System
|
||||
DNS DNS
|
||||
Firewall Firewall
|
||||
HTTPProxy HTTPProxy
|
||||
ShadowSocks ShadowSocks
|
||||
Updater Updater
|
||||
PublicIP PublicIP
|
||||
VersionInformation bool
|
||||
ControlServer ControlServer
|
||||
Health Health
|
||||
}
|
||||
|
||||
func (settings *Settings) String() string {
|
||||
return strings.Join(settings.lines(), "\n")
|
||||
}
|
||||
|
||||
func (settings *Settings) lines() (lines []string) {
|
||||
lines = append(lines, "Settings summary below:")
|
||||
lines = append(lines, settings.OpenVPN.lines()...)
|
||||
lines = append(lines, settings.DNS.lines()...)
|
||||
lines = append(lines, settings.Firewall.lines()...)
|
||||
lines = append(lines, settings.System.lines()...)
|
||||
lines = append(lines, settings.HTTPProxy.lines()...)
|
||||
lines = append(lines, settings.ShadowSocks.lines()...)
|
||||
lines = append(lines, settings.Health.lines()...)
|
||||
lines = append(lines, settings.ControlServer.lines()...)
|
||||
lines = append(lines, settings.Updater.lines()...)
|
||||
lines = append(lines, settings.PublicIP.lines()...)
|
||||
if settings.VersionInformation {
|
||||
lines = append(lines, lastIndent+"Github version information: enabled")
|
||||
}
|
||||
return lines
|
||||
}
|
||||
|
||||
var (
|
||||
ErrOpenvpn = errors.New("cannot read Openvpn settings")
|
||||
ErrSystem = errors.New("cannot read System settings")
|
||||
ErrDNS = errors.New("cannot read DNS settings")
|
||||
ErrFirewall = errors.New("cannot read firewall settings")
|
||||
ErrHTTPProxy = errors.New("cannot read HTTP proxy settings")
|
||||
ErrShadowsocks = errors.New("cannot read Shadowsocks settings")
|
||||
ErrControlServer = errors.New("cannot read control server settings")
|
||||
ErrUpdater = errors.New("cannot read Updater settings")
|
||||
ErrPublicIP = errors.New("cannot read Public IP getter settings")
|
||||
ErrHealth = errors.New("cannot read health settings")
|
||||
)
|
||||
|
||||
// Read obtains all configuration options for the program and returns an error as soon
|
||||
// as an error is encountered reading them.
|
||||
func (settings *Settings) Read(env params.Env, logger logging.Logger) (err error) {
|
||||
r := newReader(env, logger)
|
||||
|
||||
settings.VersionInformation, err = r.env.OnOff("VERSION_INFORMATION", params.Default("on"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable VERSION_INFORMATION: %w", err)
|
||||
}
|
||||
|
||||
if err := settings.OpenVPN.read(r); err != nil {
|
||||
return fmt.Errorf("%w: %s", ErrOpenvpn, err)
|
||||
}
|
||||
|
||||
if err := settings.System.read(r); err != nil {
|
||||
return fmt.Errorf("%w: %s", ErrSystem, err)
|
||||
}
|
||||
|
||||
if err := settings.DNS.read(r); err != nil {
|
||||
return fmt.Errorf("%w: %s", ErrDNS, err)
|
||||
}
|
||||
|
||||
if err := settings.Firewall.read(r); err != nil {
|
||||
return fmt.Errorf("%w: %s", ErrFirewall, err)
|
||||
}
|
||||
|
||||
if err := settings.HTTPProxy.read(r); err != nil {
|
||||
return fmt.Errorf("%w: %s", ErrHTTPProxy, err)
|
||||
}
|
||||
|
||||
if err := settings.ShadowSocks.read(r); err != nil {
|
||||
return fmt.Errorf("%w: %s", ErrShadowsocks, err)
|
||||
}
|
||||
|
||||
if err := settings.ControlServer.read(r); err != nil {
|
||||
return fmt.Errorf("%w: %s", ErrControlServer, err)
|
||||
}
|
||||
|
||||
if err := settings.Updater.read(r); err != nil {
|
||||
return fmt.Errorf("%w: %s", ErrUpdater, err)
|
||||
}
|
||||
|
||||
if ip := settings.DNS.PlaintextAddress; ip != nil {
|
||||
settings.Updater.DNSAddress = ip.String()
|
||||
}
|
||||
|
||||
if err := settings.PublicIP.read(r); err != nil {
|
||||
return fmt.Errorf("%w: %s", ErrPublicIP, err)
|
||||
}
|
||||
|
||||
if err := settings.Health.read(r); err != nil {
|
||||
return fmt.Errorf("%w: %s", ErrHealth, err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
61
internal/configuration/settings_test.go
Normal file
61
internal/configuration/settings_test.go
Normal file
@@ -0,0 +1,61 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func Test_Settings_lines(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
testCases := map[string]struct {
|
||||
settings Settings
|
||||
lines []string
|
||||
}{
|
||||
"default settings": {
|
||||
settings: Settings{
|
||||
OpenVPN: OpenVPN{
|
||||
Version: constants.Openvpn25,
|
||||
Provider: Provider{
|
||||
Name: constants.Mullvad,
|
||||
},
|
||||
},
|
||||
},
|
||||
lines: []string{
|
||||
"Settings summary below:",
|
||||
"|--OpenVPN:",
|
||||
" |--Version: 2.5",
|
||||
" |--Verbosity level: 0",
|
||||
" |--Provider:",
|
||||
" |--Mullvad settings:",
|
||||
" |--Network protocol: udp",
|
||||
"|--DNS:",
|
||||
"|--Firewall: disabled ⚠️",
|
||||
"|--System:",
|
||||
" |--Process user ID: 0",
|
||||
" |--Process group ID: 0",
|
||||
" |--Timezone: NOT SET ⚠️ - it can cause time related issues",
|
||||
"|--Health:",
|
||||
" |--Server address: ",
|
||||
" |--OpenVPN:",
|
||||
" |--Initial duration: 0s",
|
||||
"|--HTTP control server:",
|
||||
" |--Listening port: 0",
|
||||
"|--Public IP getter: disabled",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for name, testCase := range testCases {
|
||||
testCase := testCase
|
||||
t.Run(name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
lines := testCase.settings.lines()
|
||||
|
||||
assert.Equal(t, testCase.lines, lines)
|
||||
})
|
||||
}
|
||||
}
|
||||
75
internal/configuration/shadowsocks.go
Normal file
75
internal/configuration/shadowsocks.go
Normal file
@@ -0,0 +1,75 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
// ShadowSocks contains settings to configure the Shadowsocks server.
|
||||
type ShadowSocks struct {
|
||||
Method string
|
||||
Password string
|
||||
Port uint16
|
||||
Enabled bool
|
||||
Log bool
|
||||
}
|
||||
|
||||
func (settings *ShadowSocks) String() string {
|
||||
return strings.Join(settings.lines(), "\n")
|
||||
}
|
||||
|
||||
func (settings *ShadowSocks) lines() (lines []string) {
|
||||
if !settings.Enabled {
|
||||
return nil
|
||||
}
|
||||
|
||||
lines = append(lines, lastIndent+"Shadowsocks server:")
|
||||
|
||||
lines = append(lines, indent+lastIndent+"Listening port: "+strconv.Itoa(int(settings.Port)))
|
||||
|
||||
lines = append(lines, indent+lastIndent+"Method: "+settings.Method)
|
||||
|
||||
if settings.Log {
|
||||
lines = append(lines, indent+lastIndent+"Logging: enabled")
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
func (settings *ShadowSocks) read(r reader) (err error) {
|
||||
settings.Enabled, err = r.env.OnOff("SHADOWSOCKS", params.Default("off"))
|
||||
if !settings.Enabled {
|
||||
return nil
|
||||
} else if err != nil {
|
||||
return fmt.Errorf("environment variable SHADOWSOCKS: %w", err)
|
||||
}
|
||||
|
||||
settings.Password, err = r.getFromEnvOrSecretFile("SHADOWSOCKS_PASSWORD", settings.Enabled, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.Log, err = r.env.OnOff("SHADOWSOCKS_LOG", params.Default("off"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable SHADOWSOCKS_LOG: %w", err)
|
||||
}
|
||||
|
||||
settings.Method, err = r.env.Get("SHADOWSOCKS_METHOD", params.Default("chacha20-ietf-poly1305"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable SHADOWSOCKS_METHOD: %w", err)
|
||||
}
|
||||
|
||||
var warning string
|
||||
settings.Port, warning, err = r.env.ListeningPort("SHADOWSOCKS_PORT", params.Default("8388"))
|
||||
if len(warning) > 0 {
|
||||
r.logger.Warn(warning)
|
||||
}
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable SHADOWSOCKS_PORT: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
45
internal/configuration/surfshark.go
Normal file
45
internal/configuration/surfshark.go
Normal file
@@ -0,0 +1,45 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
)
|
||||
|
||||
func (settings *Provider) surfsharkLines() (lines []string) {
|
||||
if len(settings.ServerSelection.Regions) > 0 {
|
||||
lines = append(lines, lastIndent+"Regions: "+commaJoin(settings.ServerSelection.Regions))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Hostnames) > 0 {
|
||||
lines = append(lines, lastIndent+"Hostnames: "+commaJoin(settings.ServerSelection.Hostnames))
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
func (settings *Provider) readSurfshark(r reader) (err error) {
|
||||
settings.Name = constants.Surfshark
|
||||
|
||||
settings.ServerSelection.TCP, err = readProtocol(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.TargetIP, err = readTargetIP(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.Regions, err = r.env.CSVInside("REGION", constants.SurfsharkRegionChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable REGION: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Hostnames, err = r.env.CSVInside("SERVER_HOSTNAME", constants.SurfsharkHostnameChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable SERVER_HOSTNAME: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
55
internal/configuration/system.go
Normal file
55
internal/configuration/system.go
Normal file
@@ -0,0 +1,55 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
// System contains settings to configure system related elements.
|
||||
type System struct {
|
||||
PUID int
|
||||
PGID int
|
||||
Timezone string
|
||||
}
|
||||
|
||||
func (settings *System) String() string {
|
||||
return strings.Join(settings.lines(), "\n")
|
||||
}
|
||||
|
||||
func (settings *System) lines() (lines []string) {
|
||||
lines = append(lines, lastIndent+"System:")
|
||||
lines = append(lines, indent+lastIndent+"Process user ID: "+strconv.Itoa(settings.PUID))
|
||||
lines = append(lines, indent+lastIndent+"Process group ID: "+strconv.Itoa(settings.PGID))
|
||||
|
||||
if len(settings.Timezone) > 0 {
|
||||
lines = append(lines, indent+lastIndent+"Timezone: "+settings.Timezone)
|
||||
} else {
|
||||
lines = append(lines, indent+lastIndent+"Timezone: NOT SET ⚠️ - it can cause time related issues")
|
||||
}
|
||||
return lines
|
||||
}
|
||||
|
||||
func (settings *System) read(r reader) (err error) {
|
||||
const maxID = 65535
|
||||
settings.PUID, err = r.env.IntRange("PUID", 0, maxID, params.Default("1000"),
|
||||
params.RetroKeys([]string{"UID"}, r.onRetroActive))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable PUID (or UID): %w", err)
|
||||
}
|
||||
|
||||
settings.PGID, err = r.env.IntRange("PGID", 0, maxID, params.Default("1000"),
|
||||
params.RetroKeys([]string{"GID"}, r.onRetroActive))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable PGID (or GID): %w", err)
|
||||
}
|
||||
|
||||
settings.Timezone, err = r.env.Get("TZ")
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable TZ: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
54
internal/configuration/torguard.go
Normal file
54
internal/configuration/torguard.go
Normal file
@@ -0,0 +1,54 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
)
|
||||
|
||||
func (settings *Provider) torguardLines() (lines []string) {
|
||||
if len(settings.ServerSelection.Countries) > 0 {
|
||||
lines = append(lines, lastIndent+"Countries: "+commaJoin(settings.ServerSelection.Countries))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Cities) > 0 {
|
||||
lines = append(lines, lastIndent+"Cities: "+commaJoin(settings.ServerSelection.Cities))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Hostnames) > 0 {
|
||||
lines = append(lines, lastIndent+"Hostnames: "+commaJoin(settings.ServerSelection.Hostnames))
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
func (settings *Provider) readTorguard(r reader) (err error) {
|
||||
settings.Name = constants.Torguard
|
||||
|
||||
settings.ServerSelection.TCP, err = readProtocol(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.TargetIP, err = readTargetIP(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.Countries, err = r.env.CSVInside("COUNTRY", constants.TorguardCountryChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable COUNTRY: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Cities, err = r.env.CSVInside("CITY", constants.TorguardCityChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable CITY: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Hostnames, err = r.env.CSVInside("SERVER_HOSTNAME", constants.TorguardHostnameChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable SERVER_HOSTNAME: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
79
internal/configuration/unbound.go
Normal file
79
internal/configuration/unbound.go
Normal file
@@ -0,0 +1,79 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/qdm12/dns/pkg/provider"
|
||||
"github.com/qdm12/golibs/params"
|
||||
"inet.af/netaddr"
|
||||
)
|
||||
|
||||
func (settings *DNS) readUnbound(r reader) (err error) {
|
||||
if err := settings.readUnboundProviders(r.env); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.Unbound.ListeningPort = 53
|
||||
|
||||
settings.Unbound.Caching, err = r.env.OnOff("DOT_CACHING", params.Default("on"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable DOT_CACHING: %w", err)
|
||||
}
|
||||
|
||||
settings.Unbound.IPv4 = true
|
||||
|
||||
settings.Unbound.IPv6, err = r.env.OnOff("DOT_IPV6", params.Default("off"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable DOT_IPV6: %w", err)
|
||||
}
|
||||
|
||||
verbosityLevel, err := r.env.IntRange("DOT_VERBOSITY", 0, 5, params.Default("1")) //nolint:gomnd
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable DOT_VERBOSITY: %w", err)
|
||||
}
|
||||
settings.Unbound.VerbosityLevel = uint8(verbosityLevel)
|
||||
|
||||
verbosityDetailsLevel, err := r.env.IntRange("DOT_VERBOSITY_DETAILS", 0, 4, params.Default("0")) //nolint:gomnd
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable DOT_VERBOSITY_DETAILS: %w", err)
|
||||
}
|
||||
settings.Unbound.VerbosityDetailsLevel = uint8(verbosityDetailsLevel)
|
||||
|
||||
validationLogLevel, err := r.env.IntRange("DOT_VALIDATION_LOGLEVEL", 0, 2, params.Default("0")) //nolint:gomnd
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable DOT_VALIDATION_LOGLEVEL: %w", err)
|
||||
}
|
||||
settings.Unbound.ValidationLogLevel = uint8(validationLogLevel)
|
||||
|
||||
settings.Unbound.AccessControl.Allowed = []netaddr.IPPrefix{
|
||||
netaddr.IPPrefixFrom(netaddr.IPv4(0, 0, 0, 0), 0),
|
||||
netaddr.IPPrefixFrom(netaddr.IPv6Raw([16]byte{}), 0),
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidDNSOverTLSProvider = errors.New("invalid DNS over TLS provider")
|
||||
)
|
||||
|
||||
func (settings *DNS) readUnboundProviders(env params.Env) (err error) {
|
||||
s, err := env.Get("DOT_PROVIDERS", params.Default("cloudflare"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable DOT_PROVIDERS: %w", err)
|
||||
}
|
||||
for _, field := range strings.Split(s, ",") {
|
||||
dnsProvider, err := provider.Parse(field)
|
||||
if err != nil {
|
||||
return fmt.Errorf("%w: %s", ErrInvalidDNSOverTLSProvider, err)
|
||||
}
|
||||
settings.Unbound.Providers = append(settings.Unbound.Providers, dnsProvider)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidHostname = errors.New("invalid hostname")
|
||||
)
|
||||
80
internal/configuration/unbound_test.go
Normal file
80
internal/configuration/unbound_test.go
Normal file
@@ -0,0 +1,80 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"github.com/golang/mock/gomock"
|
||||
"github.com/qdm12/dns/pkg/provider"
|
||||
"github.com/qdm12/dns/pkg/unbound"
|
||||
"github.com/qdm12/golibs/params/mock_params"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func Test_DNS_readUnboundProviders(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
testCases := map[string]struct {
|
||||
envValue string
|
||||
envErr error
|
||||
expected DNS
|
||||
err error
|
||||
}{
|
||||
"bad value": {
|
||||
envValue: "invalid",
|
||||
err: errors.New(`invalid DNS over TLS provider: cannot parse provider: "invalid"`),
|
||||
},
|
||||
"env error": {
|
||||
envErr: errors.New("env error"),
|
||||
err: errors.New("environment variable DOT_PROVIDERS: env error"),
|
||||
},
|
||||
"multiple valid values": {
|
||||
envValue: "cloudflare,google",
|
||||
expected: DNS{
|
||||
Unbound: unbound.Settings{
|
||||
Providers: []provider.Provider{
|
||||
provider.Cloudflare(),
|
||||
provider.Google(),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"one invalid value in two": {
|
||||
envValue: "cloudflare,invalid",
|
||||
expected: DNS{
|
||||
Unbound: unbound.Settings{
|
||||
Providers: []provider.Provider{
|
||||
provider.Cloudflare(),
|
||||
},
|
||||
},
|
||||
},
|
||||
err: errors.New(`invalid DNS over TLS provider: cannot parse provider: "invalid"`),
|
||||
},
|
||||
}
|
||||
|
||||
for name, testCase := range testCases {
|
||||
testCase := testCase
|
||||
t.Run(name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
ctrl := gomock.NewController(t)
|
||||
|
||||
env := mock_params.NewMockEnv(ctrl)
|
||||
env.EXPECT().Get("DOT_PROVIDERS", gomock.Any()).
|
||||
Return(testCase.envValue, testCase.envErr)
|
||||
|
||||
var settings DNS
|
||||
err := settings.readUnboundProviders(env)
|
||||
|
||||
if testCase.err != nil {
|
||||
require.Error(t, err)
|
||||
assert.Equal(t, testCase.err.Error(), err.Error())
|
||||
} else {
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
assert.Equal(t, testCase.expected, settings)
|
||||
})
|
||||
}
|
||||
}
|
||||
85
internal/configuration/updater.go
Normal file
85
internal/configuration/updater.go
Normal file
@@ -0,0 +1,85 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
type Updater struct {
|
||||
Period time.Duration `json:"period"`
|
||||
DNSAddress string `json:"dns_address"`
|
||||
Cyberghost bool `json:"cyberghost"`
|
||||
Fastestvpn bool `json:"fastestvpn"`
|
||||
HideMyAss bool `json:"hidemyass"`
|
||||
Ipvanish bool `json:"ipvanish"`
|
||||
Ivpn bool `json:"ivpn"`
|
||||
Mullvad bool `json:"mullvad"`
|
||||
Nordvpn bool `json:"nordvpn"`
|
||||
PIA bool `json:"pia"`
|
||||
Privado bool `json:"privado"`
|
||||
Privatevpn bool `json:"privatevpn"`
|
||||
Protonvpn bool `json:"protonvpn"`
|
||||
Purevpn bool `json:"purevpn"`
|
||||
Surfshark bool `json:"surfshark"`
|
||||
Torguard bool `json:"torguard"`
|
||||
VPNUnlimited bool `json:"vpnunlimited"`
|
||||
Vyprvpn bool `json:"vyprvpn"`
|
||||
Windscribe bool `json:"windscribe"`
|
||||
// The two below should be used in CLI mode only
|
||||
CLI bool `json:"-"`
|
||||
}
|
||||
|
||||
func (settings *Updater) String() string {
|
||||
return strings.Join(settings.lines(), "\n")
|
||||
}
|
||||
|
||||
func (settings *Updater) lines() (lines []string) {
|
||||
if settings.Period == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
lines = append(lines, lastIndent+"Updater:")
|
||||
|
||||
lines = append(lines, indent+lastIndent+"Period: every "+settings.Period.String())
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
func (settings *Updater) EnableAll() {
|
||||
settings.Cyberghost = true
|
||||
settings.HideMyAss = true
|
||||
settings.Ipvanish = true
|
||||
settings.Ivpn = true
|
||||
settings.Mullvad = true
|
||||
settings.Nordvpn = true
|
||||
settings.Privado = true
|
||||
settings.PIA = true
|
||||
settings.Privado = true
|
||||
settings.Privatevpn = true
|
||||
settings.Protonvpn = true
|
||||
settings.Purevpn = true
|
||||
settings.Surfshark = true
|
||||
settings.Torguard = true
|
||||
settings.VPNUnlimited = true
|
||||
settings.Vyprvpn = true
|
||||
settings.Windscribe = true
|
||||
}
|
||||
|
||||
func (settings *Updater) read(r reader) (err error) {
|
||||
settings.EnableAll()
|
||||
// use cloudflare in plaintext to not be blocked by DNS over TLS by default.
|
||||
// If a plaintext address is set in the DNS settings, this one will be used.
|
||||
// TODO use custom future encrypted DNS written in Go without blocking
|
||||
// as it's too much trouble to start another parallel unbound instance for now.
|
||||
settings.DNSAddress = "1.1.1.1"
|
||||
|
||||
settings.Period, err = r.env.Duration("UPDATER_PERIOD", params.Default("0"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable UPDATER_PERIOD: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
87
internal/configuration/vpnunlimited.go
Normal file
87
internal/configuration/vpnunlimited.go
Normal file
@@ -0,0 +1,87 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
"github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
func (settings *Provider) vpnUnlimitedLines() (lines []string) {
|
||||
if len(settings.ServerSelection.Countries) > 0 {
|
||||
lines = append(lines, lastIndent+"Countries: "+commaJoin(settings.ServerSelection.Countries))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Cities) > 0 {
|
||||
lines = append(lines, lastIndent+"Cities: "+commaJoin(settings.ServerSelection.Cities))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Hostnames) > 0 {
|
||||
lines = append(lines, lastIndent+"Hostnames: "+commaJoin(settings.ServerSelection.Hostnames))
|
||||
}
|
||||
|
||||
if settings.ServerSelection.FreeOnly {
|
||||
lines = append(lines, lastIndent+"Free servers only")
|
||||
}
|
||||
|
||||
if settings.ServerSelection.StreamOnly {
|
||||
lines = append(lines, lastIndent+"Stream servers only")
|
||||
}
|
||||
|
||||
if settings.ExtraConfigOptions.ClientKey != "" {
|
||||
lines = append(lines, lastIndent+"Client key is set")
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
func (settings *Provider) readVPNUnlimited(r reader) (err error) {
|
||||
settings.Name = constants.VPNUnlimited
|
||||
|
||||
settings.ServerSelection.TCP, err = readProtocol(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.TargetIP, err = readTargetIP(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ExtraConfigOptions.ClientKey, err = readClientKey(r)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ExtraConfigOptions.ClientCertificate, err = readClientCertificate(r)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.Countries, err = r.env.CSVInside("COUNTRY", constants.VPNUnlimitedCountryChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable COUNTRY: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Cities, err = r.env.CSVInside("CITY", constants.VPNUnlimitedCityChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable CITY: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Hostnames, err = r.env.CSVInside("SERVER_HOSTNAME", constants.VPNUnlimitedHostnameChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable SERVER_HOSTNAME: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.FreeOnly, err = r.env.YesNo("FREE_ONLY", params.Default("no"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable FREE_ONLY: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.StreamOnly, err = r.env.YesNo("STREAM_ONLY", params.Default("no"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable STREAM_ONLY: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
42
internal/configuration/vpnunlimited_test.go
Normal file
42
internal/configuration/vpnunlimited_test.go
Normal file
@@ -0,0 +1,42 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func Test_Provider_vpnUnlimitedLines(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
testCases := map[string]struct {
|
||||
settings Provider
|
||||
lines []string
|
||||
}{
|
||||
"empty settings": {},
|
||||
"full settings": {
|
||||
settings: Provider{
|
||||
ServerSelection: ServerSelection{
|
||||
Countries: []string{"A", "B"},
|
||||
Cities: []string{"C", "D"},
|
||||
Hostnames: []string{"E", "F"},
|
||||
},
|
||||
},
|
||||
lines: []string{
|
||||
"|--Countries: A, B",
|
||||
"|--Cities: C, D",
|
||||
"|--Hostnames: E, F",
|
||||
},
|
||||
},
|
||||
}
|
||||
for name, testCase := range testCases {
|
||||
testCase := testCase
|
||||
t.Run(name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
lines := testCase.settings.vpnUnlimitedLines()
|
||||
|
||||
assert.Equal(t, testCase.lines, lines)
|
||||
})
|
||||
}
|
||||
}
|
||||
36
internal/configuration/vyprvpn.go
Normal file
36
internal/configuration/vyprvpn.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
)
|
||||
|
||||
func (settings *Provider) vyprvpnLines() (lines []string) {
|
||||
if len(settings.ServerSelection.Regions) > 0 {
|
||||
lines = append(lines, lastIndent+"Regions: "+commaJoin(settings.ServerSelection.Regions))
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
func (settings *Provider) readVyprvpn(r reader) (err error) {
|
||||
settings.Name = constants.Vyprvpn
|
||||
|
||||
settings.ServerSelection.TCP, err = readProtocol(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.TargetIP, err = readTargetIP(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.Regions, err = r.env.CSVInside("REGION", constants.VyprvpnRegionChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable REGION: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
66
internal/configuration/windscribe.go
Normal file
66
internal/configuration/windscribe.go
Normal file
@@ -0,0 +1,66 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
)
|
||||
|
||||
func (settings *Provider) windscribeLines() (lines []string) {
|
||||
if len(settings.ServerSelection.Regions) > 0 {
|
||||
lines = append(lines, lastIndent+"Regions: "+commaJoin(settings.ServerSelection.Regions))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Cities) > 0 {
|
||||
lines = append(lines, lastIndent+"Cities: "+commaJoin(settings.ServerSelection.Cities))
|
||||
}
|
||||
|
||||
if len(settings.ServerSelection.Hostnames) > 0 {
|
||||
lines = append(lines, lastIndent+"Hostnames: "+commaJoin(settings.ServerSelection.Hostnames))
|
||||
}
|
||||
|
||||
if settings.ServerSelection.CustomPort > 0 {
|
||||
lines = append(lines, lastIndent+"Custom port: "+strconv.Itoa(int(settings.ServerSelection.CustomPort)))
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
func (settings *Provider) readWindscribe(r reader) (err error) {
|
||||
settings.Name = constants.Windscribe
|
||||
|
||||
settings.ServerSelection.TCP, err = readProtocol(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.TargetIP, err = readTargetIP(r.env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
settings.ServerSelection.Regions, err = r.env.CSVInside("REGION", constants.WindscribeRegionChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable REGION: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Cities, err = r.env.CSVInside("CITY", constants.WindscribeCityChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable CITY: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.Hostnames, err = r.env.CSVInside("SERVER_HOSTNAME", constants.WindscribeHostnameChoices())
|
||||
if err != nil {
|
||||
return fmt.Errorf("environment variable SERVER_HOSTNAME: %w", err)
|
||||
}
|
||||
|
||||
settings.ServerSelection.CustomPort, err = readCustomPort(r.env, settings.ServerSelection.TCP,
|
||||
[]uint16{21, 22, 80, 123, 143, 443, 587, 1194, 3306, 8080, 54783},
|
||||
[]uint16{53, 80, 123, 443, 1194, 54783})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package constants
|
||||
|
||||
const (
|
||||
HealthcheckAddress = "127.0.0.1:9999"
|
||||
)
|
||||
25
internal/constants/constants.go
Normal file
25
internal/constants/constants.go
Normal file
@@ -0,0 +1,25 @@
|
||||
// Package constants defines constants shared throughout the program.
|
||||
// It also defines constant maps and slices using functions.
|
||||
package constants
|
||||
|
||||
import "sort"
|
||||
|
||||
func makeChoicesUnique(choices []string) []string {
|
||||
uniqueChoices := map[string]struct{}{}
|
||||
for _, choice := range choices {
|
||||
uniqueChoices[choice] = struct{}{}
|
||||
}
|
||||
|
||||
uniqueChoicesSlice := make([]string, len(uniqueChoices))
|
||||
i := 0
|
||||
for choice := range uniqueChoices {
|
||||
uniqueChoicesSlice[i] = choice
|
||||
i++
|
||||
}
|
||||
|
||||
sort.Slice(uniqueChoicesSlice, func(i, j int) bool {
|
||||
return uniqueChoicesSlice[i] < uniqueChoicesSlice[j]
|
||||
})
|
||||
|
||||
return uniqueChoicesSlice
|
||||
}
|
||||
256
internal/constants/countries.go
Normal file
256
internal/constants/countries.go
Normal file
@@ -0,0 +1,256 @@
|
||||
package constants
|
||||
|
||||
func CountryCodes() map[string]string {
|
||||
return map[string]string{
|
||||
"af": "Afghanistan",
|
||||
"ax": "Aland Islands",
|
||||
"al": "Albania",
|
||||
"dz": "Algeria",
|
||||
"as": "American Samoa",
|
||||
"ad": "Andorra",
|
||||
"ao": "Angola",
|
||||
"ai": "Anguilla",
|
||||
"aq": "Antarctica",
|
||||
"ag": "Antigua and Barbuda",
|
||||
"ar": "Argentina",
|
||||
"am": "Armenia",
|
||||
"aw": "Aruba",
|
||||
"au": "Australia",
|
||||
"at": "Austria",
|
||||
"az": "Azerbaijan",
|
||||
"bs": "Bahamas",
|
||||
"bh": "Bahrain",
|
||||
"bd": "Bangladesh",
|
||||
"bb": "Barbados",
|
||||
"by": "Belarus",
|
||||
"be": "Belgium",
|
||||
"bz": "Belize",
|
||||
"bj": "Benin",
|
||||
"bm": "Bermuda",
|
||||
"bt": "Bhutan",
|
||||
"bo": "Bolivia",
|
||||
"bq": "Bonaire",
|
||||
"ba": "Bosnia and Herzegovina",
|
||||
"bw": "Botswana",
|
||||
"bv": "Bouvet Island",
|
||||
"br": "Brazil",
|
||||
"io": "British Indian Ocean Territory",
|
||||
"vg": "British Virgin Islands",
|
||||
"bn": "Brunei Darussalam",
|
||||
"bg": "Bulgaria",
|
||||
"bf": "Burkina Faso",
|
||||
"bi": "Burundi",
|
||||
"kh": "Cambodia",
|
||||
"cm": "Cameroon",
|
||||
"ca": "Canada",
|
||||
"cv": "Cape Verde",
|
||||
"ky": "Cayman Islands",
|
||||
"cf": "Central African Republic",
|
||||
"td": "Chad",
|
||||
"cl": "Chile",
|
||||
"cn": "China",
|
||||
"cx": "Christmas Island",
|
||||
"cc": "Cocos Islands",
|
||||
"co": "Colombia",
|
||||
"km": "Comoros",
|
||||
"cg": "Congo",
|
||||
"ck": "Cook Islands",
|
||||
"cr": "Costa Rica",
|
||||
"ci": "Cote d'Ivoire",
|
||||
"hr": "Croatia",
|
||||
"cu": "Cuba",
|
||||
"cw": "Curacao",
|
||||
"cy": "Cyprus",
|
||||
"cz": "Czech Republic",
|
||||
"cd": "Democratic Republic of the Congo",
|
||||
"dk": "Denmark",
|
||||
"dj": "Djibouti",
|
||||
"dm": "Dominica",
|
||||
"do": "Dominican Republic",
|
||||
"ec": "Ecuador",
|
||||
"eg": "Egypt",
|
||||
"sv": "El Salvador",
|
||||
"gq": "Equatorial Guinea",
|
||||
"er": "Eritrea",
|
||||
"ee": "Estonia",
|
||||
"et": "Ethiopia",
|
||||
"fk": "Falkland Islands",
|
||||
"fo": "Faroe Islands",
|
||||
"fj": "Fiji",
|
||||
"fi": "Finland",
|
||||
"fr": "France",
|
||||
"gf": "French Guiana",
|
||||
"pf": "French Polynesia",
|
||||
"tf": "French Southern Territories",
|
||||
"ga": "Gabon",
|
||||
"gm": "Gambia",
|
||||
"ge": "Georgia",
|
||||
"de": "Germany",
|
||||
"gh": "Ghana",
|
||||
"gi": "Gibraltar",
|
||||
"gr": "Greece",
|
||||
"gl": "Greenland",
|
||||
"gd": "Grenada",
|
||||
"gp": "Guadeloupe",
|
||||
"gu": "Guam",
|
||||
"gt": "Guatemala",
|
||||
"gg": "Guernsey",
|
||||
"gw": "Guinea-Bissau",
|
||||
"gn": "Guinea",
|
||||
"gy": "Guyana",
|
||||
"ht": "Haiti",
|
||||
"hm": "Heard Island and McDonald Islands",
|
||||
"hn": "Honduras",
|
||||
"hk": "Hong Kong",
|
||||
"hu": "Hungary",
|
||||
"is": "Iceland",
|
||||
"in": "India",
|
||||
"id": "Indonesia",
|
||||
"ir": "Iran",
|
||||
"iq": "Iraq",
|
||||
"ie": "Ireland",
|
||||
"im": "Isle of Man",
|
||||
"il": "Israel",
|
||||
"it": "Italy",
|
||||
"jm": "Jamaica",
|
||||
"jp": "Japan",
|
||||
"je": "Jersey",
|
||||
"jo": "Jordan",
|
||||
"kz": "Kazakhstan",
|
||||
"ke": "Kenya",
|
||||
"ki": "Kiribati",
|
||||
"kr": "Korea",
|
||||
"kw": "Kuwait",
|
||||
"kg": "Kyrgyzstan",
|
||||
"la": "Lao People's Democratic Republic",
|
||||
"lv": "Latvia",
|
||||
"lb": "Lebanon",
|
||||
"ls": "Lesotho",
|
||||
"lr": "Liberia",
|
||||
"ly": "Libya",
|
||||
"li": "Liechtenstein",
|
||||
"lt": "Lithuania",
|
||||
"lu": "Luxembourg",
|
||||
"mo": "Macao",
|
||||
"mk": "Macedonia",
|
||||
"mg": "Madagascar",
|
||||
"mw": "Malawi",
|
||||
"my": "Malaysia",
|
||||
"mys": "Kuala Lumpur",
|
||||
"mv": "Maldives",
|
||||
"ml": "Mali",
|
||||
"mt": "Malta",
|
||||
"mh": "Marshall Islands",
|
||||
"mq": "Martinique",
|
||||
"mr": "Mauritania",
|
||||
"mu": "Mauritius",
|
||||
"yt": "Mayotte",
|
||||
"mx": "Mexico",
|
||||
"fm": "Micronesia",
|
||||
"md": "Moldova",
|
||||
"mc": "Monaco",
|
||||
"mn": "Mongolia",
|
||||
"me": "Montenegro",
|
||||
"ms": "Montserrat",
|
||||
"ma": "Morocco",
|
||||
"mz": "Mozambique",
|
||||
"mm": "Myanmar",
|
||||
"na": "Namibia",
|
||||
"nr": "Nauru",
|
||||
"np": "Nepal",
|
||||
"nl": "Netherlands",
|
||||
"nc": "New Caledonia",
|
||||
"nz": "New Zealand",
|
||||
"ni": "Nicaragua",
|
||||
"ne": "Niger",
|
||||
"ng": "Nigeria",
|
||||
"nu": "Niue",
|
||||
"nf": "Norfolk Island",
|
||||
"mp": "Northern Mariana Islands",
|
||||
"no": "Norway",
|
||||
"om": "Oman",
|
||||
"pk": "Pakistan",
|
||||
"pw": "Palau",
|
||||
"ps": "Palestine, State of",
|
||||
"pa": "Panama",
|
||||
"pg": "Papua New Guinea",
|
||||
"py": "Paraguay",
|
||||
"pe": "Peru",
|
||||
"ph": "Philippines",
|
||||
"pn": "Pitcairn",
|
||||
"pl": "Poland",
|
||||
"pt": "Portugal",
|
||||
"pr": "Puerto Rico",
|
||||
"qa": "Qatar",
|
||||
"re": "Reunion",
|
||||
"ro": "Romania",
|
||||
"ru": "Russian Federation",
|
||||
"rw": "Rwanda",
|
||||
"bl": "Saint Barthelemy",
|
||||
"sh": "Saint Helena",
|
||||
"kn": "Saint Kitts and Nevis",
|
||||
"lc": "Saint Lucia",
|
||||
"mf": "Saint Martin",
|
||||
"pm": "Saint Pierre and Miquelon",
|
||||
"vc": "Saint Vincent and the Grenadines",
|
||||
"ws": "Samoa",
|
||||
"sm": "San Marino",
|
||||
"st": "Sao Tome and Principe",
|
||||
"sa": "Saudi Arabia",
|
||||
"sn": "Senegal",
|
||||
"rs": "Serbia",
|
||||
"sc": "Seychelles",
|
||||
"sl": "Sierra Leone",
|
||||
"sg": "Singapore",
|
||||
"sx": "Sint Maarten",
|
||||
"sk": "Slovakia",
|
||||
"si": "Slovenia",
|
||||
"sb": "Solomon Islands",
|
||||
"so": "Somalia",
|
||||
"za": "South Africa",
|
||||
"gs": "South Georgia and the South Sandwich Islands",
|
||||
"ss": "South Sudan",
|
||||
"es": "Spain",
|
||||
"lk": "Sri Lanka",
|
||||
"sd": "Sudan",
|
||||
"sr": "Suriname",
|
||||
"sj": "Svalbard and Jan Mayen",
|
||||
"sz": "Swaziland",
|
||||
"se": "Sweden",
|
||||
"ch": "Switzerland",
|
||||
"sy": "Syrian Arab Republic",
|
||||
"tw": "Taiwan",
|
||||
"tj": "Tajikistan",
|
||||
"tz": "Tanzania",
|
||||
"th": "Thailand",
|
||||
"tl": "Timor-Leste",
|
||||
"tg": "Togo",
|
||||
"tk": "Tokelau",
|
||||
"to": "Tonga",
|
||||
"tt": "Trinidad and Tobago",
|
||||
"tn": "Tunisia",
|
||||
"tr": "Turkey",
|
||||
"tm": "Turkmenistan",
|
||||
"tc": "Turks and Caicos Islands",
|
||||
"tv": "Tuvalu",
|
||||
"ug": "Uganda",
|
||||
"ua": "Ukraine",
|
||||
"ae": "United Arab Emirates",
|
||||
"gb": "United Kingdom",
|
||||
"uk": "United Kingdom",
|
||||
"um": "United States Minor Outlying Islands",
|
||||
"us": "United States",
|
||||
"uy": "Uruguay",
|
||||
"vi": "US Virgin Islands",
|
||||
"uz": "Uzbekistan",
|
||||
"vu": "Vanuatu",
|
||||
"va": "Vatican City State",
|
||||
"ve": "Venezuela",
|
||||
"vn": "Vietnam",
|
||||
"wf": "Wallis and Futuna",
|
||||
"eh": "Western Sahara",
|
||||
"ye": "Yemen",
|
||||
"zm": "Zambia",
|
||||
"zw": "Zimbabwe",
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,6 @@
|
||||
package constants
|
||||
|
||||
import (
|
||||
"net"
|
||||
"sort"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
)
|
||||
|
||||
@@ -13,210 +10,36 @@ const (
|
||||
)
|
||||
|
||||
func CyberghostRegionChoices() (choices []string) {
|
||||
uniqueChoices := map[string]struct{}{}
|
||||
for _, server := range CyberghostServers() {
|
||||
uniqueChoices[server.Region] = struct{}{}
|
||||
servers := CyberghostServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Region
|
||||
}
|
||||
for choice := range uniqueChoices {
|
||||
choices = append(choices, choice)
|
||||
}
|
||||
sort.Slice(choices, func(i, j int) bool {
|
||||
return choices[i] < choices[j]
|
||||
})
|
||||
return choices
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
func CyberghostGroupChoices() (choices []string) {
|
||||
uniqueChoices := map[string]struct{}{}
|
||||
for _, server := range CyberghostServers() {
|
||||
uniqueChoices[server.Group] = struct{}{}
|
||||
servers := CyberghostServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Group
|
||||
}
|
||||
for choice := range uniqueChoices {
|
||||
choices = append(choices, choice)
|
||||
}
|
||||
sort.Slice(choices, func(i, j int) bool {
|
||||
return choices[i] < choices[j]
|
||||
})
|
||||
return choices
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
//nolint:lll
|
||||
func CyberghostServers() []models.CyberghostServer {
|
||||
return []models.CyberghostServer{
|
||||
{Region: "Albania", Group: "Premium TCP Europe", IPs: []net.IP{{31, 171, 152, 99}, {31, 171, 152, 100}, {31, 171, 152, 101}, {31, 171, 152, 102}, {31, 171, 152, 105}, {31, 171, 152, 108}, {31, 171, 152, 132}, {31, 171, 152, 136}, {31, 171, 152, 139}, {31, 171, 152, 140}}},
|
||||
{Region: "Albania", Group: "Premium UDP Europe", IPs: []net.IP{{31, 171, 152, 102}, {31, 171, 152, 103}, {31, 171, 152, 105}, {31, 171, 152, 106}, {31, 171, 152, 108}, {31, 171, 152, 109}, {31, 171, 152, 110}, {31, 171, 152, 135}, {31, 171, 152, 137}, {31, 171, 152, 139}}},
|
||||
{Region: "Algeria", Group: "Premium UDP Europe", IPs: []net.IP{{176, 125, 228, 131}, {176, 125, 228, 132}, {176, 125, 228, 133}, {176, 125, 228, 134}, {176, 125, 228, 135}, {176, 125, 228, 136}, {176, 125, 228, 137}, {176, 125, 228, 140}, {176, 125, 228, 142}, {176, 125, 228, 143}}},
|
||||
{Region: "Algeria", Group: "Premium TCP Europe", IPs: []net.IP{{176, 125, 228, 131}, {176, 125, 228, 132}, {176, 125, 228, 133}, {176, 125, 228, 134}, {176, 125, 228, 136}, {176, 125, 228, 139}, {176, 125, 228, 140}, {176, 125, 228, 141}, {176, 125, 228, 142}, {176, 125, 228, 143}}},
|
||||
{Region: "Andorra", Group: "Premium UDP Europe", IPs: []net.IP{{188, 241, 82, 132}, {188, 241, 82, 133}, {188, 241, 82, 135}, {188, 241, 82, 138}, {188, 241, 82, 141}, {188, 241, 82, 144}, {188, 241, 82, 146}, {188, 241, 82, 157}, {188, 241, 82, 159}, {188, 241, 82, 166}}},
|
||||
{Region: "Andorra", Group: "Premium TCP Europe", IPs: []net.IP{{188, 241, 82, 135}, {188, 241, 82, 136}, {188, 241, 82, 140}, {188, 241, 82, 142}, {188, 241, 82, 149}, {188, 241, 82, 151}, {188, 241, 82, 154}, {188, 241, 82, 160}, {188, 241, 82, 163}, {188, 241, 82, 165}}},
|
||||
{Region: "Argentina", Group: "Premium UDP USA", IPs: []net.IP{{190, 106, 130, 15}, {190, 106, 130, 16}, {190, 106, 130, 20}, {190, 106, 130, 21}, {190, 106, 130, 22}, {190, 106, 130, 23}, {190, 106, 130, 37}, {190, 106, 130, 39}, {190, 106, 130, 43}, {190, 106, 130, 44}}},
|
||||
{Region: "Argentina", Group: "Premium TCP USA", IPs: []net.IP{{190, 106, 130, 16}, {190, 106, 130, 17}, {190, 106, 130, 18}, {190, 106, 130, 26}, {190, 106, 130, 38}, {190, 106, 130, 40}, {190, 106, 130, 41}, {190, 106, 130, 42}, {190, 106, 130, 45}, {190, 106, 130, 52}}},
|
||||
{Region: "Armenia", Group: "Premium UDP Europe", IPs: []net.IP{{185, 253, 160, 131}, {185, 253, 160, 132}, {185, 253, 160, 134}, {185, 253, 160, 135}, {185, 253, 160, 136}, {185, 253, 160, 137}, {185, 253, 160, 138}, {185, 253, 160, 139}, {185, 253, 160, 141}, {185, 253, 160, 144}}},
|
||||
{Region: "Armenia", Group: "Premium TCP Europe", IPs: []net.IP{{185, 253, 160, 133}, {185, 253, 160, 134}, {185, 253, 160, 136}, {185, 253, 160, 137}, {185, 253, 160, 138}, {185, 253, 160, 139}, {185, 253, 160, 140}, {185, 253, 160, 141}, {185, 253, 160, 143}, {185, 253, 160, 144}}},
|
||||
{Region: "Australia", Group: "Premium TCP Asia", IPs: []net.IP{{43, 242, 68, 111}, {43, 242, 68, 113}, {43, 242, 68, 120}, {202, 60, 80, 16}, {202, 60, 80, 72}, {202, 60, 80, 96}, {202, 60, 80, 151}, {202, 60, 80, 172}, {202, 60, 80, 173}, {202, 60, 80, 178}}},
|
||||
{Region: "Australia", Group: "Premium UDP Asia", IPs: []net.IP{{43, 242, 68, 83}, {43, 242, 68, 94}, {202, 60, 80, 11}, {202, 60, 80, 21}, {202, 60, 80, 69}, {202, 60, 80, 107}, {202, 60, 80, 122}, {202, 60, 80, 123}, {202, 60, 80, 132}, {202, 60, 80, 162}}},
|
||||
{Region: "Austria", Group: "Premium TCP Europe", IPs: []net.IP{{89, 187, 168, 134}, {89, 187, 168, 139}, {89, 187, 168, 140}, {89, 187, 168, 145}, {89, 187, 168, 146}, {89, 187, 168, 150}, {89, 187, 168, 167}, {89, 187, 168, 169}, {89, 187, 168, 180}, {89, 187, 168, 182}}},
|
||||
{Region: "Austria", Group: "Premium UDP Europe", IPs: []net.IP{{89, 187, 168, 131}, {89, 187, 168, 132}, {89, 187, 168, 144}, {89, 187, 168, 147}, {89, 187, 168, 150}, {89, 187, 168, 151}, {89, 187, 168, 152}, {89, 187, 168, 163}, {89, 187, 168, 175}, {89, 187, 168, 177}}},
|
||||
{Region: "Bahamas", Group: "Premium TCP USA", IPs: []net.IP{{95, 181, 238, 131}, {95, 181, 238, 132}, {95, 181, 238, 137}, {95, 181, 238, 139}, {95, 181, 238, 140}, {95, 181, 238, 141}, {95, 181, 238, 144}, {95, 181, 238, 146}, {95, 181, 238, 147}, {95, 181, 238, 153}}},
|
||||
{Region: "Bahamas", Group: "Premium UDP USA", IPs: []net.IP{{95, 181, 238, 131}, {95, 181, 238, 133}, {95, 181, 238, 137}, {95, 181, 238, 138}, {95, 181, 238, 140}, {95, 181, 238, 141}, {95, 181, 238, 142}, {95, 181, 238, 146}, {95, 181, 238, 152}, {95, 181, 238, 153}}},
|
||||
{Region: "Bangladesh", Group: "Premium UDP Asia", IPs: []net.IP{{84, 252, 93, 131}, {84, 252, 93, 132}, {84, 252, 93, 133}, {84, 252, 93, 134}, {84, 252, 93, 137}, {84, 252, 93, 140}, {84, 252, 93, 142}, {84, 252, 93, 143}, {84, 252, 93, 144}, {84, 252, 93, 145}}},
|
||||
{Region: "Bangladesh", Group: "Premium TCP Asia", IPs: []net.IP{{84, 252, 93, 131}, {84, 252, 93, 132}, {84, 252, 93, 135}, {84, 252, 93, 136}, {84, 252, 93, 139}, {84, 252, 93, 140}, {84, 252, 93, 141}, {84, 252, 93, 142}, {84, 252, 93, 144}, {84, 252, 93, 145}}},
|
||||
{Region: "Belarus", Group: "Premium UDP Europe", IPs: []net.IP{{45, 132, 194, 5}, {45, 132, 194, 6}, {45, 132, 194, 10}, {45, 132, 194, 13}, {45, 132, 194, 14}, {45, 132, 194, 20}, {45, 132, 194, 22}, {45, 132, 194, 23}, {45, 132, 194, 38}, {45, 132, 194, 48}}},
|
||||
{Region: "Belarus", Group: "Premium TCP Europe", IPs: []net.IP{{45, 132, 194, 3}, {45, 132, 194, 5}, {45, 132, 194, 7}, {45, 132, 194, 10}, {45, 132, 194, 15}, {45, 132, 194, 35}, {45, 132, 194, 37}, {45, 132, 194, 40}, {45, 132, 194, 43}, {45, 132, 194, 47}}},
|
||||
{Region: "Belgium", Group: "Premium UDP Europe", IPs: []net.IP{{185, 210, 217, 14}, {185, 232, 21, 119}, {193, 9, 114, 211}, {193, 9, 114, 221}, {194, 110, 115, 201}, {194, 110, 115, 214}, {194, 110, 115, 216}, {194, 110, 115, 220}, {194, 110, 115, 221}, {194, 110, 115, 233}}},
|
||||
{Region: "Belgium", Group: "Premium TCP Europe", IPs: []net.IP{{5, 253, 205, 27}, {37, 120, 143, 58}, {37, 120, 143, 59}, {37, 120, 143, 165}, {185, 210, 217, 60}, {185, 232, 21, 115}, {185, 232, 21, 118}, {193, 9, 114, 228}, {194, 110, 115, 215}, {194, 110, 115, 232}}},
|
||||
{Region: "Bosnia and Herzegovina", Group: "Premium UDP Europe", IPs: []net.IP{{185, 99, 3, 57}, {185, 99, 3, 58}, {185, 99, 3, 72}, {185, 99, 3, 73}, {185, 99, 3, 74}, {185, 99, 3, 130}, {185, 99, 3, 131}, {185, 99, 3, 134}, {185, 99, 3, 135}, {185, 99, 3, 136}}},
|
||||
{Region: "Bosnia and Herzegovina", Group: "Premium TCP Europe", IPs: []net.IP{{185, 99, 3, 57}, {185, 99, 3, 58}, {185, 99, 3, 72}, {185, 99, 3, 73}, {185, 99, 3, 74}, {185, 99, 3, 130}, {185, 99, 3, 131}, {185, 99, 3, 134}, {185, 99, 3, 135}, {185, 99, 3, 136}}},
|
||||
{Region: "Brazil", Group: "Premium UDP USA", IPs: []net.IP{{188, 241, 177, 8}, {188, 241, 177, 10}, {188, 241, 177, 12}, {188, 241, 177, 13}, {188, 241, 177, 14}, {188, 241, 177, 30}, {188, 241, 177, 36}, {188, 241, 177, 42}, {188, 241, 177, 45}, {188, 241, 177, 46}}},
|
||||
{Region: "Brazil", Group: "Premium TCP USA", IPs: []net.IP{{188, 241, 177, 9}, {188, 241, 177, 12}, {188, 241, 177, 13}, {188, 241, 177, 19}, {188, 241, 177, 29}, {188, 241, 177, 35}, {188, 241, 177, 40}, {188, 241, 177, 41}, {188, 241, 177, 43}, {188, 241, 177, 44}}},
|
||||
{Region: "Bulgaria", Group: "Premium UDP Europe", IPs: []net.IP{{37, 120, 152, 100}, {37, 120, 152, 101}, {37, 120, 152, 102}, {37, 120, 152, 103}, {37, 120, 152, 104}, {37, 120, 152, 105}, {37, 120, 152, 106}, {37, 120, 152, 108}, {37, 120, 152, 109}, {37, 120, 152, 110}}},
|
||||
{Region: "Bulgaria", Group: "Premium TCP Europe", IPs: []net.IP{{37, 120, 152, 99}, {37, 120, 152, 100}, {37, 120, 152, 101}, {37, 120, 152, 102}, {37, 120, 152, 104}, {37, 120, 152, 105}, {37, 120, 152, 106}, {37, 120, 152, 107}, {37, 120, 152, 108}, {37, 120, 152, 109}}},
|
||||
{Region: "Cambodia", Group: "Premium TCP Asia", IPs: []net.IP{{188, 215, 235, 37}, {188, 215, 235, 41}, {188, 215, 235, 45}, {188, 215, 235, 46}, {188, 215, 235, 47}, {188, 215, 235, 49}, {188, 215, 235, 52}, {188, 215, 235, 53}, {188, 215, 235, 54}, {188, 215, 235, 57}}},
|
||||
{Region: "Cambodia", Group: "Premium UDP Asia", IPs: []net.IP{{188, 215, 235, 36}, {188, 215, 235, 37}, {188, 215, 235, 40}, {188, 215, 235, 41}, {188, 215, 235, 45}, {188, 215, 235, 47}, {188, 215, 235, 50}, {188, 215, 235, 51}, {188, 215, 235, 56}, {188, 215, 235, 57}}},
|
||||
{Region: "Canada", Group: "Premium TCP USA", IPs: []net.IP{{37, 120, 205, 4}, {37, 120, 205, 26}, {66, 115, 142, 171}, {89, 47, 234, 103}, {176, 113, 74, 22}, {176, 113, 74, 77}, {176, 113, 74, 135}, {176, 113, 74, 137}, {176, 113, 74, 201}, {176, 113, 74, 205}}},
|
||||
{Region: "Canada", Group: "Premium UDP USA", IPs: []net.IP{{37, 120, 205, 24}, {66, 115, 142, 162}, {66, 115, 142, 172}, {89, 47, 234, 85}, {89, 47, 234, 118}, {172, 98, 89, 146}, {172, 98, 89, 159}, {172, 98, 89, 172}, {176, 113, 74, 156}, {176, 113, 74, 206}}},
|
||||
{Region: "China", Group: "Premium TCP Asia", IPs: []net.IP{{188, 241, 80, 131}, {188, 241, 80, 132}, {188, 241, 80, 133}, {188, 241, 80, 134}, {188, 241, 80, 136}, {188, 241, 80, 137}, {188, 241, 80, 139}, {188, 241, 80, 140}, {188, 241, 80, 141}, {188, 241, 80, 142}}},
|
||||
{Region: "China", Group: "Premium UDP Asia", IPs: []net.IP{{188, 241, 80, 132}, {188, 241, 80, 133}, {188, 241, 80, 134}, {188, 241, 80, 135}, {188, 241, 80, 136}, {188, 241, 80, 137}, {188, 241, 80, 138}, {188, 241, 80, 139}, {188, 241, 80, 140}, {188, 241, 80, 141}}},
|
||||
{Region: "Costa Rica", Group: "Premium TCP USA", IPs: []net.IP{{143, 202, 160, 67}, {143, 202, 160, 68}, {143, 202, 160, 69}, {143, 202, 160, 70}, {143, 202, 160, 72}, {143, 202, 160, 73}, {143, 202, 160, 74}, {143, 202, 160, 75}, {143, 202, 160, 76}, {143, 202, 160, 78}}},
|
||||
{Region: "Cyprus", Group: "Premium UDP Europe", IPs: []net.IP{{185, 253, 162, 131}, {185, 253, 162, 134}, {185, 253, 162, 136}, {185, 253, 162, 137}, {185, 253, 162, 139}, {185, 253, 162, 140}, {185, 253, 162, 141}, {185, 253, 162, 142}, {185, 253, 162, 143}, {185, 253, 162, 144}}},
|
||||
{Region: "Cyprus", Group: "Premium TCP Europe", IPs: []net.IP{{185, 253, 162, 131}, {185, 253, 162, 132}, {185, 253, 162, 134}, {185, 253, 162, 135}, {185, 253, 162, 136}, {185, 253, 162, 139}, {185, 253, 162, 140}, {185, 253, 162, 141}, {185, 253, 162, 143}, {185, 253, 162, 144}}},
|
||||
{Region: "Czech Republic", Group: "Premium TCP Europe", IPs: []net.IP{{185, 216, 35, 231}, {185, 216, 35, 236}, {195, 181, 161, 3}, {195, 181, 161, 7}, {195, 181, 161, 11}, {195, 181, 161, 14}, {195, 181, 161, 15}, {195, 181, 161, 16}, {195, 181, 161, 17}, {195, 181, 161, 22}}},
|
||||
{Region: "Czech Republic", Group: "Premium UDP Europe", IPs: []net.IP{{185, 216, 35, 227}, {185, 216, 35, 235}, {195, 181, 161, 3}, {195, 181, 161, 5}, {195, 181, 161, 7}, {195, 181, 161, 11}, {195, 181, 161, 12}, {195, 181, 161, 14}, {195, 181, 161, 15}, {195, 181, 161, 20}}},
|
||||
{Region: "Denmark", Group: "Premium TCP Europe", IPs: []net.IP{{37, 120, 145, 86}, {37, 120, 194, 45}, {37, 120, 194, 46}, {37, 120, 194, 61}, {95, 174, 65, 172}, {95, 174, 65, 174}, {185, 206, 224, 237}, {185, 206, 224, 244}, {185, 206, 224, 245}, {185, 206, 224, 246}}},
|
||||
{Region: "Denmark", Group: "Premium UDP Europe", IPs: []net.IP{{37, 120, 194, 56}, {37, 120, 194, 61}, {95, 174, 65, 164}, {95, 174, 65, 165}, {95, 174, 65, 167}, {95, 174, 65, 172}, {185, 206, 224, 235}, {185, 206, 224, 244}, {185, 206, 224, 247}, {185, 206, 224, 249}}},
|
||||
{Region: "Egypt", Group: "Premium TCP Europe", IPs: []net.IP{{188, 214, 122, 37}, {188, 214, 122, 39}, {188, 214, 122, 40}, {188, 214, 122, 51}, {188, 214, 122, 53}, {188, 214, 122, 54}, {188, 214, 122, 56}, {188, 214, 122, 58}, {188, 214, 122, 59}, {188, 214, 122, 62}}},
|
||||
{Region: "Egypt", Group: "Premium UDP Europe", IPs: []net.IP{{188, 214, 122, 35}, {188, 214, 122, 38}, {188, 214, 122, 39}, {188, 214, 122, 44}, {188, 214, 122, 46}, {188, 214, 122, 48}, {188, 214, 122, 50}, {188, 214, 122, 52}, {188, 214, 122, 54}, {188, 214, 122, 58}}},
|
||||
{Region: "Estonia", Group: "Premium TCP Europe", IPs: []net.IP{{95, 153, 31, 82}, {95, 153, 31, 83}, {95, 153, 31, 84}, {95, 153, 31, 85}, {95, 153, 31, 86}, {95, 153, 31, 87}, {95, 153, 31, 89}, {95, 153, 31, 90}, {95, 153, 31, 92}, {95, 153, 31, 93}}},
|
||||
{Region: "Estonia", Group: "Premium UDP Europe", IPs: []net.IP{{95, 153, 31, 83}, {95, 153, 31, 84}, {95, 153, 31, 85}, {95, 153, 31, 86}, {95, 153, 31, 87}, {95, 153, 31, 88}, {95, 153, 31, 90}, {95, 153, 31, 92}, {95, 153, 31, 93}, {95, 153, 31, 94}}},
|
||||
{Region: "Finland", Group: "Premium UDP Europe", IPs: []net.IP{{188, 126, 89, 133}, {188, 126, 89, 134}, {188, 126, 89, 137}, {188, 126, 89, 138}, {188, 126, 89, 143}, {188, 126, 89, 144}, {188, 126, 89, 149}, {188, 126, 89, 150}, {188, 126, 89, 152}, {188, 126, 89, 154}}},
|
||||
{Region: "Finland", Group: "Premium TCP Europe", IPs: []net.IP{{188, 126, 89, 131}, {188, 126, 89, 132}, {188, 126, 89, 133}, {188, 126, 89, 137}, {188, 126, 89, 138}, {188, 126, 89, 142}, {188, 126, 89, 145}, {188, 126, 89, 153}, {188, 126, 89, 154}, {188, 126, 89, 155}}},
|
||||
{Region: "France", Group: "Premium UDP Europe", IPs: []net.IP{{84, 17, 60, 31}, {84, 17, 60, 93}, {84, 17, 60, 136}, {84, 17, 60, 173}, {84, 17, 60, 177}, {84, 17, 60, 184}, {84, 17, 61, 10}, {84, 17, 61, 92}, {84, 17, 61, 155}, {138, 199, 26, 174}}},
|
||||
{Region: "France", Group: "Premium TCP Europe", IPs: []net.IP{{84, 17, 60, 40}, {84, 17, 60, 85}, {84, 17, 60, 98}, {84, 17, 60, 150}, {84, 17, 60, 178}, {84, 17, 61, 5}, {84, 17, 61, 212}, {138, 199, 26, 76}, {138, 199, 26, 147}, {138, 199, 26, 219}}},
|
||||
{Region: "Georgia", Group: "Premium TCP Europe", IPs: []net.IP{{95, 181, 236, 131}, {95, 181, 236, 132}, {95, 181, 236, 133}, {95, 181, 236, 135}, {95, 181, 236, 137}, {95, 181, 236, 138}, {95, 181, 236, 139}, {95, 181, 236, 140}, {95, 181, 236, 142}, {95, 181, 236, 144}}},
|
||||
{Region: "Georgia", Group: "Premium UDP Europe", IPs: []net.IP{{95, 181, 236, 131}, {95, 181, 236, 132}, {95, 181, 236, 133}, {95, 181, 236, 134}, {95, 181, 236, 138}, {95, 181, 236, 139}, {95, 181, 236, 140}, {95, 181, 236, 141}, {95, 181, 236, 143}, {95, 181, 236, 144}}},
|
||||
{Region: "Germany", Group: "Premium TCP Europe", IPs: []net.IP{{37, 120, 217, 30}, {37, 120, 217, 61}, {84, 17, 48, 13}, {84, 17, 48, 18}, {84, 17, 48, 22}, {84, 17, 48, 81}, {84, 17, 48, 185}, {84, 17, 49, 242}, {154, 28, 188, 128}, {154, 28, 188, 167}}},
|
||||
{Region: "Germany", Group: "Premium UDP Europe", IPs: []net.IP{{37, 120, 217, 38}, {84, 17, 48, 55}, {84, 17, 48, 140}, {84, 17, 48, 188}, {84, 17, 48, 192}, {84, 17, 48, 205}, {84, 17, 49, 128}, {84, 17, 49, 191}, {84, 17, 49, 236}, {154, 28, 188, 82}}},
|
||||
{Region: "Greece", Group: "Premium UDP Europe", IPs: []net.IP{{154, 57, 3, 131}, {154, 57, 3, 133}, {154, 57, 3, 136}, {154, 57, 3, 137}, {154, 57, 3, 140}, {154, 57, 3, 141}, {188, 123, 126, 167}, {188, 123, 126, 171}, {188, 123, 126, 175}, {188, 123, 126, 176}}},
|
||||
{Region: "Greece", Group: "Premium TCP Europe", IPs: []net.IP{{154, 57, 3, 131}, {154, 57, 3, 133}, {154, 57, 3, 134}, {154, 57, 3, 137}, {154, 57, 3, 139}, {188, 123, 126, 170}, {188, 123, 126, 172}, {188, 123, 126, 173}, {188, 123, 126, 175}, {188, 123, 126, 177}}},
|
||||
{Region: "Greenland", Group: "Premium UDP Europe", IPs: []net.IP{{91, 90, 120, 3}, {91, 90, 120, 5}, {91, 90, 120, 6}, {91, 90, 120, 7}, {91, 90, 120, 8}, {91, 90, 120, 9}, {91, 90, 120, 10}, {91, 90, 120, 14}, {91, 90, 120, 15}, {91, 90, 120, 17}}},
|
||||
{Region: "Greenland", Group: "Premium TCP Europe", IPs: []net.IP{{91, 90, 120, 3}, {91, 90, 120, 4}, {91, 90, 120, 5}, {91, 90, 120, 6}, {91, 90, 120, 9}, {91, 90, 120, 10}, {91, 90, 120, 11}, {91, 90, 120, 13}, {91, 90, 120, 14}, {91, 90, 120, 17}}},
|
||||
{Region: "Hong Kong", Group: "Premium TCP Asia", IPs: []net.IP{{84, 17, 56, 34}, {84, 17, 56, 41}, {84, 17, 56, 133}, {84, 17, 56, 147}, {84, 17, 56, 148}, {84, 17, 56, 153}, {84, 17, 56, 163}, {84, 17, 56, 167}, {84, 17, 56, 171}, {84, 17, 56, 184}}},
|
||||
{Region: "Hong Kong", Group: "Premium UDP Asia", IPs: []net.IP{{84, 17, 56, 39}, {84, 17, 56, 52}, {84, 17, 56, 55}, {84, 17, 56, 135}, {84, 17, 56, 136}, {84, 17, 56, 145}, {84, 17, 56, 149}, {84, 17, 56, 165}, {84, 17, 56, 167}, {84, 17, 56, 170}}},
|
||||
{Region: "Hungary", Group: "Premium TCP Europe", IPs: []net.IP{{86, 106, 74, 243}, {86, 106, 74, 244}, {86, 106, 74, 247}, {86, 106, 74, 251}, {86, 106, 74, 252}, {86, 106, 74, 253}, {185, 189, 114, 117}, {185, 189, 114, 119}, {185, 189, 114, 124}, {185, 189, 114, 126}}},
|
||||
{Region: "Hungary", Group: "Premium UDP Europe", IPs: []net.IP{{86, 106, 74, 252}, {86, 106, 74, 253}, {86, 106, 74, 254}, {185, 189, 114, 116}, {185, 189, 114, 117}, {185, 189, 114, 118}, {185, 189, 114, 121}, {185, 189, 114, 123}, {185, 189, 114, 125}, {185, 189, 114, 126}}},
|
||||
{Region: "Iceland", Group: "Premium UDP Europe", IPs: []net.IP{{45, 133, 193, 4}, {45, 133, 193, 5}, {45, 133, 193, 6}, {45, 133, 193, 8}, {45, 133, 193, 9}, {45, 133, 193, 10}, {45, 133, 193, 11}, {45, 133, 193, 12}, {45, 133, 193, 13}, {45, 133, 193, 14}}},
|
||||
{Region: "Iceland", Group: "Premium TCP Europe", IPs: []net.IP{{45, 133, 193, 3}, {45, 133, 193, 4}, {45, 133, 193, 5}, {45, 133, 193, 6}, {45, 133, 193, 7}, {45, 133, 193, 8}, {45, 133, 193, 9}, {45, 133, 193, 10}, {45, 133, 193, 11}, {45, 133, 193, 13}}},
|
||||
{Region: "India", Group: "Premium TCP Europe", IPs: []net.IP{{43, 241, 71, 117}, {43, 241, 71, 118}, {43, 241, 71, 122}, {43, 241, 71, 123}, {43, 241, 71, 125}, {43, 241, 71, 148}, {43, 241, 71, 151}, {43, 241, 71, 152}, {43, 241, 71, 154}, {43, 241, 71, 156}}},
|
||||
{Region: "India", Group: "Premium UDP Europe", IPs: []net.IP{{43, 241, 71, 115}, {43, 241, 71, 119}, {43, 241, 71, 123}, {43, 241, 71, 124}, {43, 241, 71, 148}, {43, 241, 71, 149}, {43, 241, 71, 151}, {43, 241, 71, 153}, {43, 241, 71, 155}, {43, 241, 71, 157}}},
|
||||
{Region: "Indonesia", Group: "Premium TCP Asia", IPs: []net.IP{{113, 20, 29, 243}, {113, 20, 29, 244}, {113, 20, 29, 245}, {113, 20, 29, 246}, {113, 20, 29, 247}, {113, 20, 29, 249}, {113, 20, 29, 250}, {113, 20, 29, 252}, {113, 20, 29, 253}, {113, 20, 29, 254}}},
|
||||
{Region: "Indonesia", Group: "Premium UDP Asia", IPs: []net.IP{{113, 20, 29, 243}, {113, 20, 29, 244}, {113, 20, 29, 245}, {113, 20, 29, 246}, {113, 20, 29, 247}, {113, 20, 29, 248}, {113, 20, 29, 249}, {113, 20, 29, 250}, {113, 20, 29, 251}, {113, 20, 29, 253}}},
|
||||
{Region: "Iran", Group: "Premium UDP Asia", IPs: []net.IP{{62, 133, 46, 3}, {62, 133, 46, 5}, {62, 133, 46, 7}, {62, 133, 46, 8}, {62, 133, 46, 9}, {62, 133, 46, 11}, {62, 133, 46, 12}, {62, 133, 46, 13}, {62, 133, 46, 14}, {62, 133, 46, 15}}},
|
||||
{Region: "Iran", Group: "Premium TCP Asia", IPs: []net.IP{{62, 133, 46, 3}, {62, 133, 46, 6}, {62, 133, 46, 7}, {62, 133, 46, 8}, {62, 133, 46, 9}, {62, 133, 46, 10}, {62, 133, 46, 11}, {62, 133, 46, 12}, {62, 133, 46, 14}, {62, 133, 46, 15}}},
|
||||
{Region: "Ireland", Group: "Premium UDP Europe", IPs: []net.IP{{77, 81, 139, 35}, {77, 81, 139, 40}, {77, 81, 139, 41}, {77, 81, 139, 45}, {84, 247, 48, 3}, {84, 247, 48, 8}, {84, 247, 48, 10}, {84, 247, 48, 19}, {84, 247, 48, 21}, {84, 247, 48, 29}}},
|
||||
{Region: "Ireland", Group: "Premium TCP Europe", IPs: []net.IP{{77, 81, 139, 40}, {84, 247, 48, 3}, {84, 247, 48, 4}, {84, 247, 48, 7}, {84, 247, 48, 10}, {84, 247, 48, 20}, {84, 247, 48, 23}, {84, 247, 48, 24}, {84, 247, 48, 26}, {84, 247, 48, 30}}},
|
||||
{Region: "Isle of Man", Group: "Premium TCP Europe", IPs: []net.IP{{91, 90, 124, 147}, {91, 90, 124, 148}, {91, 90, 124, 149}, {91, 90, 124, 152}, {91, 90, 124, 153}, {91, 90, 124, 155}, {91, 90, 124, 156}, {91, 90, 124, 157}, {91, 90, 124, 158}, {91, 90, 124, 159}}},
|
||||
{Region: "Isle of Man", Group: "Premium UDP Europe", IPs: []net.IP{{91, 90, 124, 148}, {91, 90, 124, 149}, {91, 90, 124, 150}, {91, 90, 124, 152}, {91, 90, 124, 153}, {91, 90, 124, 154}, {91, 90, 124, 155}, {91, 90, 124, 157}, {91, 90, 124, 158}, {91, 90, 124, 159}}},
|
||||
{Region: "Israel", Group: "Premium TCP Europe", IPs: []net.IP{{160, 116, 0, 163}, {160, 116, 0, 164}, {160, 116, 0, 165}, {160, 116, 0, 166}, {160, 116, 0, 168}, {160, 116, 0, 169}, {160, 116, 0, 170}, {160, 116, 0, 171}, {160, 116, 0, 172}, {160, 116, 0, 174}}},
|
||||
{Region: "Israel", Group: "Premium UDP Europe", IPs: []net.IP{{160, 116, 0, 163}, {160, 116, 0, 164}, {160, 116, 0, 165}, {160, 116, 0, 166}, {160, 116, 0, 167}, {160, 116, 0, 168}, {160, 116, 0, 169}, {160, 116, 0, 170}, {160, 116, 0, 171}, {160, 116, 0, 172}}},
|
||||
{Region: "Italy", Group: "Premium UDP Europe", IPs: []net.IP{{84, 17, 58, 21}, {84, 17, 58, 94}, {87, 101, 94, 68}, {185, 217, 71, 132}, {185, 217, 71, 135}, {185, 217, 71, 154}, {212, 102, 55, 97}, {212, 102, 55, 111}, {212, 102, 55, 113}, {212, 102, 55, 118}}},
|
||||
{Region: "Italy", Group: "Premium TCP Europe", IPs: []net.IP{{84, 17, 58, 13}, {84, 17, 58, 22}, {84, 17, 58, 23}, {84, 17, 58, 110}, {185, 217, 71, 134}, {185, 217, 71, 155}, {212, 102, 55, 97}, {212, 102, 55, 104}, {212, 102, 55, 114}, {212, 102, 55, 118}}},
|
||||
{Region: "Japan", Group: "Premium UDP Asia", IPs: []net.IP{{156, 146, 35, 7}, {156, 146, 35, 8}, {156, 146, 35, 10}, {156, 146, 35, 12}, {156, 146, 35, 13}, {156, 146, 35, 14}, {156, 146, 35, 15}, {156, 146, 35, 16}, {156, 146, 35, 22}, {156, 146, 35, 49}}},
|
||||
{Region: "Japan", Group: "Premium TCP Asia", IPs: []net.IP{{156, 146, 35, 4}, {156, 146, 35, 6}, {156, 146, 35, 9}, {156, 146, 35, 12}, {156, 146, 35, 16}, {156, 146, 35, 21}, {156, 146, 35, 22}, {156, 146, 35, 28}, {156, 146, 35, 29}, {156, 146, 35, 49}}},
|
||||
{Region: "Kazakhstan", Group: "Premium UDP Europe", IPs: []net.IP{{62, 133, 47, 131}, {62, 133, 47, 132}, {62, 133, 47, 133}, {62, 133, 47, 134}, {62, 133, 47, 135}, {62, 133, 47, 137}, {62, 133, 47, 139}, {62, 133, 47, 140}, {62, 133, 47, 143}, {62, 133, 47, 144}}},
|
||||
{Region: "Kazakhstan", Group: "Premium TCP Europe", IPs: []net.IP{{62, 133, 47, 132}, {62, 133, 47, 133}, {62, 133, 47, 135}, {62, 133, 47, 137}, {62, 133, 47, 138}, {62, 133, 47, 140}, {62, 133, 47, 141}, {62, 133, 47, 142}, {62, 133, 47, 143}, {62, 133, 47, 144}}},
|
||||
{Region: "Kenya", Group: "Premium TCP Asia", IPs: []net.IP{{62, 12, 118, 195}, {62, 12, 118, 196}, {62, 12, 118, 197}, {62, 12, 118, 198}, {62, 12, 118, 199}, {62, 12, 118, 200}, {62, 12, 118, 201}, {62, 12, 118, 202}, {62, 12, 118, 203}, {62, 12, 118, 204}}},
|
||||
{Region: "Kenya", Group: "Premium UDP Asia", IPs: []net.IP{{62, 12, 118, 195}, {62, 12, 118, 196}, {62, 12, 118, 197}, {62, 12, 118, 198}, {62, 12, 118, 199}, {62, 12, 118, 200}, {62, 12, 118, 201}, {62, 12, 118, 202}, {62, 12, 118, 203}, {62, 12, 118, 204}}},
|
||||
{Region: "Korea", Group: "Premium TCP Asia", IPs: []net.IP{{27, 255, 75, 227}, {27, 255, 75, 228}, {27, 255, 75, 229}, {27, 255, 75, 238}, {27, 255, 75, 243}, {27, 255, 75, 245}, {27, 255, 75, 246}, {27, 255, 75, 249}, {27, 255, 75, 252}, {27, 255, 75, 254}}},
|
||||
{Region: "Korea", Group: "Premium UDP Asia", IPs: []net.IP{{27, 255, 75, 227}, {27, 255, 75, 229}, {27, 255, 75, 231}, {27, 255, 75, 232}, {27, 255, 75, 234}, {27, 255, 75, 235}, {27, 255, 75, 236}, {27, 255, 75, 245}, {27, 255, 75, 247}, {27, 255, 75, 253}}},
|
||||
{Region: "Latvia", Group: "Premium UDP Europe", IPs: []net.IP{{109, 248, 148, 245}, {109, 248, 148, 247}, {109, 248, 148, 252}, {109, 248, 148, 254}, {109, 248, 149, 20}, {109, 248, 149, 21}, {109, 248, 149, 27}, {109, 248, 149, 28}, {109, 248, 149, 29}, {109, 248, 149, 30}}},
|
||||
{Region: "Latvia", Group: "Premium TCP Europe", IPs: []net.IP{{109, 248, 148, 243}, {109, 248, 148, 244}, {109, 248, 148, 252}, {109, 248, 149, 19}, {109, 248, 149, 23}, {109, 248, 149, 25}, {109, 248, 149, 27}, {109, 248, 149, 28}, {109, 248, 149, 29}, {109, 248, 149, 30}}},
|
||||
{Region: "Liechtenstein", Group: "Premium TCP Europe", IPs: []net.IP{{91, 90, 122, 131}, {91, 90, 122, 133}, {91, 90, 122, 134}, {91, 90, 122, 135}, {91, 90, 122, 136}, {91, 90, 122, 137}, {91, 90, 122, 142}, {91, 90, 122, 143}, {91, 90, 122, 144}, {91, 90, 122, 145}}},
|
||||
{Region: "Liechtenstein", Group: "Premium UDP Europe", IPs: []net.IP{{91, 90, 122, 131}, {91, 90, 122, 132}, {91, 90, 122, 134}, {91, 90, 122, 136}, {91, 90, 122, 138}, {91, 90, 122, 141}, {91, 90, 122, 142}, {91, 90, 122, 143}, {91, 90, 122, 144}, {91, 90, 122, 145}}},
|
||||
{Region: "Lithuania", Group: "Premium TCP Europe", IPs: []net.IP{{85, 206, 162, 209}, {85, 206, 162, 211}, {85, 206, 162, 216}, {85, 206, 162, 217}, {85, 206, 162, 218}, {85, 206, 162, 221}, {85, 206, 165, 25}, {85, 206, 165, 26}, {85, 206, 165, 30}, {85, 206, 165, 31}}},
|
||||
{Region: "Lithuania", Group: "Premium UDP Europe", IPs: []net.IP{{85, 206, 162, 209}, {85, 206, 162, 211}, {85, 206, 162, 216}, {85, 206, 162, 217}, {85, 206, 162, 219}, {85, 206, 162, 221}, {85, 206, 165, 19}, {85, 206, 165, 20}, {85, 206, 165, 23}, {85, 206, 165, 30}}},
|
||||
{Region: "Luxembourg", Group: "Premium UDP Europe", IPs: []net.IP{{5, 253, 204, 19}, {5, 253, 204, 20}, {5, 253, 204, 22}, {5, 253, 204, 23}, {5, 253, 204, 24}, {5, 253, 204, 27}, {5, 253, 204, 29}, {5, 253, 204, 35}, {5, 253, 204, 44}, {5, 253, 204, 45}}},
|
||||
{Region: "Luxembourg", Group: "Premium TCP Europe", IPs: []net.IP{{5, 253, 204, 9}, {5, 253, 204, 10}, {5, 253, 204, 24}, {5, 253, 204, 28}, {5, 253, 204, 30}, {5, 253, 204, 35}, {5, 253, 204, 38}, {5, 253, 204, 39}, {5, 253, 204, 41}, {5, 253, 204, 46}}},
|
||||
{Region: "Macao", Group: "Premium TCP Asia", IPs: []net.IP{{84, 252, 92, 131}, {84, 252, 92, 133}, {84, 252, 92, 134}, {84, 252, 92, 135}, {84, 252, 92, 136}, {84, 252, 92, 139}, {84, 252, 92, 141}, {84, 252, 92, 143}, {84, 252, 92, 144}, {84, 252, 92, 145}}},
|
||||
{Region: "Macao", Group: "Premium UDP Asia", IPs: []net.IP{{84, 252, 92, 131}, {84, 252, 92, 132}, {84, 252, 92, 133}, {84, 252, 92, 138}, {84, 252, 92, 140}, {84, 252, 92, 141}, {84, 252, 92, 142}, {84, 252, 92, 143}, {84, 252, 92, 144}, {84, 252, 92, 145}}},
|
||||
{Region: "Macedonia", Group: "Premium UDP Europe", IPs: []net.IP{{185, 225, 28, 3}, {185, 225, 28, 4}, {185, 225, 28, 5}, {185, 225, 28, 6}, {185, 225, 28, 7}, {185, 225, 28, 8}, {185, 225, 28, 9}, {185, 225, 28, 10}, {185, 225, 28, 11}, {185, 225, 28, 12}}},
|
||||
{Region: "Macedonia", Group: "Premium TCP Europe", IPs: []net.IP{{185, 225, 28, 3}, {185, 225, 28, 4}, {185, 225, 28, 5}, {185, 225, 28, 6}, {185, 225, 28, 7}, {185, 225, 28, 8}, {185, 225, 28, 9}, {185, 225, 28, 10}, {185, 225, 28, 11}, {185, 225, 28, 12}}},
|
||||
{Region: "Malaysia", Group: "Premium TCP Asia", IPs: []net.IP{{139, 5, 177, 69}, {139, 5, 177, 70}, {139, 5, 177, 71}, {139, 5, 177, 72}, {139, 5, 177, 73}, {139, 5, 177, 74}, {139, 5, 177, 75}, {139, 5, 177, 76}, {139, 5, 177, 77}, {139, 5, 177, 78}}},
|
||||
{Region: "Malaysia", Group: "Premium UDP Asia", IPs: []net.IP{{139, 5, 177, 69}, {139, 5, 177, 70}, {139, 5, 177, 71}, {139, 5, 177, 72}, {139, 5, 177, 73}, {139, 5, 177, 74}, {139, 5, 177, 75}, {139, 5, 177, 76}, {139, 5, 177, 77}, {139, 5, 177, 78}}},
|
||||
{Region: "Malta", Group: "Premium UDP Europe", IPs: []net.IP{{176, 125, 230, 131}, {176, 125, 230, 132}, {176, 125, 230, 133}, {176, 125, 230, 135}, {176, 125, 230, 136}, {176, 125, 230, 140}, {176, 125, 230, 141}, {176, 125, 230, 142}, {176, 125, 230, 143}, {176, 125, 230, 145}}},
|
||||
{Region: "Malta", Group: "Premium TCP Europe", IPs: []net.IP{{176, 125, 230, 132}, {176, 125, 230, 133}, {176, 125, 230, 134}, {176, 125, 230, 135}, {176, 125, 230, 136}, {176, 125, 230, 138}, {176, 125, 230, 140}, {176, 125, 230, 142}, {176, 125, 230, 143}, {176, 125, 230, 144}}},
|
||||
{Region: "Mexico", Group: "Premium UDP USA", IPs: []net.IP{{77, 81, 142, 132}, {77, 81, 142, 136}, {77, 81, 142, 137}, {77, 81, 142, 139}, {77, 81, 142, 140}, {77, 81, 142, 143}, {77, 81, 142, 146}, {77, 81, 142, 149}, {77, 81, 142, 154}, {77, 81, 142, 155}}},
|
||||
{Region: "Mexico", Group: "Premium TCP USA", IPs: []net.IP{{77, 81, 142, 130}, {77, 81, 142, 132}, {77, 81, 142, 134}, {77, 81, 142, 136}, {77, 81, 142, 138}, {77, 81, 142, 142}, {77, 81, 142, 146}, {77, 81, 142, 150}, {77, 81, 142, 154}, {77, 81, 142, 155}}},
|
||||
{Region: "Moldova", Group: "Premium UDP Europe", IPs: []net.IP{{178, 175, 130, 243}, {178, 175, 130, 244}, {178, 175, 130, 245}, {178, 175, 130, 246}, {178, 175, 130, 250}, {178, 175, 130, 251}, {178, 175, 130, 252}, {178, 175, 130, 254}, {178, 175, 142, 133}, {178, 175, 142, 134}}},
|
||||
{Region: "Moldova", Group: "Premium TCP Europe", IPs: []net.IP{{178, 175, 130, 243}, {178, 175, 130, 244}, {178, 175, 130, 245}, {178, 175, 130, 246}, {178, 175, 130, 250}, {178, 175, 130, 252}, {178, 175, 130, 253}, {178, 175, 130, 254}, {178, 175, 142, 132}, {178, 175, 142, 134}}},
|
||||
{Region: "Monaco", Group: "Premium UDP Europe", IPs: []net.IP{{95, 181, 233, 131}, {95, 181, 233, 134}, {95, 181, 233, 135}, {95, 181, 233, 136}, {95, 181, 233, 137}, {95, 181, 233, 138}, {95, 181, 233, 140}, {95, 181, 233, 141}, {95, 181, 233, 142}, {95, 181, 233, 143}}},
|
||||
{Region: "Monaco", Group: "Premium TCP Europe", IPs: []net.IP{{95, 181, 233, 131}, {95, 181, 233, 132}, {95, 181, 233, 134}, {95, 181, 233, 136}, {95, 181, 233, 137}, {95, 181, 233, 140}, {95, 181, 233, 141}, {95, 181, 233, 142}, {95, 181, 233, 143}, {95, 181, 233, 144}}},
|
||||
{Region: "Mongolia", Group: "Premium TCP Asia", IPs: []net.IP{{185, 253, 163, 132}, {185, 253, 163, 134}, {185, 253, 163, 136}, {185, 253, 163, 137}, {185, 253, 163, 138}, {185, 253, 163, 139}, {185, 253, 163, 140}, {185, 253, 163, 142}, {185, 253, 163, 144}, {185, 253, 163, 145}}},
|
||||
{Region: "Mongolia", Group: "Premium UDP Asia", IPs: []net.IP{{185, 253, 163, 131}, {185, 253, 163, 134}, {185, 253, 163, 136}, {185, 253, 163, 137}, {185, 253, 163, 139}, {185, 253, 163, 140}, {185, 253, 163, 141}, {185, 253, 163, 142}, {185, 253, 163, 144}, {185, 253, 163, 145}}},
|
||||
{Region: "Montenegro", Group: "Premium UDP Europe", IPs: []net.IP{{176, 125, 229, 132}, {176, 125, 229, 133}, {176, 125, 229, 134}, {176, 125, 229, 135}, {176, 125, 229, 137}, {176, 125, 229, 139}, {176, 125, 229, 140}, {176, 125, 229, 141}, {176, 125, 229, 142}, {176, 125, 229, 145}}},
|
||||
{Region: "Montenegro", Group: "Premium TCP Europe", IPs: []net.IP{{176, 125, 229, 131}, {176, 125, 229, 134}, {176, 125, 229, 135}, {176, 125, 229, 137}, {176, 125, 229, 138}, {176, 125, 229, 140}, {176, 125, 229, 141}, {176, 125, 229, 142}, {176, 125, 229, 143}, {176, 125, 229, 145}}},
|
||||
{Region: "Morocco", Group: "Premium UDP Europe", IPs: []net.IP{{95, 181, 232, 131}, {95, 181, 232, 132}, {95, 181, 232, 134}, {95, 181, 232, 135}, {95, 181, 232, 139}, {95, 181, 232, 140}, {95, 181, 232, 141}, {95, 181, 232, 142}, {95, 181, 232, 143}, {95, 181, 232, 144}}},
|
||||
{Region: "Morocco", Group: "Premium TCP Europe", IPs: []net.IP{{95, 181, 232, 131}, {95, 181, 232, 133}, {95, 181, 232, 134}, {95, 181, 232, 135}, {95, 181, 232, 137}, {95, 181, 232, 138}, {95, 181, 232, 139}, {95, 181, 232, 141}, {95, 181, 232, 142}, {95, 181, 232, 143}}},
|
||||
{Region: "Netherlands", Group: "Premium TCP Europe", IPs: []net.IP{{84, 17, 47, 2}, {84, 17, 47, 3}, {84, 17, 47, 9}, {84, 17, 47, 15}, {84, 17, 47, 16}, {84, 17, 47, 54}, {84, 17, 47, 69}, {84, 17, 47, 81}, {84, 17, 47, 111}, {195, 181, 172, 72}}},
|
||||
{Region: "Netherlands", Group: "Premium UDP Europe", IPs: []net.IP{{84, 17, 47, 9}, {84, 17, 47, 34}, {84, 17, 47, 52}, {84, 17, 47, 53}, {84, 17, 47, 66}, {84, 17, 47, 73}, {84, 17, 47, 95}, {139, 28, 217, 222}, {195, 181, 172, 67}, {195, 181, 172, 68}}},
|
||||
{Region: "New Zealand", Group: "Premium TCP Asia", IPs: []net.IP{{114, 141, 194, 2}, {114, 141, 194, 3}, {114, 141, 194, 4}, {114, 141, 194, 5}, {114, 141, 194, 7}, {114, 141, 194, 8}, {114, 141, 194, 10}, {114, 141, 194, 12}, {114, 141, 194, 13}, {114, 141, 194, 14}}},
|
||||
{Region: "New Zealand", Group: "Premium UDP Asia", IPs: []net.IP{{114, 141, 194, 2}, {114, 141, 194, 3}, {114, 141, 194, 5}, {114, 141, 194, 6}, {114, 141, 194, 7}, {114, 141, 194, 8}, {114, 141, 194, 9}, {114, 141, 194, 11}, {114, 141, 194, 12}, {114, 141, 194, 13}}},
|
||||
{Region: "Nigeria", Group: "Premium TCP Europe", IPs: []net.IP{{102, 165, 25, 68}, {102, 165, 25, 69}, {102, 165, 25, 70}, {102, 165, 25, 71}, {102, 165, 25, 72}, {102, 165, 25, 73}, {102, 165, 25, 74}, {102, 165, 25, 76}, {102, 165, 25, 77}, {102, 165, 25, 78}}},
|
||||
{Region: "Nigeria", Group: "Premium UDP Europe", IPs: []net.IP{{102, 165, 25, 68}, {102, 165, 25, 69}, {102, 165, 25, 70}, {102, 165, 25, 71}, {102, 165, 25, 72}, {102, 165, 25, 74}, {102, 165, 25, 75}, {102, 165, 25, 76}, {102, 165, 25, 77}, {102, 165, 25, 78}}},
|
||||
{Region: "Norway", Group: "Premium UDP Europe", IPs: []net.IP{{45, 12, 223, 137}, {45, 12, 223, 140}, {45, 12, 223, 141}, {82, 102, 27, 92}, {185, 206, 225, 29}, {185, 206, 225, 231}, {185, 206, 225, 235}, {185, 253, 97, 248}, {185, 253, 97, 249}, {185, 253, 97, 250}}},
|
||||
{Region: "Norway", Group: "Premium TCP Europe", IPs: []net.IP{{185, 206, 225, 229}, {185, 206, 225, 230}, {185, 206, 225, 231}, {185, 206, 225, 232}, {185, 206, 225, 234}, {185, 253, 97, 236}, {185, 253, 97, 243}, {185, 253, 97, 245}, {185, 253, 97, 247}, {185, 253, 97, 251}}},
|
||||
{Region: "Pakistan", Group: "Premium TCP Europe", IPs: []net.IP{{103, 76, 3, 244}, {103, 76, 3, 245}, {103, 76, 3, 246}, {103, 76, 3, 247}, {103, 76, 3, 248}, {103, 76, 3, 249}, {103, 76, 3, 250}, {103, 76, 3, 251}, {103, 76, 3, 252}, {103, 76, 3, 253}}},
|
||||
{Region: "Pakistan", Group: "Premium UDP Europe", IPs: []net.IP{{103, 76, 3, 244}, {103, 76, 3, 245}, {103, 76, 3, 246}, {103, 76, 3, 247}, {103, 76, 3, 248}, {103, 76, 3, 249}, {103, 76, 3, 250}, {103, 76, 3, 251}, {103, 76, 3, 252}, {103, 76, 3, 253}}},
|
||||
{Region: "Panama", Group: "Premium UDP Europe", IPs: []net.IP{{91, 90, 126, 131}, {91, 90, 126, 132}, {91, 90, 126, 133}, {91, 90, 126, 134}, {91, 90, 126, 135}, {91, 90, 126, 136}, {91, 90, 126, 139}, {91, 90, 126, 141}, {91, 90, 126, 143}, {91, 90, 126, 144}}},
|
||||
{Region: "Panama", Group: "Premium TCP Europe", IPs: []net.IP{{91, 90, 126, 131}, {91, 90, 126, 132}, {91, 90, 126, 134}, {91, 90, 126, 135}, {91, 90, 126, 137}, {91, 90, 126, 139}, {91, 90, 126, 140}, {91, 90, 126, 142}, {91, 90, 126, 144}, {91, 90, 126, 145}}},
|
||||
{Region: "Philippines", Group: "Premium UDP Asia", IPs: []net.IP{{188, 214, 125, 35}, {188, 214, 125, 36}, {188, 214, 125, 41}, {188, 214, 125, 44}, {188, 214, 125, 47}, {188, 214, 125, 52}, {188, 214, 125, 53}, {188, 214, 125, 54}, {188, 214, 125, 55}, {188, 214, 125, 60}}},
|
||||
{Region: "Philippines", Group: "Premium TCP Asia", IPs: []net.IP{{188, 214, 125, 36}, {188, 214, 125, 37}, {188, 214, 125, 39}, {188, 214, 125, 43}, {188, 214, 125, 45}, {188, 214, 125, 47}, {188, 214, 125, 48}, {188, 214, 125, 57}, {188, 214, 125, 58}, {188, 214, 125, 59}}},
|
||||
{Region: "Poland", Group: "Premium TCP Europe", IPs: []net.IP{{37, 120, 156, 5}, {37, 120, 156, 9}, {37, 120, 156, 19}, {37, 120, 156, 27}, {37, 120, 156, 29}, {37, 120, 156, 35}, {37, 120, 156, 36}, {51, 75, 56, 40}, {51, 75, 56, 41}, {51, 75, 56, 44}}},
|
||||
{Region: "Poland", Group: "Premium UDP Europe", IPs: []net.IP{{37, 120, 156, 4}, {37, 120, 156, 10}, {37, 120, 156, 16}, {37, 120, 156, 23}, {37, 120, 156, 27}, {37, 120, 156, 29}, {37, 120, 156, 30}, {37, 120, 156, 38}, {37, 120, 156, 39}, {51, 75, 56, 36}}},
|
||||
{Region: "Portugal", Group: "Premium TCP Europe", IPs: []net.IP{{89, 26, 243, 1}, {89, 26, 243, 98}, {89, 26, 243, 112}, {89, 26, 243, 113}, {89, 26, 243, 115}, {89, 26, 243, 195}, {89, 26, 243, 196}, {89, 26, 243, 197}, {89, 26, 243, 198}, {89, 26, 243, 199}}},
|
||||
{Region: "Portugal", Group: "Premium UDP Europe", IPs: []net.IP{{89, 26, 243, 1}, {89, 26, 243, 99}, {89, 26, 243, 113}, {89, 26, 243, 115}, {89, 26, 243, 194}, {89, 26, 243, 195}, {89, 26, 243, 196}, {89, 26, 243, 197}, {89, 26, 243, 198}, {89, 26, 243, 199}}},
|
||||
{Region: "Qatar", Group: "Premium TCP Europe", IPs: []net.IP{{95, 181, 234, 132}, {95, 181, 234, 133}, {95, 181, 234, 134}, {95, 181, 234, 136}, {95, 181, 234, 138}, {95, 181, 234, 140}, {95, 181, 234, 141}, {95, 181, 234, 142}, {95, 181, 234, 143}, {95, 181, 234, 144}}},
|
||||
{Region: "Qatar", Group: "Premium UDP Europe", IPs: []net.IP{{95, 181, 234, 131}, {95, 181, 234, 132}, {95, 181, 234, 133}, {95, 181, 234, 134}, {95, 181, 234, 137}, {95, 181, 234, 138}, {95, 181, 234, 141}, {95, 181, 234, 142}, {95, 181, 234, 143}, {95, 181, 234, 144}}},
|
||||
{Region: "Russian Federation", Group: "Premium TCP Europe", IPs: []net.IP{{5, 8, 16, 67}, {5, 8, 16, 71}, {5, 8, 16, 73}, {5, 8, 16, 75}, {5, 8, 16, 76}, {5, 8, 16, 87}, {5, 8, 16, 88}, {5, 8, 16, 89}, {5, 8, 16, 90}, {5, 8, 16, 104}}},
|
||||
{Region: "Russian Federation", Group: "Premium UDP Europe", IPs: []net.IP{{5, 8, 16, 68}, {5, 8, 16, 75}, {5, 8, 16, 84}, {5, 8, 16, 86}, {5, 8, 16, 87}, {5, 8, 16, 88}, {5, 8, 16, 104}, {5, 8, 16, 106}, {5, 8, 16, 107}, {5, 8, 16, 110}}},
|
||||
{Region: "Saudi Arabia", Group: "Premium UDP Europe", IPs: []net.IP{{95, 181, 235, 132}, {95, 181, 235, 133}, {95, 181, 235, 134}, {95, 181, 235, 135}, {95, 181, 235, 136}, {95, 181, 235, 137}, {95, 181, 235, 139}, {95, 181, 235, 141}, {95, 181, 235, 142}, {95, 181, 235, 143}}},
|
||||
{Region: "Saudi Arabia", Group: "Premium TCP Europe", IPs: []net.IP{{95, 181, 235, 134}, {95, 181, 235, 136}, {95, 181, 235, 137}, {95, 181, 235, 138}, {95, 181, 235, 139}, {95, 181, 235, 140}, {95, 181, 235, 141}, {95, 181, 235, 142}, {95, 181, 235, 143}, {95, 181, 235, 144}}},
|
||||
{Region: "Serbia", Group: "Premium UDP Europe", IPs: []net.IP{{37, 120, 193, 182}, {37, 120, 193, 185}, {37, 120, 193, 187}, {141, 98, 103, 35}, {141, 98, 103, 37}, {141, 98, 103, 39}, {141, 98, 103, 41}, {141, 98, 103, 42}, {141, 98, 103, 44}, {141, 98, 103, 46}}},
|
||||
{Region: "Serbia", Group: "Premium TCP Europe", IPs: []net.IP{{37, 120, 193, 180}, {37, 120, 193, 182}, {37, 120, 193, 183}, {37, 120, 193, 184}, {37, 120, 193, 190}, {141, 98, 103, 35}, {141, 98, 103, 36}, {141, 98, 103, 39}, {141, 98, 103, 40}, {141, 98, 103, 42}}},
|
||||
{Region: "Singapore", Group: "Premium TCP Asia", IPs: []net.IP{{37, 120, 151, 59}, {37, 120, 151, 134}, {37, 120, 151, 135}, {37, 120, 151, 136}, {37, 120, 151, 140}, {37, 120, 151, 141}, {84, 17, 39, 172}, {84, 17, 39, 173}, {84, 17, 39, 178}, {84, 17, 39, 179}}},
|
||||
{Region: "Singapore", Group: "Premium UDP Asia", IPs: []net.IP{{37, 120, 151, 52}, {37, 120, 151, 133}, {37, 120, 151, 138}, {37, 120, 151, 140}, {37, 120, 151, 142}, {84, 17, 39, 171}, {84, 17, 39, 176}, {84, 17, 39, 177}, {84, 17, 39, 179}, {84, 17, 39, 182}}},
|
||||
{Region: "Slovakia", Group: "Premium TCP Europe", IPs: []net.IP{{185, 245, 85, 227}, {185, 245, 85, 228}, {185, 245, 85, 229}, {185, 245, 85, 230}, {185, 245, 85, 231}, {185, 245, 85, 232}, {185, 245, 85, 233}, {185, 245, 85, 234}, {185, 245, 85, 235}, {185, 245, 85, 236}}},
|
||||
{Region: "Slovakia", Group: "Premium UDP Europe", IPs: []net.IP{{185, 245, 85, 227}, {185, 245, 85, 228}, {185, 245, 85, 229}, {185, 245, 85, 230}, {185, 245, 85, 231}, {185, 245, 85, 232}, {185, 245, 85, 233}, {185, 245, 85, 234}, {185, 245, 85, 235}, {185, 245, 85, 236}}},
|
||||
{Region: "Slovenia", Group: "Premium TCP Europe", IPs: []net.IP{{146, 247, 25, 79}, {146, 247, 25, 80}, {146, 247, 25, 81}, {146, 247, 25, 82}, {146, 247, 25, 83}, {146, 247, 25, 84}, {146, 247, 25, 85}, {146, 247, 25, 86}, {146, 247, 25, 88}, {146, 247, 25, 89}}},
|
||||
{Region: "Slovenia", Group: "Premium UDP Europe", IPs: []net.IP{{146, 247, 25, 79}, {146, 247, 25, 80}, {146, 247, 25, 81}, {146, 247, 25, 82}, {146, 247, 25, 83}, {146, 247, 25, 84}, {146, 247, 25, 86}, {146, 247, 25, 88}, {146, 247, 25, 89}, {146, 247, 25, 90}}},
|
||||
{Region: "South Africa", Group: "Premium UDP Europe", IPs: []net.IP{{197, 85, 7, 26}, {197, 85, 7, 27}, {197, 85, 7, 28}, {197, 85, 7, 29}, {197, 85, 7, 30}, {197, 85, 7, 31}, {197, 85, 7, 131}, {197, 85, 7, 132}, {197, 85, 7, 133}, {197, 85, 7, 134}}},
|
||||
{Region: "South Africa", Group: "Premium UDP Asia", IPs: []net.IP{{165, 73, 248, 211}, {165, 73, 248, 213}, {165, 73, 248, 215}, {165, 73, 248, 219}, {165, 73, 248, 221}, {165, 73, 248, 228}, {165, 73, 248, 231}, {165, 73, 248, 232}, {165, 73, 248, 235}, {165, 73, 248, 237}}},
|
||||
{Region: "South Africa", Group: "Premium TCP Europe", IPs: []net.IP{{197, 85, 7, 26}, {197, 85, 7, 27}, {197, 85, 7, 28}, {197, 85, 7, 29}, {197, 85, 7, 30}, {197, 85, 7, 31}, {197, 85, 7, 131}, {197, 85, 7, 132}, {197, 85, 7, 133}, {197, 85, 7, 134}}},
|
||||
{Region: "South Africa", Group: "Premium TCP Asia", IPs: []net.IP{{165, 73, 248, 214}, {165, 73, 248, 215}, {165, 73, 248, 216}, {165, 73, 248, 218}, {165, 73, 248, 219}, {165, 73, 248, 221}, {165, 73, 248, 229}, {165, 73, 248, 235}, {165, 73, 248, 236}, {165, 73, 248, 238}}},
|
||||
{Region: "Spain", Group: "Premium TCP Europe", IPs: []net.IP{{82, 102, 26, 204}, {82, 102, 26, 205}, {84, 17, 62, 130}, {84, 17, 62, 131}, {84, 17, 62, 140}, {84, 17, 62, 147}, {185, 93, 3, 109}, {185, 93, 3, 110}, {185, 93, 3, 112}, {185, 253, 99, 205}}},
|
||||
{Region: "Spain", Group: "Premium UDP Europe", IPs: []net.IP{{37, 120, 142, 54}, {37, 120, 142, 55}, {37, 120, 142, 58}, {37, 120, 142, 150}, {82, 102, 26, 196}, {82, 102, 26, 218}, {84, 17, 62, 138}, {185, 93, 3, 106}, {185, 93, 182, 139}, {185, 253, 99, 202}}},
|
||||
{Region: "Sri Lanka", Group: "Premium UDP Europe", IPs: []net.IP{{95, 181, 239, 131}, {95, 181, 239, 134}, {95, 181, 239, 136}, {95, 181, 239, 137}, {95, 181, 239, 138}, {95, 181, 239, 139}, {95, 181, 239, 140}, {95, 181, 239, 141}, {95, 181, 239, 142}, {95, 181, 239, 143}}},
|
||||
{Region: "Sri Lanka", Group: "Premium TCP Europe", IPs: []net.IP{{95, 181, 239, 131}, {95, 181, 239, 133}, {95, 181, 239, 134}, {95, 181, 239, 135}, {95, 181, 239, 136}, {95, 181, 239, 137}, {95, 181, 239, 140}, {95, 181, 239, 141}, {95, 181, 239, 143}, {95, 181, 239, 144}}},
|
||||
{Region: "Sweden", Group: "Premium UDP Europe", IPs: []net.IP{{188, 126, 73, 202}, {188, 126, 73, 209}, {188, 126, 73, 215}, {188, 126, 73, 221}, {195, 246, 120, 150}, {195, 246, 120, 156}, {195, 246, 120, 160}, {195, 246, 120, 169}, {195, 246, 120, 170}, {195, 246, 120, 173}}},
|
||||
{Region: "Sweden", Group: "Premium TCP Europe", IPs: []net.IP{{188, 126, 73, 204}, {188, 126, 73, 214}, {188, 126, 73, 218}, {188, 126, 73, 221}, {195, 246, 120, 145}, {195, 246, 120, 149}, {195, 246, 120, 151}, {195, 246, 120, 154}, {195, 246, 120, 171}, {195, 246, 120, 179}}},
|
||||
{Region: "Switzerland", Group: "Premium TCP Europe", IPs: []net.IP{{84, 17, 52, 11}, {84, 17, 52, 12}, {84, 17, 52, 22}, {84, 17, 52, 49}, {84, 17, 52, 55}, {84, 17, 52, 62}, {84, 17, 52, 85}, {185, 32, 222, 13}, {185, 189, 150, 61}, {185, 189, 150, 73}}},
|
||||
{Region: "Switzerland", Group: "Premium UDP Europe", IPs: []net.IP{{84, 17, 52, 20}, {84, 17, 52, 33}, {84, 17, 52, 38}, {84, 17, 52, 51}, {84, 17, 52, 69}, {84, 17, 52, 74}, {185, 32, 222, 16}, {185, 32, 222, 118}, {185, 32, 222, 120}, {195, 225, 118, 52}}},
|
||||
{Region: "Taiwan", Group: "Premium TCP Asia", IPs: []net.IP{{45, 133, 181, 102}, {45, 133, 181, 103}, {45, 133, 181, 106}, {45, 133, 181, 108}, {45, 133, 181, 109}, {45, 133, 181, 110}, {45, 133, 181, 112}, {45, 133, 181, 116}, {45, 133, 181, 120}, {45, 133, 181, 123}}},
|
||||
{Region: "Taiwan", Group: "Premium UDP Asia", IPs: []net.IP{{45, 133, 181, 99}, {45, 133, 181, 101}, {45, 133, 181, 105}, {45, 133, 181, 110}, {45, 133, 181, 111}, {45, 133, 181, 114}, {45, 133, 181, 116}, {45, 133, 181, 117}, {45, 133, 181, 121}, {45, 133, 181, 123}}},
|
||||
{Region: "Thailand", Group: "Premium UDP Asia", IPs: []net.IP{{119, 59, 121, 163}, {119, 59, 121, 165}, {119, 59, 121, 166}, {119, 59, 121, 167}, {119, 59, 121, 168}, {119, 59, 121, 169}, {119, 59, 121, 170}, {119, 59, 121, 172}, {119, 59, 121, 173}, {119, 59, 121, 175}}},
|
||||
{Region: "Thailand", Group: "Premium TCP Asia", IPs: []net.IP{{119, 59, 98, 213}, {119, 59, 98, 244}, {119, 59, 121, 163}, {119, 59, 121, 164}, {119, 59, 121, 166}, {119, 59, 121, 169}, {119, 59, 121, 170}, {119, 59, 121, 171}, {119, 59, 121, 172}, {119, 59, 121, 175}}},
|
||||
{Region: "Turkey", Group: "Premium TCP Europe", IPs: []net.IP{{188, 213, 34, 3}, {188, 213, 34, 6}, {188, 213, 34, 10}, {188, 213, 34, 19}, {188, 213, 34, 24}, {188, 213, 34, 28}, {188, 213, 34, 37}, {188, 213, 34, 43}, {188, 213, 34, 104}, {188, 213, 34, 109}}},
|
||||
{Region: "Turkey", Group: "Premium UDP Europe", IPs: []net.IP{{188, 213, 34, 14}, {188, 213, 34, 22}, {188, 213, 34, 26}, {188, 213, 34, 27}, {188, 213, 34, 30}, {188, 213, 34, 39}, {188, 213, 34, 42}, {188, 213, 34, 43}, {188, 213, 34, 100}, {188, 213, 34, 106}}},
|
||||
{Region: "Ukraine", Group: "Premium TCP Europe", IPs: []net.IP{{31, 28, 161, 21}, {31, 28, 163, 40}, {31, 28, 163, 43}, {31, 28, 163, 50}, {62, 149, 7, 165}, {62, 149, 7, 166}, {62, 149, 7, 173}, {62, 149, 29, 36}, {62, 149, 29, 48}, {62, 149, 29, 56}}},
|
||||
{Region: "Ukraine", Group: "Premium UDP Europe", IPs: []net.IP{{31, 28, 161, 20}, {31, 28, 163, 35}, {31, 28, 163, 40}, {31, 28, 163, 42}, {31, 28, 163, 52}, {31, 28, 163, 55}, {62, 149, 7, 172}, {62, 149, 7, 173}, {62, 149, 29, 37}, {62, 149, 29, 58}}},
|
||||
{Region: "United Arab Emirates", Group: "Premium TCP Europe", IPs: []net.IP{{217, 138, 193, 179}, {217, 138, 193, 180}, {217, 138, 193, 182}, {217, 138, 193, 184}, {217, 138, 193, 185}, {217, 138, 193, 186}, {217, 138, 193, 187}, {217, 138, 193, 188}, {217, 138, 193, 189}, {217, 138, 193, 190}}},
|
||||
{Region: "United Arab Emirates", Group: "Premium UDP Europe", IPs: []net.IP{{217, 138, 193, 179}, {217, 138, 193, 180}, {217, 138, 193, 182}, {217, 138, 193, 183}, {217, 138, 193, 184}, {217, 138, 193, 185}, {217, 138, 193, 186}, {217, 138, 193, 187}, {217, 138, 193, 188}, {217, 138, 193, 189}}},
|
||||
{Region: "United Kingdom", Group: "Premium UDP Europe", IPs: []net.IP{{37, 120, 159, 101}, {37, 235, 96, 9}, {81, 92, 206, 164}, {81, 92, 206, 169}, {84, 17, 51, 97}, {84, 17, 51, 123}, {89, 238, 167, 85}, {89, 238, 167, 91}, {109, 169, 14, 97}, {141, 98, 100, 73}}},
|
||||
{Region: "United Kingdom", Group: "Premium TCP Europe", IPs: []net.IP{{37, 120, 133, 165}, {37, 120, 159, 81}, {37, 235, 96, 9}, {84, 17, 51, 44}, {84, 17, 51, 107}, {89, 238, 167, 39}, {89, 238, 167, 54}, {143, 244, 39, 135}, {143, 244, 39, 221}, {143, 244, 39, 232}}},
|
||||
{Region: "United States", Group: "Premium UDP USA", IPs: []net.IP{{23, 105, 161, 116}, {143, 244, 51, 84}, {156, 146, 37, 43}, {156, 146, 37, 73}, {156, 146, 37, 100}, {156, 146, 37, 103}, {156, 146, 51, 20}, {156, 146, 51, 103}, {156, 146, 51, 128}, {156, 146, 59, 172}}},
|
||||
{Region: "United States", Group: "Premium TCP USA", IPs: []net.IP{{89, 187, 171, 139}, {89, 187, 171, 161}, {89, 187, 182, 38}, {143, 244, 51, 111}, {156, 146, 37, 101}, {156, 146, 37, 123}, {156, 146, 49, 133}, {156, 146, 51, 103}, {156, 146, 51, 146}, {185, 242, 5, 115}}},
|
||||
{Region: "Venezuela", Group: "Premium TCP USA", IPs: []net.IP{{95, 181, 237, 131}, {95, 181, 237, 134}, {95, 181, 237, 136}, {95, 181, 237, 137}, {95, 181, 237, 138}, {95, 181, 237, 139}, {95, 181, 237, 140}, {95, 181, 237, 141}, {95, 181, 237, 142}, {95, 181, 237, 143}}},
|
||||
{Region: "Venezuela", Group: "Premium UDP USA", IPs: []net.IP{{95, 181, 237, 131}, {95, 181, 237, 132}, {95, 181, 237, 135}, {95, 181, 237, 136}, {95, 181, 237, 137}, {95, 181, 237, 138}, {95, 181, 237, 140}, {95, 181, 237, 142}, {95, 181, 237, 143}, {95, 181, 237, 144}}},
|
||||
{Region: "Vietnam", Group: "Premium TCP Asia", IPs: []net.IP{{188, 214, 152, 99}, {188, 214, 152, 100}, {188, 214, 152, 101}, {188, 214, 152, 102}, {188, 214, 152, 103}, {188, 214, 152, 105}, {188, 214, 152, 106}, {188, 214, 152, 107}, {188, 214, 152, 108}, {188, 214, 152, 110}}},
|
||||
{Region: "Vietnam", Group: "Premium UDP Asia", IPs: []net.IP{{188, 214, 152, 99}, {188, 214, 152, 100}, {188, 214, 152, 102}, {188, 214, 152, 103}, {188, 214, 152, 104}, {188, 214, 152, 105}, {188, 214, 152, 106}, {188, 214, 152, 108}, {188, 214, 152, 109}, {188, 214, 152, 110}}},
|
||||
func CyberghostHostnameChoices() (choices []string) {
|
||||
servers := CyberghostServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Hostname
|
||||
}
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
// CyberghostServers returns a slice with the server information for each
|
||||
// of the Cyberghost server.
|
||||
func CyberghostServers() (servers []models.CyberghostServer) {
|
||||
servers = make([]models.CyberghostServer, len(allServers.Cyberghost.Servers))
|
||||
copy(servers, allServers.Cyberghost.Servers)
|
||||
return servers
|
||||
}
|
||||
|
||||
36
internal/constants/fastestvpn.go
Normal file
36
internal/constants/fastestvpn.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package constants
|
||||
|
||||
import (
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
)
|
||||
|
||||
//nolint:lll
|
||||
const (
|
||||
FastestvpnCertificate = "MIIFQjCCAyqgAwIBAgIIUfxepT+rr8owDQYJKoZIhvcNAQEMBQAwPzELMAkGA1UEBhMCS1kxEzARBgNVBAoTCkZhc3Rlc3RWUE4xGzAZBgNVBAMTEkZhc3Rlc3RWUE4gUm9vdCBDQTAeFw0xNzA5MTYwMDAxNDZaFw0yNzA5MTQwMDAxNDZaMD8xCzAJBgNVBAYTAktZMRMwEQYDVQQKEwpGYXN0ZXN0VlBOMRswGQYDVQQDExJGYXN0ZXN0VlBOIFJvb3QgQ0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC1Xj+WfPTozFynFqc+c3CVrggIllaXEl5bY5VgFynXkqCTM6lSrfC4pNjGXUbqWe6RnGJbM4/6kUn+lQDjFSQV1rzP2eDS8+r5+X2WXh4AoeNRUWhvSG+HiHD/B2EFK+Nd5BRSdUjpKWAtsCmT2bBt7nT0jN1OdeNrLJeyF8siAqv/oQzKznF9aIe/N01b2M8ZOFTzoXi2fZAckgGWui8NB/lzkVIJqSkAPRL8qiJLuRCPVOX1PFD8vV//R8/QumtfbcYBMo6vCk2HmWdrh5OQHPxb3KJtbtG+Z1j8x6HGEAe17djYepBiRMyCEQvYgfD6tvFylc4IquhqE9yaP60PJod5TxpWnRQ6HIGSeBm+S+rYSMalTZ8+pUqOOA+IQCYpfpx6EKIJL/VsW2C7cXdvudxDhXPI5lR/QidCb9Ohq3WkfxXaYwzrngdg2avmNqId9R4KESuM9GoHW0dszfyBCh5wYfeaffMElfDam3B92NUwyhZwtIiv623WVXY9PPz+EDjSJsIAu2Vi1vdJyA4nD4k9Lwmx/1zTc/UaYVLsiBqL2WdfvFTeoWoV+dNxQXSEPhB8gwi8x4O4lZW0cwVy/6fa8KMY8gZbcbSTr7U5bRERfW8l+jY+mYKQ/M/ccgpxaHiw1/+4LWfbJQ7VhJJrTyN0C36FQzY1URkSXg+53wIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUmVEL4x6xdCqiqu2OBLs27EA8xGYwDQYJKoZIhvcNAQEMBQADggIBABCpITvO1+R4T9v2+onHiFxU5JjtCZ0zkXqRCMp/Z0UIYbeo1p07pZCPAUjBfGPCkAaR++OiG9sysALdJf8Y6HQKcyuAcWUqQnaIhoZ2JcAP7EKq7uCqsMhcYZD/j3O/3RPtSW5UOx6ItDU+Ua0t9Edho9whNw0VQXmo1JjYoP3FzPjuKoDWTSO1q5eYlZfwcTcs55O2shNkFafPg/6cCm5j6v9nyHrM3sk4LjkrBPUXVx2m/aoz219t8O9Ha9/CdMKXsPO/8gTUzpgnzSgPnGnBmi5xr1nspVN8X4E2f3D+DKqBim3YgslD68NcuFQvJ0/BxZzWVbrr+QXoyzaiCgXuogpIDc2bB6oRXqFnHNz36d4QJmJdWdSaijiS/peQ6EOPgOZ1GuObLWlDCBZLNeQ+N6QaiJxVO4XUj/s22i1IRtwdz84TRHrbWiIpEymsqmb/Ep5r4xV5d6+791axclfOTH7tQrY/SbPtTJI4OEgNekI8YfadQifpelF82MsFFEZuaQn0lj+fvLGtE/zKh3OdLTxRc5TAgBB+0T81+JQosygNr2aFFG0hxar1eyw/gLeG8H+7Ie50pyPvXO4OgB6Key8rSExpilQXlvAT1qX0qS3/K1i/9QkSE9ftIPT6vtwLV2sVQzfyanI4IZgWC6ryhvNLsRn0NFnQclor0+aq"
|
||||
FastestvpnOpenvpnStaticKeyV1 = "697fe793b32cb5091d30f2326d5d124a9412e93d0a44ef7361395d76528fcbfc82c3859dccea70a93cfa8fae409709bff75f844cf5ff0c237f426d0c20969233db0e706edb6bdf195ec3dc11b3f76bc807a77e74662d9a800c8cd1144ebb67b7f0d3f1281d1baf522bfe03b7c3f963b1364fc0769400e413b61ca7b43ab19fac9e0f77e41efd4bda7fd77b1de2d7d7855cbbe3e620cecceac72c21a825b243e651f44d90e290e09c3ad650de8fca99c858bc7caad584bc69b11e5c9fd9381c69c505ec487a65912c672d83ed0113b5a74ddfbd3ab33b3683cec593557520a72c4d6cce46111f56f3396cc3ce7183edce553c68ea0796cf6c4375fad00aaa2a42"
|
||||
)
|
||||
|
||||
func FastestvpnCountriesChoices() (choices []string) {
|
||||
servers := FastestvpnServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Country
|
||||
}
|
||||
return choices
|
||||
}
|
||||
|
||||
func FastestvpnHostnameChoices() (choices []string) {
|
||||
servers := FastestvpnServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Hostname
|
||||
}
|
||||
return choices
|
||||
}
|
||||
|
||||
// FastestvpnServers returns the list of all VPN servers for FastestVPN.
|
||||
func FastestvpnServers() (servers []models.FastestvpnServer) {
|
||||
servers = make([]models.FastestvpnServer, len(allServers.Fastestvpn.Servers))
|
||||
copy(servers, allServers.Fastestvpn.Servers)
|
||||
return servers
|
||||
}
|
||||
46
internal/constants/hidemyass.go
Normal file
46
internal/constants/hidemyass.go
Normal file
@@ -0,0 +1,46 @@
|
||||
package constants
|
||||
|
||||
import (
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
)
|
||||
|
||||
//nolint:lll
|
||||
const (
|
||||
HideMyAssCA = "MIIGVjCCBD6gAwIBAgIJAOmTY3hf1Bb6MA0GCSqGSIb3DQEBCwUAMIGSMQswCQYDVQQGEwJVSzEPMA0GA1UECAwGTG9uZG9uMQ8wDQYDVQQHDAZMb25kb24xEzARBgNVBAoMClByaXZheCBMdGQxFDASBgNVBAsMC0hNQSBQcm8gVlBOMRYwFAYDVQQDDA1oaWRlbXlhc3MuY29tMR4wHAYJKoZIhvcNAQkBFg9pbmZvQHByaXZheC5jb20wHhcNMTYwOTE0MDk0MTUyWhcNMjYwOTEyMDk0MTUyWjCBkjELMAkGA1UEBhMCVUsxDzANBgNVBAgMBkxvbmRvbjEPMA0GA1UEBwwGTG9uZG9uMRMwEQYDVQQKDApQcml2YXggTHRkMRQwEgYDVQQLDAtITUEgUHJvIFZQTjEWMBQGA1UEAwwNaGlkZW15YXNzLmNvbTEeMBwGCSqGSIb3DQEJARYPaW5mb0Bwcml2YXguY29tMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxWS4+bOnwzGsEZ2vyqfTg7OEJkdqlA+DmQB3UmeDxX8K+87FTe/htIudr4hQ19q2gaHU4PjN1QsJtkH+VxU6V5p5eeWVVCGpHOhkcI4XK0yodRGn6rhAPJYXI7pJHAronfmqfZz/XM+neTGHQ9VF9zW6Q1001mjT0YklFfpx+CPFiGYsQjqZ+ia9RvaXz5Eu1cQ0EWy4do1l7obmvmTrlqN26z4unmh3HfEKRuwtNeHsSyhdzFW20eT2GhvXniHItqWBDi93U55R84y2GNrQubm207UB6kqbJXPXYnlZifvQCxa1hz3sr+vUbRi4wIpj/Da2MK7BLHAuUbClKqFs9OSAffWo/PuhkhFyF5JhOYXjOMI1PhiTjeSfBmNdC5dFOGT3rStvYxYlB8rwuuyp9DuvInQRuCC62/Lew9pITULaPUPTU7TeKuk4Hqqn2LtnFTU7CSMRAVgZMxTWuC7PT+9sy+jM3nSqo+QaiVtMxbaWXmZD9UlLEMmM9IkMdHV08DXQonjIi4RnqHWLYRY6pDjJ2E4jleXlS2laIBKlmKIuyxZ/B5IyV2dLKrNAs7j9EC7J82giBBCHbZiHQjZ2CqIi+afHKjniFHhuJSVUe7DY+S/B/ePac7Xha8a5K2LmJ+jpPjvBjJd+2Tp2Eyt8wVn/6iSqKePDny5AZhbY+YkCAwEAAaOBrDCBqTAdBgNVHQ4EFgQU4MZR0iTa8SoTWOJeoOmtynuk8/cwHwYDVR0jBBgwFoAU4MZR0iTa8SoTWOJeoOmtynuk8/cwDwYDVR0TAQH/BAUwAwEB/zALBgNVHQ8EBAMCAaYwEQYJYIZIAYb4QgEBBAQDAgEWMBoGA1UdEQQTMBGBD2luZm9AcHJpdmF4LmNvbTAaBgNVHRIEEzARgQ9pbmZvQHByaXZheC5jb20wDQYJKoZIhvcNAQELBQADggIBAG+QvRLNs41wHXeM7wq6tqSZl6UFStGc6gIzzVUkysVHwvAqqxj/8UncqEwFTxV3KiD/+wLMHZFkLwQgSAHwaTmBKGrK4I6DoUtK+52RwfyU3XA0s5dj6rKbZKPNdD0jusOTYgbXOCUa6JI2gmpyjk7lq3D66dATs11uP7S2uwjuO3ER5Cztm12RcsrAxjndH2igTgZVu4QQwnNZ39Raq6v5IayKxF0tP1wPxz/JafhIjdNxq6ReP4jsI5y0rJBuXuw+gWC8ePTP4rxWp908kI7vwmmVq9/iisGZelN6G5uEB2d3EiJBB0A3t9LCFT9fKznlp/38To4x1lQhfNbln8zC4qav/8fBfKu5MkuVcdV4ZmHq0bT7sfzsgHs00JaYOCadBslNu1xVtgooy+ARiGfnzVL9bArLhlVn476JfU22H57M0IaUF5iUTJOWKMSYHNMBWL/m+rgD4In1nEb8DITBW7c1JtC8Iql0UPq1PlxhqMyvXfW94njqcF4wQi6PsnJI9X7oHDy+pevRrCR+3R5xWB8C9jr8J80TmsRJRv8chDUOHH4HYjhF7ldJRDmvY+DK6e4jgBOIaqS5i2/PybVYWjBb7VuKDFkLQSqA5g/jELd6hpULyUgzpAgr7q3iJghthPkS4oxw9NtNvnbQweKIF37HIHiuJRsTRO4jhlX4"
|
||||
HideMyAssCertificate = "MIIGMjCCBBqgAwIBAgICAQIwDQYJKoZIhvcNAQELBQAwgZIxCzAJBgNVBAYTAlVLMQ8wDQYDVQQIDAZMb25kb24xDzANBgNVBAcMBkxvbmRvbjETMBEGA1UECgwKUHJpdmF4IEx0ZDEUMBIGA1UECwwLSE1BIFBybyBWUE4xFjAUBgNVBAMMDWhpZGVteWFzcy5jb20xHjAcBgkqhkiG9w0BCQEWD2luZm9AcHJpdmF4LmNvbTAeFw0xNjEwMTgxNDE4MThaFw0yNjEwMTUxNDE4MThaMIGNMQswCQYDVQQGEwJVSzEPMA0GA1UECAwGTG9uZG9uMQ8wDQYDVQQHDAZMb25kb24xEzARBgNVBAoMClByaXZheCBMdGQxFDASBgNVBAsMC0hNQSBQcm8gVlBOMREwDwYDVQQDDAhobWF1c2VyMjEeMBwGCSqGSIb3DQEJARYPaW5mb0Bwcml2YXguY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5XY3ERJYWs/YIeBoybivNlu+M32rJs+CAZsh7BnnetTxytI4ngsMRoqXETuis8udp2hsqEHsglLR9tlk9C8yCuKhxbkpdrXFWdISmUq5sa7/wqg/zJF1AZm5Jy0oHNyTHfG6XW61I/h9IN5dmcR9YLir8DVDBNllbtt0z+DnvOhYJOqC30ENahWkTmNKl1cT7EBrR5slddiBJleAb08z77pwsD310e6jWTBySsBcPy+xu/Jj2QgVil/3mstZZDI+noFzs3SkTFBkha/lNTP7NODBQ6m39iaJxz6ZR1xE3v7XU0H5WnpZIcQ2+kmu5Krk2y1GYMKL+9oaotXFPz9v+QIDAQABo4IBkzCCAY8wCQYDVR0TBAIwADARBglghkgBhvhCAQEEBAMCB4AwCwYDVR0PBAQDAgeAMCwGCWCGSAGG+EIBDQQfFh1PcGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQU2LKFPHjFUzLfsHIMWi0VukhBgTEwgccGA1UdIwSBvzCBvIAU4MZR0iTa8SoTWOJeoOmtynuk8/ehgZikgZUwgZIxCzAJBgNVBAYTAlVLMQ8wDQYDVQQIDAZMb25kb24xDzANBgNVBAcMBkxvbmRvbjETMBEGA1UECgwKUHJpdmF4IEx0ZDEUMBIGA1UECwwLSE1BIFBybyBWUE4xFjAUBgNVBAMMDWhpZGVteWFzcy5jb20xHjAcBgkqhkiG9w0BCQEWD2luZm9AcHJpdmF4LmNvbYIJAOmTY3hf1Bb6MBoGA1UdEQQTMBGBD2luZm9AcHJpdmF4LmNvbTAaBgNVHRIEEzARgQ9pbmZvQHByaXZheC5jb20wEwYDVR0lBAwwCgYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggIBAKeGVnbL3yu2fh1T0ATbgyHx9rnFGRW1o/xfF5ssfRInlopsGDejrk9goyJErVxuzSzLp8AhxSOrVZJp6Tlpssj3B4FbGB0BIH+LcrID9pb+r2LqrTeYfMwYo6zRLNQ5NmMyxQCf6XrdxihUTiZBV31LKlWNkhOLMlHr2eXwAEXjqYMXjYwN+WE8I7SlUm5WCwj7PTiF7BpdDP5Ut4y5Dj8A2m1zXt36rr5hxvbgo2JAeFwVEG4ch67PI+uM0G2GilxnjuK2wKgjBKFMAUfLs7tigzSgx8PEfYCc+bgWpPyfG5hYM9n94zd2VTDN4sam12Bxvhw8zn20L6eT+Skfa8BN7eesrV5opABt/IImZ4Q1HShKKc5EiBN8CKGDydojkNrXuFfsyv7S9VHch0e5cS+Annhr4ARaH0O5fPOD5PBVajdbV6/Rf7NzB5b/raJcUK5BD6KWWRCsmaNYzaabJjUpCmigrOMmkdAxeKCY/oEFpU3+7VeKfNyxBTIiGFt5RjNqTQXmMVjiRN97VN7fqAaFTQB2OF7E3hrtqU9jXkeN8Tvu/FF0LNyt87orewecC0Ujz7Hto9fchPH0roP+DVzoAEP8axD9RV5pM/kgubu3hMD6lLsbx4GOD11GQplvuygURxAYsyjbgFydbk1ZIpeE2OeGXXrfuQWFbNtjLJTu"
|
||||
HideMyAssRSAPrivateKey = "MIIEpAIBAAKCAQEA5XY3ERJYWs/YIeBoybivNlu+M32rJs+CAZsh7BnnetTxytI4ngsMRoqXETuis8udp2hsqEHsglLR9tlk9C8yCuKhxbkpdrXFWdISmUq5sa7/wqg/zJF1AZm5Jy0oHNyTHfG6XW61I/h9IN5dmcR9YLir8DVDBNllbtt0z+DnvOhYJOqC30ENahWkTmNKl1cT7EBrR5slddiBJleAb08z77pwsD310e6jWTBySsBcPy+xu/Jj2QgVil/3mstZZDI+noFzs3SkTFBkha/lNTP7NODBQ6m39iaJxz6ZR1xE3v7XU0H5WnpZIcQ2+kmu5Krk2y1GYMKL+9oaotXFPz9v+QIDAQABAoIBAQCcMcssOMOiFWc3MC3EWo4SP4MKQ9n0Uj5Z34LI151FdJyehlj54+VYQ1Cv71tCbjED2sZUBoP69mtsT/EzcsjqtfiOwgrifrs2+BOm+0HKHKiGlcbP9peiHkT10PxEITWXpYtJvGlbcfOjIxqt6B28cBjCK09ShrVQL9ylAKBearRRUacszppntMNTMtN/uG48ZR9Wm+xAczImdG6CrG5sLI/++JwM5PDChLvn5JgMGyOfQZdjNe1oSOVLmqFeG5uu/FS4oMon9+HtfjHJr4ZgA1yQ2wQh3GvEjlP8zwHxEpRJYbxpj6ZbjHZJ2HLX/Gcd9/cXiN8+fQ2zPIYQyG9dAoGBAPUUmt2nJNvl7gj0GbZZ3XR9o+hvj7bJ74W2NhMrw6kjrrzHTAUQd1sBQS8szAQCLqf2ou1aw9AMMBdsLAHydXxvbH7IBAla7rKr23iethtSfjhTNSgQLJHVZlNHfp3hzNtCQZ7j0qVjrteNotrdVF7kKPHDXAK00ICy6SPNjvrXAoGBAO+vdnO15jLeZbbi3lQNS4r8oCadyqyX7ouKE6MtKNhiPsNPGqHKiGcKs/+QylVgYvSmm7TgpsCAiEYeLSPT+Yq3y7HtwVpULlpfAhEJXmvn/6hGpOizx1WNGWhw7nHPWPDzf+jqCGzHdhK0aEZR3MZZQ+U+uKfGiJ8vrvgB7eGvAoGAWxxp5nU48rcsIw/8bxpBhgkfYk33M5EnBqKSv9XJS5wEXhIJZOiWNrLktNEGl4boKXE7aNoRacreJhcE1UR6AOS7hPZ+6atwiePyF4mJUeb9HZtxa493wk9/Vv6BR9il++1Jz/QKX4oLef8hyBP4Rb60qgxirG7kBLR+j9zfhskCgYEAzA5y5xIeuIIU0H4XUDG9dcebxSSjbwsuYIgeLdb9pjMGQhsvjjyyoh8/nT20tLkJpkXN3FFCRjNnUWLRhWYrVkkh1wqWiYOPrwqh5MU4KN/sDWSPcznTY+drkTpMFoKzsvdrl2zf3VR3FneXKv742bkXj601Ykko+XWMHcLutisCgYBSq8IrsjzfaTQiTGI9a7WWsvzK92bq7Abnfq7swAXWcJd/bnjTQKLrrvt2bmwNvlWKAb3c69BFMn0X4t4PuN0iJQ39D6aQAEaM7HwWAmjf5TbodbmgbGxdsUB4xcCIQQ1mvTkigXWrCg0YAD2GZSoaslXAAVv6nR5qWEIa0Hx9GA=="
|
||||
)
|
||||
|
||||
func HideMyAssCountryChoices() (choices []string) {
|
||||
servers := HideMyAssServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Country
|
||||
}
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
func HideMyAssCityChoices() (choices []string) {
|
||||
servers := HideMyAssServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].City
|
||||
}
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
func HideMyAssHostnameChoices() (choices []string) {
|
||||
servers := HideMyAssServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Hostname
|
||||
}
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
// HideMyAssServers returns a slice of all the server information for HideMyAss.
|
||||
func HideMyAssServers() (servers []models.HideMyAssServer) {
|
||||
servers = make([]models.HideMyAssServer, len(allServers.HideMyAss.Servers))
|
||||
copy(servers, allServers.HideMyAss.Servers)
|
||||
return servers
|
||||
}
|
||||
44
internal/constants/ipvanish.go
Normal file
44
internal/constants/ipvanish.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package constants
|
||||
|
||||
import (
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
)
|
||||
|
||||
//nolint:lll
|
||||
const (
|
||||
IpvanishCA = "MIIErTCCA5WgAwIBAgIJAMYKzSS8uPKDMA0GCSqGSIb3DQEBDQUAMIGVMQswCQYDVQQGEwJVUzELMAkGA1UECBMCRkwxFDASBgNVBAcTC1dpbnRlciBQYXJrMREwDwYDVQQKEwhJUFZhbmlzaDEVMBMGA1UECxMMSVBWYW5pc2ggVlBOMRQwEgYDVQQDEwtJUFZhbmlzaCBDQTEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBpcHZhbmlzaC5jb20wHhcNMTIwMTExMTkzMjIwWhcNMjgxMTAyMTkzMjIwWjCBlTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkZMMRQwEgYDVQQHEwtXaW50ZXIgUGFyazERMA8GA1UEChMISVBWYW5pc2gxFTATBgNVBAsTDElQVmFuaXNoIFZQTjEUMBIGA1UEAxMLSVBWYW5pc2ggQ0ExIzAhBgkqhkiG9w0BCQEWFHN1cHBvcnRAaXB2YW5pc2guY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAt9DBWNr/IKOuY3TmDP5x7vYZR0DGxLbXU8TyAzBbjUtFFMbhxlHiXVQrZHmgzih94x7BgXM7tWpmMKYVb+gNaqMdWE680Qm3nOwmhy/dulXDkEHAwD05i/iTx4ZaUdtV2vsKBxRg1vdC4AEiwD7bqV4HOi13xcG971aQ55Mj1KeCdA0aNvpat1LWx2jjWxsfI8s2Lv5Fkoi1HO1+vTnnaEsJZrBgAkLXpItqP29Lik3/OBIvkBIxlKrhiVPixE5qNiD+eSPirsmROvsyIonoJtuY4Dw5K6pcNlKyYiwo1IOFYU3YxffwFJk+bSW4WVBhsdf5dGxq/uOHmuz5gdwxCwIDAQABo4H9MIH6MAwGA1UdEwQFMAMBAf8wHQYDVR0OBBYEFEv9FCWJHefBcIPX9p8RHCVOGe6uMIHKBgNVHSMEgcIwgb+AFEv9FCWJHefBcIPX9p8RHCVOGe6uoYGbpIGYMIGVMQswCQYDVQQGEwJVUzELMAkGA1UECBMCRkwxFDASBgNVBAcTC1dpbnRlciBQYXJrMREwDwYDVQQKEwhJUFZhbmlzaDEVMBMGA1UECxMMSVBWYW5pc2ggVlBOMRQwEgYDVQQDEwtJUFZhbmlzaCBDQTEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBpcHZhbmlzaC5jb22CCQDGCs0kvLjygzANBgkqhkiG9w0BAQ0FAAOCAQEAI2dkh/43ksV2fdYpVGhYaFZPVqCJoToCez0IvOmLeLGzow+EOSrY508oyjYeNP4VJEjApqo0NrMbKl8g/8bpLBcotOCF1c1HZ+y9v7648uumh01SMjsbBeHOuQcLb+7gX6c0pEmxWv8qj5JiW3/1L1bktnjW5Yp5oFkFSMXjOnIoYKHyKLjN2jtwH6XowUNYpg4qVtKU0CXPdOznWcd9/zSfa393HwJPeeVLbKYaFMC4IEbIUmKYtWyoJ9pJ58smU3pWsHZUg9Zc0LZZNjkNlBdQSLmUHAJ33Bd7pJS0JQeiWviC+4UTmzEWRKa7pDGnYRYNu2cUo0/voStphv8EVA=="
|
||||
)
|
||||
|
||||
func IpvanishCountryChoices() (choices []string) {
|
||||
servers := IpvanishServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Country
|
||||
}
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
func IpvanishCityChoices() (choices []string) {
|
||||
servers := IpvanishServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].City
|
||||
}
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
func IpvanishHostnameChoices() (choices []string) {
|
||||
servers := IpvanishServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Hostname
|
||||
}
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
// IpvanishServers returns a slice of all the server information for Ipvanish.
|
||||
func IpvanishServers() (servers []models.IpvanishServer) {
|
||||
servers = make([]models.IpvanishServer, len(allServers.Ipvanish.Servers))
|
||||
copy(servers, allServers.Ipvanish.Servers)
|
||||
return servers
|
||||
}
|
||||
45
internal/constants/ivpn.go
Normal file
45
internal/constants/ivpn.go
Normal file
@@ -0,0 +1,45 @@
|
||||
package constants
|
||||
|
||||
import (
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
)
|
||||
|
||||
//nolint:lll
|
||||
const (
|
||||
IvpnCA = "MIIGoDCCBIigAwIBAgIJAJjvUclXmxtnMA0GCSqGSIb3DQEBCwUAMIGMMQswCQYDVQQGEwJDSDEPMA0GA1UECAwGWnVyaWNoMQ8wDQYDVQQHDAZadXJpY2gxETAPBgNVBAoMCElWUE4ubmV0MQ0wCwYDVQQLDARJVlBOMRgwFgYDVQQDDA9JVlBOIFJvb3QgQ0EgdjIxHzAdBgkqhkiG9w0BCQEWEHN1cHBvcnRAaXZwbi5uZXQwHhcNMjAwMjI2MTA1MjI5WhcNNDAwMjIxMTA1MjI5WjCBjDELMAkGA1UEBhMCQ0gxDzANBgNVBAgMBlp1cmljaDEPMA0GA1UEBwwGWnVyaWNoMREwDwYDVQQKDAhJVlBOLm5ldDENMAsGA1UECwwESVZQTjEYMBYGA1UEAwwPSVZQTiBSb290IENBIHYyMR8wHQYJKoZIhvcNAQkBFhBzdXBwb3J0QGl2cG4ubmV0MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxHVeaQN3nYCLnGoEg6cY44AExbQ3W6XGKYwC9vI+HJbb1o0tAv56ryvc6eS6BdG5q9M8fHaHEE/jw9rtznioiXPwIEmqMqFPA9k1oRIQTGX73m+zHGtRpt9P4tGYhkvbqnN0OGI0H+j9R6cwKi7KpWIoTVibtyI7uuwgzC2nvDzVkLi63uvnCKRXcGy3VWC06uWFbqI9+QDrHHgdJA1F0wRfg0Iac7TE75yXItBMvNLbdZpge9SmplYWFQ2rVPG+n75KepJ+KW7PYfTP4Mh3R8A7h3/WRm03o3spf2aYw71t44voZ6agvslvwqGyczDytsLUny0U2zR7/mfEAyVbL8jqcWr2Df0m3TA0WxwdWvA51/RflVk9G96LncUkoxuBT56QSMtdjbMSqRgLfz1iPsglQEaCzUSqHfQExvONhXtNgy+Pr2+wGrEuSlLMee7aUEMTFEX/vHPZanCrUVYf5Vs8vDOirZjQSHJfgZfwj3nL5VLtIq6ekDhSAdrqCTILP3V2HbgdZGWPVQxl4YmQPKo0IJpse5Kb6TF2o0i90KhORcKg7qZA40sEbYLEwqTM7VBs1FahTXsOPAoMa7xZWV1TnigF5pdVS1l51dy5S8L4ErHFEnAp242BDuTClSLVnWDdofW0EZ0OkK7V9zKyVl75dlBgxMIS0y5MsK7IWicCAwEAAaOCAQEwgf4wHQYDVR0OBBYEFHUDcMOMo35yg2A/v0uYfkDE11CXMIHBBgNVHSMEgbkwgbaAFHUDcMOMo35yg2A/v0uYfkDE11CXoYGSpIGPMIGMMQswCQYDVQQGEwJDSDEPMA0GA1UECAwGWnVyaWNoMQ8wDQYDVQQHDAZadXJpY2gxETAPBgNVBAoMCElWUE4ubmV0MQ0wCwYDVQQLDARJVlBOMRgwFgYDVQQDDA9JVlBOIFJvb3QgQ0EgdjIxHzAdBgkqhkiG9w0BCQEWEHN1cHBvcnRAaXZwbi5uZXSCCQCY71HJV5sbZzAMBgNVHRMEBTADAQH/MAsGA1UdDwQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAABAjRMJy+mXFLezAZ8iUgxOjNtSqkCv1aU78K1XkYUzbwNNrSIVGKfP9cqOEiComXY6nniws7QEV2IWilcdPKm0x57recrr9TExGGOTVGB/WdmsFfn0g/HgmxNvXypzG3qulBk4qQTymICdsl9vIPb1l9FSjKw1KgUVuCPaYq7xiXbZ/kZdZX49xeKtoDBrXKKhXVYoWus/S+k2IS8iCxvcp599y7LQJg5DOGlbaxFhsW4R+kfGOaegyhPvpaznguv02i7NLd99XqJhpv2jTUF5F3T23Z4KkL/wTo4zxz09DKOlELrE4ai++ilCt/mXWECXNOSNXzgszpe6WAs0h9R++sH+AzJyhBfIGgPUTxHHHvxBVLj3k6VCgF7mRP2Y+rTWa6d8AGI2+RaeyV9DVVH9UeSoU0Hv2JHiZL6dRERnyg8dyzKeTCke8poLIjXF+gyvI+22/xsL8jcNHi9Kji3Vpc3i0Mxzx3gu2N+PL71CwJilgqBgxj0firr3k8sFcWVSGos6RJ3IvFvThxYx0p255WrWM01fR9TktPYEfjDT9qpIJ8OrGlNOhWhYj+a45qibXDpaDdb/uBEmf2sSXNifjSeUyqu6cKfZvMqB7pS3l/AhuAOTT80E4sXLEoDxkFD4C78swZ8wyWRKwsWGIGABGAHwXEAoDiZ/jjFrEZT0="
|
||||
IvpnOpenvpnStaticKeyV1 = "ac470c93ff9f5602a8aab37dee84a52814d10f20490ad23c47d5d82120c1bf859e93d0696b455d4a1b8d55d40c2685c41ca1d0aef29a3efd27274c4ef09020a3978fe45784b335da6df2d12db97bbb838416515f2a96f04715fd28949c6fe296a925cfada3f8b8928ed7fc963c1563272f5cf46e5e1d9c845d7703ca881497b7e6564a9d1dea9358adffd435295479f47d5298fabf5359613ff5992cb57ff081a04dfb81a26513a6b44a9b5490ad265f8a02384832a59cc3e075ad545461060b7bcab49bac815163cb80983dd51d5b1fd76170ffd904d8291071e96efc3fb777856c717b148d08a510f5687b8a8285dcffe737b98916dd15ef6235dee4266d3b"
|
||||
)
|
||||
|
||||
func IvpnCountryChoices() (choices []string) {
|
||||
servers := IvpnServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Country
|
||||
}
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
func IvpnCityChoices() (choices []string) {
|
||||
servers := IvpnServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].City
|
||||
}
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
func IvpnHostnameChoices() (choices []string) {
|
||||
servers := IvpnServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Hostname
|
||||
}
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
// IvpnServers returns a slice of all the server information for Ivpn.
|
||||
func IvpnServers() (servers []models.IvpnServer) {
|
||||
servers = make([]models.IvpnServer, len(allServers.Ivpn.Servers))
|
||||
copy(servers, allServers.Ivpn.Servers)
|
||||
return servers
|
||||
}
|
||||
@@ -1,9 +1,6 @@
|
||||
package constants
|
||||
|
||||
import (
|
||||
"net"
|
||||
"sort"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
)
|
||||
|
||||
@@ -13,129 +10,44 @@ const (
|
||||
)
|
||||
|
||||
func MullvadCountryChoices() (choices []string) {
|
||||
uniqueChoices := map[string]struct{}{}
|
||||
for _, server := range MullvadServers() {
|
||||
uniqueChoices[server.Country] = struct{}{}
|
||||
servers := MullvadServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Country
|
||||
}
|
||||
for choice := range uniqueChoices {
|
||||
choices = append(choices, choice)
|
||||
}
|
||||
sort.Slice(choices, func(i, j int) bool {
|
||||
return choices[i] < choices[j]
|
||||
})
|
||||
return choices
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
func MullvadCityChoices() (choices []string) {
|
||||
uniqueChoices := map[string]struct{}{}
|
||||
for _, server := range MullvadServers() {
|
||||
uniqueChoices[server.City] = struct{}{}
|
||||
servers := MullvadServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].City
|
||||
}
|
||||
for choice := range uniqueChoices {
|
||||
choices = append(choices, choice)
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
func MullvadHostnameChoices() (choices []string) {
|
||||
servers := MullvadServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Hostname
|
||||
}
|
||||
sort.Slice(choices, func(i, j int) bool {
|
||||
return choices[i] < choices[j]
|
||||
})
|
||||
return choices
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
func MullvadISPChoices() (choices []string) {
|
||||
uniqueChoices := map[string]struct{}{}
|
||||
for _, server := range MullvadServers() {
|
||||
uniqueChoices[server.ISP] = struct{}{}
|
||||
servers := MullvadServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].ISP
|
||||
}
|
||||
for choice := range uniqueChoices {
|
||||
choices = append(choices, choice)
|
||||
}
|
||||
sort.Slice(choices, func(i, j int) bool {
|
||||
return choices[i] < choices[j]
|
||||
})
|
||||
return choices
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
//nolint:dupl,lll
|
||||
func MullvadServers() []models.MullvadServer {
|
||||
return []models.MullvadServer{
|
||||
{Country: "Albania", City: "Tirana", ISP: "iRegister", Owned: false, IPs: []net.IP{{31, 171, 154, 210}}, IPsV6: []net.IP{{0x2a, 0x4, 0x27, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "Australia", City: "Adelaide", ISP: "Intergrid", Owned: false, IPs: []net.IP{{116, 206, 231, 58}}, IPsV6: []net.IP{{0x24, 0x7, 0xa0, 0x80, 0x50, 0x0, 0x0, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "Australia", City: "Brisbane", ISP: "Intergrid", Owned: false, IPs: []net.IP{{43, 245, 160, 162}}, IPsV6: []net.IP{{0x24, 0x7, 0xa0, 0x80, 0x20, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "Australia", City: "Canberra", ISP: "Intergrid", Owned: false, IPs: []net.IP{{116, 206, 229, 98}}, IPsV6: []net.IP{{0x24, 0x7, 0xa0, 0x80, 0x40, 0x0, 0x0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "Australia", City: "Melbourne", ISP: "Intergrid", Owned: false, IPs: []net.IP{{116, 206, 228, 202}, {116, 206, 228, 242}, {116, 206, 230, 98}}, IPsV6: []net.IP{{0x24, 0x7, 0xa0, 0x80, 0x30, 0x0, 0x0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x24, 0x7, 0xa0, 0x80, 0x30, 0x0, 0x0, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x24, 0x7, 0xa0, 0x80, 0x30, 0x0, 0x0, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}}},
|
||||
{Country: "Australia", City: "Perth", ISP: "Intergrid", Owned: false, IPs: []net.IP{{103, 77, 235, 66}}, IPsV6: []net.IP{{0x24, 0x0, 0xfa, 0x80, 0x0, 0x5, 0x0, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "Australia", City: "Sydney", ISP: "Intergrid", Owned: false, IPs: []net.IP{{43, 245, 162, 130}, {103, 77, 232, 130}, {103, 77, 232, 146}}, IPsV6: []net.IP{{0x24, 0x0, 0xfa, 0x80, 0x0, 0x1, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x24, 0x0, 0xfa, 0x80, 0x0, 0x1, 0x0, 0x12, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x24, 0x0, 0xfa, 0x80, 0x0, 0x1, 0x0, 0x15, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}}},
|
||||
{Country: "Australia", City: "Sydney", ISP: "M247", Owned: false, IPs: []net.IP{{89, 44, 10, 18}, {89, 44, 10, 34}, {89, 44, 10, 50}, {89, 44, 10, 194}}, IPsV6: []net.IP{{0x20, 0x1, 0xa, 0xc8, 0x0, 0x84, 0x0, 0x28, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x84, 0x0, 0x29, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x84, 0x0, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x84, 0x0, 0x38, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}}},
|
||||
{Country: "Austria", City: "Vienna", ISP: "M247", Owned: false, IPs: []net.IP{{5, 253, 207, 34}, {86, 107, 21, 210}, {86, 107, 21, 226}, {86, 107, 21, 242}}, IPsV6: []net.IP{{0x20, 0x1, 0xa, 0xc8, 0x0, 0x29, 0x0, 0x39, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x2f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x29, 0x0, 0x5a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x1f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x29, 0x0, 0x5b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x3f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x29, 0x0, 0x5c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x4f}}},
|
||||
{Country: "Belgium", City: "Brussels", ISP: "M247", Owned: false, IPs: []net.IP{{37, 120, 143, 138}, {37, 120, 218, 138}, {37, 120, 218, 146}, {91, 207, 57, 50}, {185, 104, 186, 202}}, IPsV6: []net.IP{{0x20, 0x1, 0xa, 0xc8, 0x0, 0x27, 0x0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x27, 0x0, 0xd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x27, 0x0, 0x32, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x27, 0x0, 0x54, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x27, 0x0, 0x55, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f}}},
|
||||
{Country: "Brazil", City: "Sao Paulo", ISP: "Heficed", Owned: false, IPs: []net.IP{{191, 101, 62, 178}}, IPsV6: []net.IP{{0x28, 0x3, 0x0, 0x80, 0x80, 0x3, 0x80, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}}},
|
||||
{Country: "Brazil", City: "Sao Paulo", ISP: "Qnax", Owned: false, IPs: []net.IP{{177, 67, 80, 186}}, IPsV6: []net.IP{{0x28, 0x4, 0x53, 0x64, 0x21, 0x0, 0x0, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "Bulgaria", City: "Sofia", ISP: "M247", Owned: false, IPs: []net.IP{{37, 120, 152, 114}, {37, 120, 152, 146}}, IPsV6: []net.IP{{0x20, 0x1, 0xa, 0xc8, 0x0, 0x30, 0x0, 0x19, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x30, 0x0, 0x1a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "Canada", City: "Montreal", ISP: "M247", Owned: false, IPs: []net.IP{{89, 36, 78, 18}, {89, 36, 78, 34}, {89, 36, 78, 50}, {89, 36, 78, 66}, {89, 36, 78, 82}, {89, 36, 78, 98}, {89, 36, 78, 114}, {89, 36, 78, 130}}, IPsV6: []net.IP{{0x2a, 0xd, 0x56, 0x0, 0x0, 0x9, 0x0, 0xb6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x9, 0x0, 0xb7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x9, 0x0, 0xb8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x9, 0x0, 0xb9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x9, 0x0, 0xba, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x9, 0x0, 0xc8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x9, 0x0, 0xc9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x9, 0x1, 0x61, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}}},
|
||||
{Country: "Canada", City: "Toronto", ISP: "Tzulo", Owned: false, IPs: []net.IP{{198, 54, 132, 34}, {198, 54, 132, 50}, {198, 54, 132, 66}}, IPsV6: []net.IP{{0x26, 0x7, 0x90, 0x0, 0x60, 0x0, 0x0, 0x12, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x26, 0x7, 0x90, 0x0, 0x60, 0x0, 0x0, 0x13, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x26, 0x7, 0x90, 0x0, 0x60, 0x0, 0x0, 0x14, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}}},
|
||||
{Country: "Canada", City: "Vancouver", ISP: "100TB", Owned: false, IPs: []net.IP{{172, 83, 40, 38}}, IPsV6: []net.IP{{0x26, 0x7, 0xf7, 0xa0, 0x0, 0xd, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}}},
|
||||
{Country: "Canada", City: "Vancouver", ISP: "Esecuredata", Owned: false, IPs: []net.IP{{71, 19, 248, 240}, {71, 19, 249, 81}}, IPsV6: []net.IP{{0x26, 0x5, 0x0, 0x80, 0x0, 0x18, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4}, {0x26, 0x5, 0x0, 0x80, 0x0, 0x19, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5}}},
|
||||
{Country: "Czech Republic", City: "Prague", ISP: "M247", Owned: false, IPs: []net.IP{{185, 156, 174, 146}, {185, 156, 174, 170}, {185, 216, 35, 242}, {217, 138, 199, 74}, {217, 138, 199, 82}}, IPsV6: []net.IP{{0x20, 0x1, 0xa, 0xc8, 0x0, 0x33, 0x0, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x33, 0x0, 0xb, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x33, 0x0, 0x14, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x33, 0x0, 0x3f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x33, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f}}},
|
||||
{Country: "Denmark", City: "Copenhagen", ISP: "31173", Owned: true, IPs: []net.IP{{45, 129, 56, 81}, {141, 98, 254, 71}}, IPsV6: []net.IP{{0x2a, 0x3, 0x1b, 0x20, 0x0, 0x8, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x8, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}}},
|
||||
{Country: "Denmark", City: "Copenhagen", ISP: "Asergo", Owned: false, IPs: []net.IP{{82, 103, 140, 213}}, IPsV6: []net.IP{{0x2a, 0x0, 0x90, 0x80, 0x0, 0x1, 0x9, 0x8c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "Denmark", City: "Copenhagen", ISP: "Blix", Owned: false, IPs: []net.IP{{134, 90, 149, 138}}, IPsV6: []net.IP{{0x2a, 0x2, 0xed, 0x1, 0x41, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "Denmark", City: "Copenhagen", ISP: "M247", Owned: false, IPs: []net.IP{{89, 45, 7, 130}, {89, 45, 7, 146}}, IPsV6: []net.IP{{0x20, 0x1, 0xa, 0xc8, 0x0, 0x37, 0x0, 0x5b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x3f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x37, 0x0, 0x5c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x4f}}},
|
||||
{Country: "Finland", City: "Helsinki", ISP: "Creanova", Owned: true, IPs: []net.IP{{185, 204, 1, 171}, {185, 204, 1, 172}, {185, 204, 1, 173}, {185, 204, 1, 174}, {185, 204, 1, 175}, {185, 204, 1, 176}, {185, 212, 149, 201}}, IPsV6: []net.IP{{0x2a, 0xc, 0xf0, 0x40, 0x0, 0x0, 0x27, 0x90, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x2a, 0xc, 0xf0, 0x40, 0x0, 0x0, 0x27, 0x90, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x2a, 0xc, 0xf0, 0x40, 0x0, 0x0, 0x27, 0x90, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x2a, 0xc, 0xf0, 0x40, 0x0, 0x0, 0x27, 0x90, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}, {0x2a, 0xc, 0xf0, 0x40, 0x0, 0x0, 0x27, 0x90, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f}, {0x2a, 0xc, 0xf0, 0x40, 0x0, 0x0, 0x27, 0x90, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6f}, {0x2a, 0xc, 0xf0, 0x40, 0x0, 0x0, 0x27, 0x90, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f}}},
|
||||
{Country: "France", City: "Paris", ISP: "31173", Owned: true, IPs: []net.IP{{193, 32, 126, 81}, {193, 32, 126, 82}, {193, 32, 126, 83}, {193, 32, 126, 84}}, IPsV6: []net.IP{{0x2a, 0x3, 0x1b, 0x20, 0x0, 0x9, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x9, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x9, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x9, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}}},
|
||||
{Country: "France", City: "Paris", ISP: "M247", Owned: false, IPs: []net.IP{{89, 44, 9, 19}, {89, 44, 9, 35}, {194, 110, 113, 3}}, IPsV6: []net.IP{{0x20, 0x1, 0xa, 0xc8, 0x0, 0x25, 0x0, 0xd0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x25, 0x0, 0xd1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x25, 0x0, 0xd2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}}},
|
||||
{Country: "Germany", City: "Frankfurt", ISP: "31173", Owned: true, IPs: []net.IP{{185, 213, 155, 131}, {185, 213, 155, 132}, {185, 213, 155, 133}, {185, 213, 155, 134}, {185, 213, 155, 135}, {185, 213, 155, 136}, {185, 213, 155, 137}, {185, 213, 155, 138}, {185, 213, 155, 139}, {185, 213, 155, 140}}, IPsV6: []net.IP{{0x2a, 0x3, 0x1b, 0x20, 0x0, 0x6, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x6, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x6, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x6, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x6, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x6, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x6, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x6, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x6, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x6, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0xf}}},
|
||||
{Country: "Germany", City: "Frankfurt", ISP: "M247", Owned: false, IPs: []net.IP{{193, 27, 14, 2}, {193, 27, 14, 18}, {193, 27, 14, 34}, {193, 27, 14, 50}}, IPsV6: []net.IP{{0x20, 0x1, 0xa, 0xc8, 0x0, 0x20, 0x3, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x1f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x20, 0x3, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x2f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x20, 0x3, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x3f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x20, 0x3, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x4f}}},
|
||||
{Country: "Greece", City: "Athens", ISP: "aweb", Owned: false, IPs: []net.IP{{185, 226, 67, 168}}, IPsV6: []net.IP{{0x2a, 0xc, 0x5e, 0x0, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "Hong Kong", City: "Hong Kong", ISP: "Leaseweb", Owned: false, IPs: []net.IP{{209, 58, 184, 146}, {209, 58, 185, 53}, {209, 58, 185, 186}}, IPsV6: []net.IP{{0x20, 0x1, 0xd, 0xf1, 0x8, 0x1, 0xa0, 0x3, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x20, 0x1, 0xd, 0xf1, 0x8, 0x1, 0xa0, 0x3, 0x0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x20, 0x1, 0xd, 0xf1, 0x8, 0x1, 0xa0, 0x5, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "Hong Kong", City: "Hong Kong", ISP: "M247", Owned: false, IPs: []net.IP{{89, 45, 6, 50}, {89, 45, 6, 66}}, IPsV6: []net.IP{{0x20, 0x1, 0xa, 0xc8, 0x0, 0x92, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x92, 0x0, 0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "Hungary", City: "Budapest", ISP: "M247", Owned: false, IPs: []net.IP{{86, 106, 74, 34}, {86, 106, 74, 50}}, IPsV6: []net.IP{{0x20, 0x1, 0xa, 0xc8, 0x0, 0x26, 0x0, 0xab, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x26, 0x0, 0xac, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}}},
|
||||
{Country: "Ireland", City: "Dublin", ISP: "M247", Owned: false, IPs: []net.IP{{217, 138, 222, 82}, {217, 138, 222, 90}}, IPsV6: []net.IP{{0x20, 0x1, 0xa, 0xc8, 0x0, 0x88, 0x0, 0x5a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x88, 0x0, 0x5b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}}},
|
||||
{Country: "Israel", City: "Tel Aviv", ISP: "HQServ", Owned: false, IPs: []net.IP{{185, 191, 207, 210}}, IPsV6: []net.IP{{0x2a, 0xa, 0x1d, 0xc4, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "Italy", City: "Milan", ISP: "M247", Owned: false, IPs: []net.IP{{89, 40, 182, 146}, {89, 40, 182, 210}, {192, 145, 127, 98}, {192, 145, 127, 114}}, IPsV6: []net.IP{{0x20, 0x1, 0xa, 0xc8, 0x0, 0x24, 0x0, 0x76, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x24, 0x0, 0x77, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x24, 0x0, 0x78, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x24, 0x0, 0x79, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}}},
|
||||
{Country: "Japan", City: "Tokyo", ISP: "M247", Owned: false, IPs: []net.IP{{217, 138, 252, 50}, {217, 138, 252, 162}, {217, 138, 252, 178}, {217, 138, 252, 194}, {217, 138, 252, 210}}, IPsV6: []net.IP{{0x20, 0x1, 0xa, 0xc8, 0x0, 0x40, 0x0, 0xb1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x40, 0x0, 0xb2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x40, 0x0, 0xb3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x40, 0x0, 0xb4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x40, 0x0, 0xb5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f}}},
|
||||
{Country: "Latvia", City: "Riga", ISP: "Makonix", Owned: false, IPs: []net.IP{{31, 170, 22, 2}}, IPsV6: []net.IP{{0x2a, 0x0, 0xc, 0x68, 0x0, 0x0, 0xcb, 0xcf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "Luxembourg", City: "Luxembourg", ISP: "Evoluso", Owned: false, IPs: []net.IP{{92, 223, 89, 160}, {92, 223, 89, 182}}, IPsV6: []net.IP{{0x2a, 0x3, 0x90, 0xc0, 0x0, 0x83, 0x29, 0x53, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x2a, 0x3, 0x90, 0xc0, 0x0, 0x83, 0x29, 0x53, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}}},
|
||||
{Country: "Moldova", City: "Chisinau", ISP: "Trabia", Owned: false, IPs: []net.IP{{178, 175, 142, 194}}, IPsV6: []net.IP{{0x2a, 0x0, 0x1d, 0xc0, 0x29, 0x25, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "Netherlands", City: "Amsterdam", ISP: "31173", Owned: true, IPs: []net.IP{{185, 65, 134, 131}, {185, 65, 134, 132}, {185, 65, 134, 133}, {185, 65, 134, 134}, {185, 65, 134, 135}, {185, 65, 134, 136}, {185, 65, 134, 139}, {185, 65, 134, 140}, {185, 65, 134, 141}, {185, 65, 134, 142}, {185, 65, 134, 143}, {185, 65, 134, 144}, {185, 65, 134, 145}, {185, 65, 134, 146}, {185, 65, 134, 147}, {185, 65, 134, 148}}, IPsV6: []net.IP{{0x2a, 0x3, 0x1b, 0x20, 0x0, 0x3, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x3, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x3, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x3, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x3, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x3, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x3, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x3, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0xf}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x3, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x1f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x3, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x2f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x3, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x3f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x3, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x4f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x3, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x5f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x3, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x6f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x3, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x7f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x3, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x8f}}},
|
||||
{Country: "New Zealand", City: "Auckland", ISP: "Intergrid", Owned: false, IPs: []net.IP{{103, 231, 91, 114}}, IPsV6: []net.IP{{0x24, 0x0, 0xfa, 0x80, 0x0, 0x4, 0x0, 0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "Norway", City: "Oslo", ISP: "Blix", Owned: true, IPs: []net.IP{{91, 90, 44, 11}, {91, 90, 44, 12}, {91, 90, 44, 13}, {91, 90, 44, 14}, {91, 90, 44, 15}, {91, 90, 44, 16}, {91, 90, 44, 17}, {91, 90, 44, 18}}, IPsV6: []net.IP{{0x2a, 0x2, 0x20, 0xc8, 0x41, 0x24, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x2a, 0x2, 0x20, 0xc8, 0x41, 0x24, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x2a, 0x2, 0x20, 0xc8, 0x41, 0x24, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x2a, 0x2, 0x20, 0xc8, 0x41, 0x24, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}, {0x2a, 0x2, 0x20, 0xc8, 0x41, 0x24, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f}, {0x2a, 0x2, 0x20, 0xc8, 0x41, 0x24, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6f}, {0x2a, 0x2, 0x20, 0xc8, 0x41, 0x24, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f}, {0x2a, 0x2, 0x20, 0xc8, 0x41, 0x24, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8f}}},
|
||||
{Country: "Poland", City: "Warsaw", ISP: "M247", Owned: false, IPs: []net.IP{{37, 120, 156, 162}, {37, 120, 211, 186}, {37, 120, 211, 194}, {37, 120, 211, 202}, {185, 244, 214, 210}, {185, 244, 214, 215}}, IPsV6: []net.IP{{0x2a, 0xd, 0x56, 0x0, 0x0, 0x13, 0x0, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x13, 0x0, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x13, 0x0, 0x39, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x13, 0x0, 0x3a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x13, 0x0, 0x3b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x13, 0xb, 0xb1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "Romania", City: "Bucharest", ISP: "M247", Owned: false, IPs: []net.IP{{185, 163, 110, 66}, {185, 163, 110, 98}}, IPsV6: []net.IP{{0x2a, 0x4, 0x9d, 0xc0, 0x0, 0x0, 0x0, 0x90, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x1f}, {0x2a, 0x4, 0x9d, 0xc0, 0x0, 0x0, 0x0, 0x92, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x3f}}},
|
||||
{Country: "Serbia", City: "Belgrade", ISP: "M247", Owned: false, IPs: []net.IP{{89, 38, 224, 98}, {89, 38, 224, 114}}, IPsV6: []net.IP{{0x20, 0x1, 0xa, 0xc8, 0x0, 0x7d, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x7d, 0x0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}}},
|
||||
{Country: "Serbia", City: "Nis", ISP: "ninet", Owned: false, IPs: []net.IP{{176, 104, 107, 118}}, IPsV6: []net.IP{{0x2a, 0x6, 0x1, 0x85, 0x0, 0x1, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "Singapore", City: "Singapore", ISP: "M247", Owned: false, IPs: []net.IP{{89, 38, 225, 34}, {94, 198, 43, 2}, {94, 198, 43, 18}}, IPsV6: []net.IP{{0x2a, 0xa, 0xb6, 0x40, 0x0, 0x1, 0x0, 0x54, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x2a, 0xa, 0xb6, 0x40, 0x0, 0x1, 0x0, 0x55, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x2a, 0xa, 0xb6, 0x40, 0x0, 0x1, 0x0, 0x56, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}}},
|
||||
{Country: "Spain", City: "Madrid", ISP: "M247", Owned: false, IPs: []net.IP{{45, 152, 183, 26}, {45, 152, 183, 42}, {89, 238, 178, 34}, {89, 238, 178, 74}, {195, 206, 107, 146}}, IPsV6: []net.IP{{0x20, 0x1, 0xa, 0xc8, 0x0, 0x23, 0x0, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x23, 0x0, 0x12, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf2}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x23, 0x0, 0x2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x23, 0x0, 0x58, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x23, 0x0, 0x59, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f}}},
|
||||
{Country: "Sweden", City: "Gothenburg", ISP: "31173", Owned: true, IPs: []net.IP{{185, 213, 154, 131}, {185, 213, 154, 132}, {185, 213, 154, 133}, {185, 213, 154, 134}, {185, 213, 154, 135}, {185, 213, 154, 136}, {185, 213, 154, 137}, {185, 213, 154, 138}, {185, 213, 154, 139}, {185, 213, 154, 140}, {185, 213, 154, 141}, {185, 213, 154, 142}}, IPsV6: []net.IP{{0x2a, 0x3, 0x1b, 0x20, 0x0, 0x5, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x5, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x5, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0xf}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x5, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x1f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x5, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x2f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x5, 0xf0, 0x11, 0x0, 0x31, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x5, 0xf0, 0x11, 0x0, 0x31, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x5, 0xf0, 0x11, 0x0, 0x31, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x5, 0xf0, 0x11, 0x0, 0x31, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x5, 0xf0, 0x11, 0x0, 0x31, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x5, 0xf0, 0x11, 0x0, 0x31, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x5, 0xf0, 0x11, 0x0, 0x31, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f}}},
|
||||
{Country: "Sweden", City: "Helsingborg", ISP: "31173", Owned: true, IPs: []net.IP{{185, 213, 152, 131}, {185, 213, 152, 132}}, IPsV6: []net.IP{{0x2a, 0x3, 0x1b, 0x20, 0x0, 0x2, 0xf7, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x2, 0xf7, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}}},
|
||||
{Country: "Sweden", City: "Malmö", ISP: "31173", Owned: true, IPs: []net.IP{{45, 83, 220, 87}, {45, 83, 220, 88}, {45, 83, 220, 89}, {45, 83, 220, 90}, {45, 83, 220, 91}, {45, 83, 220, 92}, {45, 83, 220, 93}, {141, 98, 255, 83}, {141, 98, 255, 84}, {141, 98, 255, 85}, {141, 98, 255, 86}, {141, 98, 255, 87}, {141, 98, 255, 88}, {141, 98, 255, 89}, {141, 98, 255, 90}, {141, 98, 255, 91}, {141, 98, 255, 92}, {141, 98, 255, 93}, {141, 98, 255, 94}, {193, 138, 218, 132}, {193, 138, 218, 133}, {193, 138, 218, 134}, {193, 138, 218, 135}, {193, 138, 218, 136}, {193, 138, 218, 137}}, IPsV6: []net.IP{{0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xe0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xe0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xe0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xe0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0xf}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xe0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x1f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xe0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x2f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xe0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x3f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xf4, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x3f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xf4, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x4f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xf4, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x5f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xf4, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x6f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xf4, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x7f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xf4, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x8f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xf4, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x9f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xf4, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0xf}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xf4, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x1f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xf4, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x2f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xf4, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x3f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xf4, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x4f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xf4, 0x10, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xf4, 0x10, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xf4, 0x10, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xf4, 0x10, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xf4, 0x10, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x1, 0xf4, 0x10, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f}}},
|
||||
{Country: "Sweden", City: "Stockholm", ISP: "31173", Owned: true, IPs: []net.IP{{185, 65, 135, 136}, {185, 65, 135, 137}, {185, 65, 135, 138}, {185, 65, 135, 139}, {185, 65, 135, 140}, {185, 65, 135, 141}, {185, 65, 135, 142}, {185, 65, 135, 143}, {185, 65, 135, 144}, {185, 65, 135, 145}, {185, 65, 135, 146}, {185, 65, 135, 147}, {185, 65, 135, 148}, {185, 65, 135, 149}, {185, 65, 135, 150}, {185, 65, 135, 151}, {185, 65, 135, 152}, {185, 65, 135, 153}, {185, 65, 135, 154}}, IPsV6: []net.IP{{0x2a, 0x3, 0x1b, 0x20, 0x0, 0x4, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x4, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x4, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x4, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x4, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0xf}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x4, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x1f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x4, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x2f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x4, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x3f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x4, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x4e}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x4, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x5f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x4, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x6f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x4, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x7f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x4, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x8f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x4, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x9f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x4, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0xf}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x4, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x1f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x4, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x2f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x4, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x3f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x4, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x4f}}},
|
||||
{Country: "Switzerland", City: "Zurich", ISP: "31173", Owned: true, IPs: []net.IP{{193, 32, 127, 81}, {193, 32, 127, 82}, {193, 32, 127, 83}, {193, 32, 127, 84}}, IPsV6: []net.IP{{0x2a, 0x3, 0x1b, 0x20, 0x0, 0xa, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0xa, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0xa, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0xa, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}}},
|
||||
{Country: "Switzerland", City: "Zurich", ISP: "M247", Owned: false, IPs: []net.IP{{91, 193, 4, 2}, {91, 193, 4, 18}, {91, 193, 4, 34}, {91, 193, 4, 50}, {91, 193, 4, 66}}, IPsV6: []net.IP{{0x20, 0x1, 0xa, 0xc8, 0x0, 0x28, 0x0, 0x84, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x28, 0x0, 0x85, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x28, 0x0, 0x86, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x28, 0x0, 0x87, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x28, 0x0, 0x97, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "Switzerland", City: "Zurich", ISP: "PrivateLayer", Owned: false, IPs: []net.IP{{81, 17, 20, 34}, {179, 43, 128, 170}}, IPsV6: []net.IP{{0x2a, 0x2, 0x29, 0xb8, 0xdc, 0x1, 0x5, 0x97, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x2a, 0x2, 0x29, 0xb8, 0xdc, 0x1, 0x18, 0x81, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}}},
|
||||
{Country: "UK", City: "London", ISP: "31173", Owned: true, IPs: []net.IP{{141, 98, 252, 131}, {141, 98, 252, 132}, {141, 98, 252, 133}, {141, 98, 252, 138}, {141, 98, 252, 139}, {141, 98, 252, 140}, {185, 195, 232, 84}, {185, 195, 232, 85}, {185, 195, 232, 86}}, IPsV6: []net.IP{{0x2a, 0x3, 0x1b, 0x20, 0x0, 0x7, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x7, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x7, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x7, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x7, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x7, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x7, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x7, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9f}, {0x2a, 0x3, 0x1b, 0x20, 0x0, 0x7, 0xf0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0xf}}},
|
||||
{Country: "UK", City: "London", ISP: "M247", Owned: false, IPs: []net.IP{{45, 87, 215, 50}, {185, 200, 118, 178}}, IPsV6: []net.IP{{0x20, 0x1, 0xa, 0xc8, 0x0, 0x31, 0x2, 0x35, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x31, 0x2, 0x36, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}}},
|
||||
{Country: "UK", City: "Manchester", ISP: "M247", Owned: false, IPs: []net.IP{{37, 120, 159, 164}, {89, 238, 132, 36}, {194, 37, 96, 180}, {217, 151, 98, 68}}, IPsV6: []net.IP{{0x20, 0x1, 0xa, 0xc8, 0x0, 0x21, 0x0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x21, 0x0, 0x1b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x21, 0x0, 0x34, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x21, 0x0, 0x45, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "USA", City: "Atlanta GA", ISP: "100TB", Owned: false, IPs: []net.IP{{66, 115, 180, 227}, {66, 115, 180, 228}, {66, 115, 180, 229}, {66, 115, 180, 230}, {107, 152, 108, 62}}, IPsV6: []net.IP{{0x26, 0x7, 0xf7, 0xa0, 0x0, 0x1, 0x0, 0xd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x26, 0x7, 0xf7, 0xa0, 0x0, 0x1, 0x0, 0xd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x26, 0x7, 0xf7, 0xa0, 0x0, 0x1, 0x0, 0xd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}, {0x26, 0x7, 0xf7, 0xa0, 0x0, 0x1, 0x0, 0xd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f}, {0x26, 0x7, 0xf7, 0xa0, 0x0, 0x6, 0x0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0xf}}},
|
||||
{Country: "USA", City: "Atlanta GA", ISP: "Quadranet", Owned: false, IPs: []net.IP{{104, 129, 24, 242}}, IPsV6: []net.IP{{0x26, 0x7, 0xfc, 0xd0, 0xaa, 0x80, 0x13, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}}},
|
||||
{Country: "USA", City: "Chicago IL", ISP: "Quadranet", Owned: false, IPs: []net.IP{{104, 129, 31, 26}}, IPsV6: []net.IP{{0x26, 0x7, 0xfc, 0xd0, 0xbb, 0x80, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "USA", City: "Chicago IL", ISP: "Tzulo", Owned: false, IPs: []net.IP{{68, 235, 43, 10}, {68, 235, 43, 18}, {68, 235, 43, 26}, {68, 235, 43, 34}, {68, 235, 43, 42}, {68, 235, 43, 50}, {68, 235, 43, 58}, {68, 235, 43, 66}, {68, 235, 43, 74}, {68, 235, 43, 122}}, IPsV6: []net.IP{{0x26, 0x7, 0x90, 0x0, 0x0, 0x0, 0x0, 0x51, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x26, 0x7, 0x90, 0x0, 0x0, 0x0, 0x0, 0x52, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x26, 0x7, 0x90, 0x0, 0x0, 0x0, 0x0, 0x53, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}, {0x26, 0x7, 0x90, 0x0, 0x0, 0x0, 0x0, 0x54, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f}, {0x26, 0x7, 0x90, 0x0, 0x0, 0x0, 0x0, 0x55, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6f}, {0x26, 0x7, 0x90, 0x0, 0x0, 0x0, 0x0, 0x56, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f}, {0x26, 0x7, 0x90, 0x0, 0x0, 0x0, 0x0, 0x57, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8f}, {0x26, 0x7, 0x90, 0x0, 0x0, 0x0, 0x0, 0x58, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9f}, {0x26, 0x7, 0x90, 0x0, 0x0, 0x0, 0x0, 0x59, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0xf}, {0x26, 0x7, 0x90, 0x0, 0x0, 0x0, 0x0, 0x65, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "USA", City: "Dallas TX", ISP: "100TB", Owned: false, IPs: []net.IP{{174, 127, 113, 3}, {174, 127, 113, 4}, {174, 127, 113, 5}, {174, 127, 113, 6}, {174, 127, 113, 7}}, IPsV6: []net.IP{{0x26, 0x6, 0x2e, 0x0, 0x80, 0x7, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x26, 0x6, 0x2e, 0x0, 0x80, 0x7, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x26, 0x6, 0x2e, 0x0, 0x80, 0x7, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x26, 0x6, 0x2e, 0x0, 0x80, 0x7, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}, {0x26, 0x6, 0x2e, 0x0, 0x80, 0x7, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f}}},
|
||||
{Country: "USA", City: "Dallas TX", ISP: "M247", Owned: false, IPs: []net.IP{{193, 27, 13, 34}, {193, 27, 13, 50}, {193, 27, 13, 66}, {193, 27, 13, 82}, {193, 27, 13, 178}}, IPsV6: []net.IP{{0x20, 0x1, 0xa, 0xc8, 0x0, 0x9a, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x9a, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x9a, 0x0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x9a, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f}, {0x20, 0x1, 0xa, 0xc8, 0x0, 0x9a, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "USA", City: "Dallas TX", ISP: "Quadranet", Owned: false, IPs: []net.IP{{96, 44, 145, 18}, {96, 44, 147, 130}}, IPsV6: []net.IP{{0x26, 0x7, 0xfc, 0xd0, 0xda, 0x80, 0x18, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8}, {0x26, 0x7, 0xfc, 0xd0, 0xda, 0x80, 0x18, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9}}},
|
||||
{Country: "USA", City: "Denver CO", ISP: "Tzulo", Owned: false, IPs: []net.IP{{198, 54, 128, 66}, {198, 54, 128, 74}, {198, 54, 128, 106}}, IPsV6: []net.IP{{0x26, 0x7, 0x90, 0x0, 0x20, 0x0, 0x0, 0x17, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x26, 0x7, 0x90, 0x0, 0x20, 0x0, 0x0, 0x18, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x26, 0x7, 0x90, 0x0, 0x20, 0x0, 0x0, 0x22, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}}},
|
||||
{Country: "USA", City: "Los Angeles CA", ISP: "100TB", Owned: false, IPs: []net.IP{{104, 200, 152, 66}, {107, 181, 168, 130}}, IPsV6: []net.IP{{0x26, 0x7, 0xf7, 0xa0, 0x0, 0x3, 0x0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8f}, {0x26, 0x7, 0xf7, 0xa0, 0x0, 0x3, 0x0, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f}}},
|
||||
{Country: "USA", City: "Los Angeles CA", ISP: "M247", Owned: false, IPs: []net.IP{{89, 46, 114, 15}, {89, 46, 114, 28}, {89, 46, 114, 41}, {89, 46, 114, 54}, {89, 46, 114, 67}, {89, 46, 114, 80}, {89, 46, 114, 93}, {89, 46, 114, 106}, {89, 46, 114, 119}, {89, 46, 114, 132}, {89, 46, 114, 145}, {89, 46, 114, 158}, {89, 46, 114, 171}, {89, 46, 114, 184}, {89, 46, 114, 197}, {89, 46, 114, 210}}, IPsV6: []net.IP{{0x2a, 0xd, 0x56, 0x0, 0x0, 0x8, 0x0, 0xe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x8, 0x0, 0xe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x8, 0x0, 0xe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x8, 0x0, 0xe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x8, 0x0, 0xe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x8, 0x0, 0xe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x8, 0x0, 0xe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x8, 0x0, 0xe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x8, 0x0, 0xe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x8, 0x0, 0xe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0xf}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x8, 0x0, 0xe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x1f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x8, 0x0, 0xe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x2f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x8, 0x0, 0xe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x3f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x8, 0x0, 0xe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x4f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x8, 0x0, 0xe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x5f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x8, 0x0, 0xe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x6f}}},
|
||||
{Country: "USA", City: "Los Angeles CA", ISP: "Tzulo", Owned: false, IPs: []net.IP{{198, 54, 129, 74}, {198, 54, 129, 82}}, IPsV6: []net.IP{{0x26, 0x7, 0x90, 0x0, 0x30, 0x0, 0x0, 0x17, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x26, 0x7, 0x90, 0x0, 0x30, 0x0, 0x0, 0x18, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "USA", City: "Miami FL", ISP: "M247", Owned: false, IPs: []net.IP{{94, 198, 42, 50}, {94, 198, 42, 66}, {94, 198, 42, 82}, {94, 198, 42, 98}, {193, 27, 12, 2}, {193, 27, 12, 18}}, IPsV6: []net.IP{{0x2a, 0xd, 0x56, 0x0, 0x0, 0x6, 0x0, 0x33, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x6, 0x0, 0x34, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x6, 0x0, 0x35, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x6, 0x0, 0x36, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x6, 0xa, 0xd6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x6, 0xa, 0xd7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
{Country: "USA", City: "New York NY", ISP: "100TB", Owned: false, IPs: []net.IP{{107, 182, 226, 206}, {107, 182, 226, 218}}, IPsV6: []net.IP{{0x26, 0x6, 0x2e, 0x0, 0x80, 0x3, 0x0, 0x13, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6f}, {0x26, 0x6, 0x2e, 0x0, 0x80, 0x3, 0x0, 0x13, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f}}},
|
||||
{Country: "USA", City: "New York NY", ISP: "M247", Owned: false, IPs: []net.IP{{86, 106, 121, 15}, {86, 106, 121, 28}, {86, 106, 121, 41}, {86, 106, 121, 54}, {86, 106, 121, 67}, {86, 106, 121, 80}, {86, 106, 121, 93}, {86, 106, 121, 106}, {86, 106, 121, 119}, {89, 46, 62, 15}, {89, 46, 62, 28}, {89, 46, 62, 41}, {89, 46, 62, 54}, {89, 46, 62, 67}, {89, 46, 62, 80}, {89, 46, 62, 93}, {89, 46, 62, 106}, {89, 46, 62, 119}}, IPsV6: []net.IP{{0x2a, 0xd, 0x56, 0x0, 0x0, 0x24, 0xa, 0x71, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x24, 0xa, 0x72, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x24, 0xa, 0x73, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x24, 0xa, 0x74, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x24, 0xa, 0x75, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x24, 0xa, 0x76, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x24, 0xa, 0x77, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x24, 0xa, 0x78, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x24, 0xa, 0x79, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x24, 0xa, 0x99, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x1f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x24, 0xa, 0x9a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x2f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x24, 0xa, 0x9b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x3f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x24, 0xa, 0x9c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x4f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x24, 0xa, 0x9d, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x5f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x24, 0xa, 0x9e, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x6f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x24, 0xa, 0x9f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x7f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x24, 0xa, 0xa1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x8f}, {0x2a, 0xd, 0x56, 0x0, 0x0, 0x24, 0xa, 0xa2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x9f}}},
|
||||
{Country: "USA", City: "Phoenix AZ", ISP: "100TB", Owned: false, IPs: []net.IP{{107, 152, 99, 86}}, IPsV6: []net.IP{{0x26, 0x7, 0xf7, 0xa0, 0x0, 0x5, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}}},
|
||||
{Country: "USA", City: "Phoenix AZ", ISP: "Tzulo", Owned: false, IPs: []net.IP{{198, 54, 133, 34}, {198, 54, 133, 50}, {198, 54, 133, 66}}, IPsV6: []net.IP{{0x26, 0x7, 0x90, 0x0, 0x70, 0x0, 0x0, 0x12, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x1f}, {0x26, 0x7, 0x90, 0x0, 0x70, 0x0, 0x0, 0x13, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x2f}, {0x26, 0x7, 0x90, 0x0, 0x70, 0x0, 0x0, 0x14, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x3f}}},
|
||||
{Country: "USA", City: "Raleigh NC", ISP: "Tzulo", Owned: false, IPs: []net.IP{{198, 54, 130, 34}, {198, 54, 130, 50}, {198, 54, 130, 66}}, IPsV6: []net.IP{{0x26, 0x7, 0x90, 0x0, 0x40, 0x0, 0x0, 0x12, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x1f}, {0x26, 0x7, 0x90, 0x0, 0x40, 0x0, 0x0, 0x13, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x2f}, {0x26, 0x7, 0x90, 0x0, 0x40, 0x0, 0x0, 0x14, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x3f}}},
|
||||
{Country: "USA", City: "Salt Lake City UT", ISP: "100TB", Owned: false, IPs: []net.IP{{69, 4, 234, 132}, {69, 4, 234, 133}, {69, 4, 234, 134}, {69, 4, 234, 135}, {69, 4, 234, 136}, {69, 4, 234, 137}}, IPsV6: []net.IP{{0x26, 0x6, 0x2e, 0x0, 0x0, 0x0, 0x0, 0xb9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x26, 0x6, 0x2e, 0x0, 0x0, 0x0, 0x0, 0xb9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x26, 0x6, 0x2e, 0x0, 0x0, 0x0, 0x0, 0xb9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x26, 0x6, 0x2e, 0x0, 0x0, 0x0, 0x0, 0xb9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f}, {0x26, 0x6, 0x2e, 0x0, 0x0, 0x0, 0x0, 0xb9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f}, {0x26, 0x6, 0x2e, 0x0, 0x0, 0x0, 0x0, 0xb9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6f}}},
|
||||
{Country: "USA", City: "San Jose CA", ISP: "Tzulo", Owned: false, IPs: []net.IP{{198, 54, 134, 34}, {198, 54, 134, 50}, {198, 54, 134, 66}}, IPsV6: []net.IP{{0x26, 0x7, 0x90, 0x0, 0x80, 0x0, 0x0, 0x12, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x26, 0x7, 0x90, 0x0, 0x80, 0x0, 0x0, 0x13, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}, {0x26, 0x7, 0x90, 0x0, 0x80, 0x0, 0x0, 0x14, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}}},
|
||||
{Country: "USA", City: "Seattle WA", ISP: "100TB", Owned: false, IPs: []net.IP{{104, 200, 129, 42}, {104, 200, 129, 110}, {104, 200, 129, 150}}, IPsV6: []net.IP{{0x26, 0x7, 0xf7, 0xa0, 0x0, 0xc, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5}, {0x26, 0x7, 0xf7, 0xa0, 0x0, 0xc, 0x0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f}, {0x26, 0x7, 0xf7, 0xa0, 0x0, 0xc, 0x0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}}},
|
||||
{Country: "USA", City: "Seattle WA", ISP: "Tzulo", Owned: false, IPs: []net.IP{{198, 54, 131, 34}, {198, 54, 131, 50}, {198, 54, 131, 66}}, IPsV6: []net.IP{{0x26, 0x7, 0x90, 0x0, 0x50, 0x0, 0x0, 0x12, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x1f}, {0x26, 0x7, 0x90, 0x0, 0x50, 0x0, 0x0, 0x13, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x2f}, {0x26, 0x7, 0x90, 0x0, 0x50, 0x0, 0x0, 0x14, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x3f}}},
|
||||
{Country: "USA", City: "Secaucus NJ", ISP: "Quadranet", Owned: false, IPs: []net.IP{{23, 226, 131, 130}, {23, 226, 131, 154}}, IPsV6: []net.IP{{0x26, 0x7, 0xfc, 0xd0, 0xcc, 0xc0, 0x1d, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}, {0x26, 0x7, 0xfc, 0xd0, 0xcc, 0xc0, 0x1d, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2f}}},
|
||||
{Country: "United Arab Emirates", City: "Dubai", ISP: "M247", Owned: false, IPs: []net.IP{{45, 9, 249, 34}}, IPsV6: []net.IP{{0x20, 0x1, 0xa, 0xc8, 0x0, 0x81, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f}}},
|
||||
}
|
||||
// MullvadServers returns a slice of all the server information for Mullvad.
|
||||
func MullvadServers() (servers []models.MullvadServer) {
|
||||
servers = make([]models.MullvadServer, len(allServers.Mullvad.Servers))
|
||||
copy(servers, allServers.Mullvad.Servers)
|
||||
return servers
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,21 @@
|
||||
package constants
|
||||
|
||||
import (
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
const (
|
||||
TUN = "tun0"
|
||||
TAP = "tap0"
|
||||
)
|
||||
|
||||
const (
|
||||
TUN models.VPNDevice = "tun0"
|
||||
TAP models.VPNDevice = "tap0"
|
||||
AES128cbc = "aes-128-cbc"
|
||||
AES256cbc = "aes-256-cbc"
|
||||
AES128gcm = "aes-128-gcm"
|
||||
AES256gcm = "aes-256-gcm"
|
||||
SHA1 = "sha1"
|
||||
SHA256 = "sha256"
|
||||
SHA512 = "sha512"
|
||||
)
|
||||
|
||||
const (
|
||||
Openvpn24 = "2.4"
|
||||
Openvpn25 = "2.5"
|
||||
)
|
||||
|
||||
@@ -1,34 +1,30 @@
|
||||
package constants
|
||||
|
||||
import (
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
)
|
||||
|
||||
const (
|
||||
// UnboundConf is the file path to the Unbound configuration file.
|
||||
UnboundConf models.Filepath = "/etc/unbound/unbound.conf"
|
||||
UnboundConf string = "/etc/unbound/unbound.conf"
|
||||
// ResolvConf is the file path to the system resolv.conf file.
|
||||
ResolvConf models.Filepath = "/etc/resolv.conf"
|
||||
ResolvConf string = "/etc/resolv.conf"
|
||||
// CACertificates is the file path to the CA certificates file.
|
||||
CACertificates models.Filepath = "/etc/ssl/certs/ca-certificates.crt"
|
||||
CACertificates string = "/etc/ssl/certs/ca-certificates.crt"
|
||||
// OpenVPNAuthConf is the file path to the OpenVPN auth file.
|
||||
OpenVPNAuthConf models.Filepath = "/etc/openvpn/auth.conf"
|
||||
OpenVPNAuthConf string = "/etc/openvpn/auth.conf"
|
||||
// OpenVPNConf is the file path to the OpenVPN client configuration file.
|
||||
OpenVPNConf models.Filepath = "/etc/openvpn/target.ovpn"
|
||||
OpenVPNConf string = "/etc/openvpn/target.ovpn"
|
||||
// PIAPortForward is the file path to the port forwarding JSON information for PIA servers.
|
||||
PIAPortForward models.Filepath = "/gluetun/piaportforward.json"
|
||||
PIAPortForward string = "/gluetun/piaportforward.json"
|
||||
// TunnelDevice is the file path to tun device.
|
||||
TunnelDevice models.Filepath = "/dev/net/tun"
|
||||
TunnelDevice string = "/dev/net/tun"
|
||||
// NetRoute is the path to the file containing information on the network route.
|
||||
NetRoute models.Filepath = "/proc/net/route"
|
||||
NetRoute string = "/proc/net/route"
|
||||
// RootHints is the filepath to the root.hints file used by Unbound.
|
||||
RootHints models.Filepath = "/etc/unbound/root.hints"
|
||||
RootHints string = "/etc/unbound/root.hints"
|
||||
// RootKey is the filepath to the root.key file used by Unbound.
|
||||
RootKey models.Filepath = "/etc/unbound/root.key"
|
||||
// Client key filepath, used by Cyberghost.
|
||||
ClientKey models.Filepath = "/gluetun/client.key"
|
||||
// Client certificate filepath, used by Cyberghost.
|
||||
ClientCertificate models.Filepath = "/gluetun/client.crt"
|
||||
// Servers information filepath.
|
||||
RootKey string = "/etc/unbound/root.key"
|
||||
// ClientKey is the client key filepath.
|
||||
ClientKey string = "/gluetun/client.key"
|
||||
// ClientCertificate is the client certificate filepath.
|
||||
ClientCertificate string = "/gluetun/client.crt"
|
||||
// ServersData is the server information filepath.
|
||||
ServersData = "/gluetun/servers.json"
|
||||
)
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package constants
|
||||
|
||||
import (
|
||||
"net"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
)
|
||||
|
||||
//nolint:lll
|
||||
const (
|
||||
PIAEncryptionPresetNone = "none"
|
||||
PIAEncryptionPresetNormal = "normal"
|
||||
PIAEncryptionPresetStrong = "strong"
|
||||
PiaX509CRLNormal = "MIICWDCCAUAwDQYJKoZIhvcNAQENBQAwgegxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTETMBEGA1UEBxMKTG9zQW5nZWxlczEgMB4GA1UEChMXUHJpdmF0ZSBJbnRlcm5ldCBBY2Nlc3MxIDAeBgNVBAsTF1ByaXZhdGUgSW50ZXJuZXQgQWNjZXNzMSAwHgYDVQQDExdQcml2YXRlIEludGVybmV0IEFjY2VzczEgMB4GA1UEKRMXUHJpdmF0ZSBJbnRlcm5ldCBBY2Nlc3MxLzAtBgkqhkiG9w0BCQEWIHNlY3VyZUBwcml2YXRlaW50ZXJuZXRhY2Nlc3MuY29tFw0xNjA3MDgxOTAwNDZaFw0zNjA3MDMxOTAwNDZaMCYwEQIBARcMMTYwNzA4MTkwMDQ2MBECAQYXDDE2MDcwODE5MDA0NjANBgkqhkiG9w0BAQ0FAAOCAQEAQZo9X97ci8EcPYu/uK2HB152OZbeZCINmYyluLDOdcSvg6B5jI+ffKN3laDvczsG6CxmY3jNyc79XVpEYUnq4rT3FfveW1+Ralf+Vf38HdpwB8EWB4hZlQ205+21CALLvZvR8HcPxC9KEnev1mU46wkTiov0EKc+EdRxkj5yMgv0V2Reze7AP+NQ9ykvDScH4eYCsmufNpIjBLhpLE2cuZZXBLcPhuRzVoU3l7A9lvzG9mjA5YijHJGHNjlWFqyrn1CfYS6koa4TGEPngBoAziWRbDGdhEgJABHrpoaFYaL61zqyMR6jC0K2ps9qyZAN74LEBedEfK7tBOzWMwr58A=="
|
||||
@@ -22,641 +21,30 @@ func PIAGeoChoices() (choices []string) {
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Region
|
||||
}
|
||||
return choices
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
//nolint:lll
|
||||
func PIAServers() []models.PIAServer {
|
||||
return []models.PIAServer{
|
||||
{Region: "AU Melbourne", ServerName: "melbourne402", Protocol: "udp", PortForward: true, IP: net.IP{27, 50, 74, 220}},
|
||||
{Region: "AU Melbourne", ServerName: "melbourne402", Protocol: "udp", PortForward: true, IP: net.IP{27, 50, 74, 240}},
|
||||
{Region: "AU Melbourne", ServerName: "melbourne403", Protocol: "udp", PortForward: true, IP: net.IP{103, 2, 198, 75}},
|
||||
{Region: "AU Melbourne", ServerName: "melbourne403", Protocol: "udp", PortForward: true, IP: net.IP{103, 2, 198, 78}},
|
||||
{Region: "AU Melbourne", ServerName: "melbourne406", Protocol: "udp", PortForward: true, IP: net.IP{27, 50, 74, 153}},
|
||||
{Region: "AU Melbourne", ServerName: "melbourne406", Protocol: "udp", PortForward: true, IP: net.IP{27, 50, 74, 149}},
|
||||
{Region: "AU Melbourne", ServerName: "melbourne413", Protocol: "udp", PortForward: true, IP: net.IP{27, 50, 74, 126}},
|
||||
{Region: "AU Melbourne", ServerName: "melbourne413", Protocol: "udp", PortForward: true, IP: net.IP{27, 50, 74, 116}},
|
||||
{Region: "AU Melbourne", ServerName: "melbourne414", Protocol: "udp", PortForward: true, IP: net.IP{27, 50, 74, 103}},
|
||||
{Region: "AU Melbourne", ServerName: "melbourne414", Protocol: "udp", PortForward: true, IP: net.IP{27, 50, 74, 110}},
|
||||
{Region: "AU Perth", ServerName: "perth403", Protocol: "udp", PortForward: true, IP: net.IP{43, 250, 205, 148}},
|
||||
{Region: "AU Perth", ServerName: "perth403", Protocol: "udp", PortForward: true, IP: net.IP{43, 250, 205, 154}},
|
||||
{Region: "AU Perth", ServerName: "perth404", Protocol: "udp", PortForward: true, IP: net.IP{43, 250, 205, 186}},
|
||||
{Region: "AU Perth", ServerName: "perth404", Protocol: "udp", PortForward: true, IP: net.IP{43, 250, 205, 179}},
|
||||
{Region: "AU Perth", ServerName: "perth405", Protocol: "udp", PortForward: true, IP: net.IP{43, 250, 205, 139}},
|
||||
{Region: "AU Perth", ServerName: "perth405", Protocol: "udp", PortForward: true, IP: net.IP{43, 250, 205, 139}},
|
||||
{Region: "AU Sydney", ServerName: "sydney403", Protocol: "udp", PortForward: true, IP: net.IP{117, 120, 9, 42}},
|
||||
{Region: "AU Sydney", ServerName: "sydney403", Protocol: "udp", PortForward: true, IP: net.IP{117, 120, 9, 49}},
|
||||
{Region: "AU Sydney", ServerName: "sydney409", Protocol: "udp", PortForward: true, IP: net.IP{117, 120, 10, 143}},
|
||||
{Region: "AU Sydney", ServerName: "sydney409", Protocol: "udp", PortForward: true, IP: net.IP{117, 120, 10, 144}},
|
||||
{Region: "AU Sydney", ServerName: "sydney410", Protocol: "udp", PortForward: true, IP: net.IP{117, 120, 10, 104}},
|
||||
{Region: "AU Sydney", ServerName: "sydney410", Protocol: "udp", PortForward: true, IP: net.IP{117, 120, 10, 123}},
|
||||
{Region: "AU Sydney", ServerName: "sydney413", Protocol: "udp", PortForward: true, IP: net.IP{27, 50, 76, 84}},
|
||||
{Region: "AU Sydney", ServerName: "sydney413", Protocol: "udp", PortForward: true, IP: net.IP{27, 50, 76, 93}},
|
||||
{Region: "AU Sydney", ServerName: "sydney414", Protocol: "udp", PortForward: true, IP: net.IP{27, 50, 76, 99}},
|
||||
{Region: "AU Sydney", ServerName: "sydney414", Protocol: "udp", PortForward: true, IP: net.IP{27, 50, 76, 103}},
|
||||
{Region: "Albania", ServerName: "tirana401", Protocol: "udp", PortForward: true, IP: net.IP{31, 171, 154, 133}},
|
||||
{Region: "Albania", ServerName: "tirana401", Protocol: "udp", PortForward: true, IP: net.IP{31, 171, 154, 133}},
|
||||
{Region: "Albania", ServerName: "tirana402", Protocol: "udp", PortForward: true, IP: net.IP{31, 171, 154, 123}},
|
||||
{Region: "Albania", ServerName: "tirana402", Protocol: "udp", PortForward: true, IP: net.IP{31, 171, 154, 118}},
|
||||
{Region: "Albania", ServerName: "tirana403", Protocol: "udp", PortForward: true, IP: net.IP{31, 171, 154, 68}},
|
||||
{Region: "Albania", ServerName: "tirana403", Protocol: "udp", PortForward: true, IP: net.IP{31, 171, 154, 70}},
|
||||
{Region: "Albania", ServerName: "tirana404", Protocol: "udp", PortForward: true, IP: net.IP{31, 171, 154, 55}},
|
||||
{Region: "Albania", ServerName: "tirana404", Protocol: "udp", PortForward: true, IP: net.IP{31, 171, 154, 61}},
|
||||
{Region: "Algeria", ServerName: "algiers403", Protocol: "udp", PortForward: true, IP: net.IP{176, 125, 228, 4}},
|
||||
{Region: "Algeria", ServerName: "algiers403", Protocol: "udp", PortForward: true, IP: net.IP{176, 125, 228, 4}},
|
||||
{Region: "Algeria", ServerName: "algiers404", Protocol: "udp", PortForward: true, IP: net.IP{176, 125, 228, 24}},
|
||||
{Region: "Algeria", ServerName: "algiers404", Protocol: "udp", PortForward: true, IP: net.IP{176, 125, 228, 26}},
|
||||
{Region: "Andorra", ServerName: "andorra403", Protocol: "udp", PortForward: true, IP: net.IP{188, 241, 82, 9}},
|
||||
{Region: "Andorra", ServerName: "andorra403", Protocol: "udp", PortForward: true, IP: net.IP{188, 241, 82, 5}},
|
||||
{Region: "Andorra", ServerName: "andorra404", Protocol: "udp", PortForward: true, IP: net.IP{188, 241, 82, 25}},
|
||||
{Region: "Andorra", ServerName: "andorra404", Protocol: "udp", PortForward: true, IP: net.IP{188, 241, 82, 24}},
|
||||
{Region: "Andorra", ServerName: "andorra405", Protocol: "udp", PortForward: true, IP: net.IP{188, 241, 82, 38}},
|
||||
{Region: "Andorra", ServerName: "andorra405", Protocol: "udp", PortForward: true, IP: net.IP{188, 241, 82, 38}},
|
||||
{Region: "Argentina", ServerName: "buenosaires401", Protocol: "udp", PortForward: true, IP: net.IP{190, 106, 134, 83}},
|
||||
{Region: "Argentina", ServerName: "buenosaires401", Protocol: "udp", PortForward: true, IP: net.IP{190, 106, 134, 83}},
|
||||
{Region: "Armenia", ServerName: "armenia403", Protocol: "udp", PortForward: true, IP: net.IP{185, 253, 160, 5}},
|
||||
{Region: "Armenia", ServerName: "armenia403", Protocol: "udp", PortForward: true, IP: net.IP{185, 253, 160, 4}},
|
||||
{Region: "Austria", ServerName: "vienna402", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 60, 45}},
|
||||
{Region: "Austria", ServerName: "vienna402", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 60, 27}},
|
||||
{Region: "Austria", ServerName: "vienna403", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 60, 68}},
|
||||
{Region: "Austria", ServerName: "vienna403", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 60, 70}},
|
||||
{Region: "Bahamas", ServerName: "bahamas403", Protocol: "udp", PortForward: true, IP: net.IP{95, 181, 238, 24}},
|
||||
{Region: "Bahamas", ServerName: "bahamas403", Protocol: "udp", PortForward: true, IP: net.IP{95, 181, 238, 18}},
|
||||
{Region: "Bahamas", ServerName: "bahamas404", Protocol: "udp", PortForward: true, IP: net.IP{95, 181, 238, 6}},
|
||||
{Region: "Bahamas", ServerName: "bahamas404", Protocol: "udp", PortForward: true, IP: net.IP{95, 181, 238, 13}},
|
||||
{Region: "Bangladesh", ServerName: "bangladesh403", Protocol: "udp", PortForward: true, IP: net.IP{84, 252, 93, 14}},
|
||||
{Region: "Bangladesh", ServerName: "bangladesh403", Protocol: "udp", PortForward: true, IP: net.IP{84, 252, 93, 9}},
|
||||
{Region: "Belgium", ServerName: "brussels401", Protocol: "udp", PortForward: true, IP: net.IP{89, 249, 73, 212}},
|
||||
{Region: "Belgium", ServerName: "brussels401", Protocol: "udp", PortForward: true, IP: net.IP{89, 249, 73, 213}},
|
||||
{Region: "Belgium", ServerName: "brussels402", Protocol: "udp", PortForward: true, IP: net.IP{217, 138, 211, 253}},
|
||||
{Region: "Belgium", ServerName: "brussels402", Protocol: "udp", PortForward: true, IP: net.IP{217, 138, 211, 246}},
|
||||
{Region: "Belgium", ServerName: "brussels406", Protocol: "udp", PortForward: true, IP: net.IP{194, 110, 115, 28}},
|
||||
{Region: "Belgium", ServerName: "brussels406", Protocol: "udp", PortForward: true, IP: net.IP{194, 110, 115, 18}},
|
||||
{Region: "Belgium", ServerName: "brussels409", Protocol: "udp", PortForward: true, IP: net.IP{91, 90, 123, 6}},
|
||||
{Region: "Belgium", ServerName: "brussels409", Protocol: "udp", PortForward: true, IP: net.IP{91, 90, 123, 8}},
|
||||
{Region: "Belgium", ServerName: "brussels411", Protocol: "udp", PortForward: true, IP: net.IP{91, 90, 123, 57}},
|
||||
{Region: "Belgium", ServerName: "brussels411", Protocol: "udp", PortForward: true, IP: net.IP{91, 90, 123, 59}},
|
||||
{Region: "Bosnia and Herzegovina", ServerName: "sarajevo402", Protocol: "udp", PortForward: true, IP: net.IP{185, 212, 111, 63}},
|
||||
{Region: "Bosnia and Herzegovina", ServerName: "sarajevo402", Protocol: "udp", PortForward: true, IP: net.IP{185, 212, 111, 68}},
|
||||
{Region: "Brazil", ServerName: "saopaolo401", Protocol: "udp", PortForward: true, IP: net.IP{45, 133, 180, 228}},
|
||||
{Region: "Brazil", ServerName: "saopaolo401", Protocol: "udp", PortForward: true, IP: net.IP{45, 133, 180, 229}},
|
||||
{Region: "Brazil", ServerName: "saopaolo402", Protocol: "udp", PortForward: true, IP: net.IP{188, 241, 177, 59}},
|
||||
{Region: "Brazil", ServerName: "saopaolo402", Protocol: "udp", PortForward: true, IP: net.IP{188, 241, 177, 58}},
|
||||
{Region: "Brazil", ServerName: "saopaolo403", Protocol: "udp", PortForward: true, IP: net.IP{188, 241, 177, 118}},
|
||||
{Region: "Brazil", ServerName: "saopaolo403", Protocol: "udp", PortForward: true, IP: net.IP{188, 241, 177, 125}},
|
||||
{Region: "Brazil", ServerName: "saopaolo404", Protocol: "udp", PortForward: true, IP: net.IP{45, 133, 180, 244}},
|
||||
{Region: "Brazil", ServerName: "saopaolo404", Protocol: "udp", PortForward: true, IP: net.IP{45, 133, 180, 249}},
|
||||
{Region: "Bulgaria", ServerName: "sofia402", Protocol: "udp", PortForward: true, IP: net.IP{217, 138, 221, 87}},
|
||||
{Region: "Bulgaria", ServerName: "sofia402", Protocol: "udp", PortForward: true, IP: net.IP{217, 138, 221, 83}},
|
||||
{Region: "Bulgaria", ServerName: "sofia403", Protocol: "udp", PortForward: true, IP: net.IP{217, 138, 221, 76}},
|
||||
{Region: "Bulgaria", ServerName: "sofia403", Protocol: "udp", PortForward: true, IP: net.IP{217, 138, 221, 67}},
|
||||
{Region: "CA Montreal", ServerName: "montreal404", Protocol: "udp", PortForward: true, IP: net.IP{172, 98, 71, 178}},
|
||||
{Region: "CA Montreal", ServerName: "montreal404", Protocol: "udp", PortForward: true, IP: net.IP{172, 98, 71, 173}},
|
||||
{Region: "CA Montreal", ServerName: "montreal406", Protocol: "udp", PortForward: true, IP: net.IP{199, 36, 223, 15}},
|
||||
{Region: "CA Montreal", ServerName: "montreal406", Protocol: "udp", PortForward: true, IP: net.IP{199, 36, 223, 36}},
|
||||
{Region: "CA Montreal", ServerName: "montreal409", Protocol: "udp", PortForward: true, IP: net.IP{172, 98, 68, 33}},
|
||||
{Region: "CA Montreal", ServerName: "montreal409", Protocol: "udp", PortForward: true, IP: net.IP{172, 98, 68, 16}},
|
||||
{Region: "CA Montreal", ServerName: "montreal410", Protocol: "udp", PortForward: true, IP: net.IP{199, 36, 223, 204}},
|
||||
{Region: "CA Montreal", ServerName: "montreal410", Protocol: "udp", PortForward: true, IP: net.IP{199, 36, 223, 240}},
|
||||
{Region: "CA Montreal", ServerName: "montreal411", Protocol: "udp", PortForward: true, IP: net.IP{199, 36, 223, 168}},
|
||||
{Region: "CA Montreal", ServerName: "montreal411", Protocol: "udp", PortForward: true, IP: net.IP{199, 36, 223, 155}},
|
||||
{Region: "CA Ontario", ServerName: "ontario401", Protocol: "udp", PortForward: true, IP: net.IP{172, 83, 47, 128}},
|
||||
{Region: "CA Ontario", ServerName: "ontario401", Protocol: "udp", PortForward: true, IP: net.IP{172, 83, 47, 97}},
|
||||
{Region: "CA Ontario", ServerName: "ontario402", Protocol: "udp", PortForward: true, IP: net.IP{172, 83, 47, 153}},
|
||||
{Region: "CA Ontario", ServerName: "ontario402", Protocol: "udp", PortForward: true, IP: net.IP{172, 83, 47, 153}},
|
||||
{Region: "CA Ontario", ServerName: "ontario406", Protocol: "udp", PortForward: true, IP: net.IP{172, 98, 80, 163}},
|
||||
{Region: "CA Ontario", ServerName: "ontario406", Protocol: "udp", PortForward: true, IP: net.IP{172, 98, 80, 140}},
|
||||
{Region: "CA Ontario", ServerName: "ontario407", Protocol: "udp", PortForward: true, IP: net.IP{172, 98, 80, 10}},
|
||||
{Region: "CA Ontario", ServerName: "ontario407", Protocol: "udp", PortForward: true, IP: net.IP{172, 98, 80, 38}},
|
||||
{Region: "CA Ontario", ServerName: "ontario409", Protocol: "udp", PortForward: true, IP: net.IP{66, 115, 145, 203}},
|
||||
{Region: "CA Ontario", ServerName: "ontario409", Protocol: "udp", PortForward: true, IP: net.IP{66, 115, 145, 230}},
|
||||
{Region: "CA Toronto", ServerName: "toronto403", Protocol: "udp", PortForward: true, IP: net.IP{66, 115, 142, 67}},
|
||||
{Region: "CA Toronto", ServerName: "toronto403", Protocol: "udp", PortForward: true, IP: net.IP{66, 115, 142, 74}},
|
||||
{Region: "CA Toronto", ServerName: "toronto414", Protocol: "udp", PortForward: true, IP: net.IP{154, 3, 40, 4}},
|
||||
{Region: "CA Toronto", ServerName: "toronto414", Protocol: "udp", PortForward: true, IP: net.IP{154, 3, 40, 20}},
|
||||
{Region: "CA Toronto", ServerName: "toronto417", Protocol: "udp", PortForward: true, IP: net.IP{154, 3, 40, 118}},
|
||||
{Region: "CA Toronto", ServerName: "toronto417", Protocol: "udp", PortForward: true, IP: net.IP{154, 3, 40, 96}},
|
||||
{Region: "CA Toronto", ServerName: "toronto418", Protocol: "udp", PortForward: true, IP: net.IP{154, 3, 40, 153}},
|
||||
{Region: "CA Toronto", ServerName: "toronto418", Protocol: "udp", PortForward: true, IP: net.IP{154, 3, 40, 145}},
|
||||
{Region: "CA Toronto", ServerName: "toronto425", Protocol: "udp", PortForward: true, IP: net.IP{154, 3, 42, 119}},
|
||||
{Region: "CA Toronto", ServerName: "toronto425", Protocol: "udp", PortForward: true, IP: net.IP{154, 3, 42, 115}},
|
||||
{Region: "CA Vancouver", ServerName: "vancouver401", Protocol: "udp", PortForward: true, IP: net.IP{162, 216, 47, 48}},
|
||||
{Region: "CA Vancouver", ServerName: "vancouver401", Protocol: "udp", PortForward: true, IP: net.IP{162, 216, 47, 48}},
|
||||
{Region: "CA Vancouver", ServerName: "vancouver406", Protocol: "udp", PortForward: true, IP: net.IP{162, 216, 47, 205}},
|
||||
{Region: "CA Vancouver", ServerName: "vancouver406", Protocol: "udp", PortForward: true, IP: net.IP{162, 216, 47, 203}},
|
||||
{Region: "CA Vancouver", ServerName: "vancouver407", Protocol: "udp", PortForward: true, IP: net.IP{172, 98, 89, 67}},
|
||||
{Region: "CA Vancouver", ServerName: "vancouver407", Protocol: "udp", PortForward: true, IP: net.IP{172, 98, 89, 44}},
|
||||
{Region: "CA Vancouver", ServerName: "vancouver411", Protocol: "udp", PortForward: true, IP: net.IP{208, 78, 42, 138}},
|
||||
{Region: "CA Vancouver", ServerName: "vancouver411", Protocol: "udp", PortForward: true, IP: net.IP{208, 78, 42, 133}},
|
||||
{Region: "CA Vancouver", ServerName: "vancouver412", Protocol: "udp", PortForward: true, IP: net.IP{208, 78, 42, 226}},
|
||||
{Region: "CA Vancouver", ServerName: "vancouver412", Protocol: "udp", PortForward: true, IP: net.IP{208, 78, 42, 247}},
|
||||
{Region: "Cambodia", ServerName: "cambodia401", Protocol: "udp", PortForward: true, IP: net.IP{188, 215, 235, 110}},
|
||||
{Region: "Cambodia", ServerName: "cambodia401", Protocol: "udp", PortForward: true, IP: net.IP{188, 215, 235, 100}},
|
||||
{Region: "Cambodia", ServerName: "cambodia402", Protocol: "udp", PortForward: true, IP: net.IP{188, 215, 235, 125}},
|
||||
{Region: "Cambodia", ServerName: "cambodia402", Protocol: "udp", PortForward: true, IP: net.IP{188, 215, 235, 119}},
|
||||
{Region: "China", ServerName: "china404", Protocol: "udp", PortForward: true, IP: net.IP{188, 241, 80, 9}},
|
||||
{Region: "China", ServerName: "china404", Protocol: "udp", PortForward: true, IP: net.IP{188, 241, 80, 8}},
|
||||
{Region: "Cyprus", ServerName: "cyprus403", Protocol: "udp", PortForward: true, IP: net.IP{185, 253, 162, 3}},
|
||||
{Region: "Cyprus", ServerName: "cyprus403", Protocol: "udp", PortForward: true, IP: net.IP{185, 253, 162, 8}},
|
||||
{Region: "Czech Republic", ServerName: "prague401", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 39, 74}},
|
||||
{Region: "Czech Republic", ServerName: "prague401", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 39, 73}},
|
||||
{Region: "Czech Republic", ServerName: "prague402", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 39, 154}},
|
||||
{Region: "Czech Republic", ServerName: "prague402", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 39, 139}},
|
||||
{Region: "Czech Republic", ServerName: "prague403", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 39, 195}},
|
||||
{Region: "Czech Republic", ServerName: "prague403", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 39, 195}},
|
||||
{Region: "DE Berlin", ServerName: "berlin416", Protocol: "udp", PortForward: true, IP: net.IP{154, 13, 1, 5}},
|
||||
{Region: "DE Berlin", ServerName: "berlin416", Protocol: "udp", PortForward: true, IP: net.IP{154, 13, 1, 6}},
|
||||
{Region: "DE Berlin", ServerName: "berlin417", Protocol: "udp", PortForward: true, IP: net.IP{154, 13, 1, 30}},
|
||||
{Region: "DE Berlin", ServerName: "berlin417", Protocol: "udp", PortForward: true, IP: net.IP{154, 13, 1, 25}},
|
||||
{Region: "DE Berlin", ServerName: "berlin421", Protocol: "udp", PortForward: true, IP: net.IP{154, 13, 1, 88}},
|
||||
{Region: "DE Berlin", ServerName: "berlin421", Protocol: "udp", PortForward: true, IP: net.IP{154, 13, 1, 88}},
|
||||
{Region: "DE Berlin", ServerName: "berlin424", Protocol: "udp", PortForward: true, IP: net.IP{154, 13, 1, 136}},
|
||||
{Region: "DE Berlin", ServerName: "berlin424", Protocol: "udp", PortForward: true, IP: net.IP{154, 13, 1, 126}},
|
||||
{Region: "DE Berlin", ServerName: "berlin425", Protocol: "udp", PortForward: true, IP: net.IP{154, 13, 1, 151}},
|
||||
{Region: "DE Berlin", ServerName: "berlin425", Protocol: "udp", PortForward: true, IP: net.IP{154, 13, 1, 145}},
|
||||
{Region: "DE Frankfurt", ServerName: "frankfurt402", Protocol: "udp", PortForward: true, IP: net.IP{195, 181, 170, 229}},
|
||||
{Region: "DE Frankfurt", ServerName: "frankfurt402", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 57, 217}},
|
||||
{Region: "DE Frankfurt", ServerName: "frankfurt405", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 57, 45}},
|
||||
{Region: "DE Frankfurt", ServerName: "frankfurt405", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 57, 3}},
|
||||
{Region: "DE Frankfurt", ServerName: "frankfurt407", Protocol: "udp", PortForward: true, IP: net.IP{138, 199, 18, 174}},
|
||||
{Region: "DE Frankfurt", ServerName: "frankfurt407", Protocol: "udp", PortForward: true, IP: net.IP{138, 199, 18, 136}},
|
||||
{Region: "DE Frankfurt", ServerName: "frankfurt408", Protocol: "udp", PortForward: true, IP: net.IP{138, 199, 18, 98}},
|
||||
{Region: "DE Frankfurt", ServerName: "frankfurt408", Protocol: "udp", PortForward: true, IP: net.IP{138, 199, 18, 104}},
|
||||
{Region: "DE Frankfurt", ServerName: "frankfurt410", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 57, 184}},
|
||||
{Region: "DE Frankfurt", ServerName: "frankfurt410", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 57, 184}},
|
||||
{Region: "Denmark", ServerName: "copenhagen402", Protocol: "udp", PortForward: true, IP: net.IP{188, 126, 94, 75}},
|
||||
{Region: "Denmark", ServerName: "copenhagen402", Protocol: "udp", PortForward: true, IP: net.IP{188, 126, 94, 89}},
|
||||
{Region: "Denmark", ServerName: "copenhagen403", Protocol: "udp", PortForward: true, IP: net.IP{188, 126, 94, 103}},
|
||||
{Region: "Denmark", ServerName: "copenhagen403", Protocol: "udp", PortForward: true, IP: net.IP{188, 126, 94, 103}},
|
||||
{Region: "Denmark", ServerName: "copenhagen404", Protocol: "udp", PortForward: true, IP: net.IP{188, 126, 94, 176}},
|
||||
{Region: "Denmark", ServerName: "copenhagen404", Protocol: "udp", PortForward: true, IP: net.IP{188, 126, 94, 174}},
|
||||
{Region: "Denmark", ServerName: "copenhagen405", Protocol: "udp", PortForward: true, IP: net.IP{188, 126, 94, 35}},
|
||||
{Region: "Denmark", ServerName: "copenhagen405", Protocol: "udp", PortForward: true, IP: net.IP{188, 126, 94, 47}},
|
||||
{Region: "Egypt", ServerName: "cairo401", Protocol: "udp", PortForward: true, IP: net.IP{188, 214, 122, 107}},
|
||||
{Region: "Egypt", ServerName: "cairo401", Protocol: "udp", PortForward: true, IP: net.IP{188, 214, 122, 100}},
|
||||
{Region: "Egypt", ServerName: "cairo402", Protocol: "udp", PortForward: true, IP: net.IP{188, 214, 122, 118}},
|
||||
{Region: "Egypt", ServerName: "cairo402", Protocol: "udp", PortForward: true, IP: net.IP{188, 214, 122, 118}},
|
||||
{Region: "Estonia", ServerName: "talinn401", Protocol: "udp", PortForward: true, IP: net.IP{77, 247, 111, 138}},
|
||||
{Region: "Estonia", ServerName: "talinn401", Protocol: "udp", PortForward: true, IP: net.IP{77, 247, 111, 138}},
|
||||
{Region: "Estonia", ServerName: "talinn402", Protocol: "udp", PortForward: true, IP: net.IP{95, 153, 31, 68}},
|
||||
{Region: "Estonia", ServerName: "talinn402", Protocol: "udp", PortForward: true, IP: net.IP{95, 153, 31, 75}},
|
||||
{Region: "Finland", ServerName: "helsinki401", Protocol: "udp", PortForward: true, IP: net.IP{188, 126, 89, 23}},
|
||||
{Region: "Finland", ServerName: "helsinki401", Protocol: "udp", PortForward: true, IP: net.IP{188, 126, 89, 27}},
|
||||
{Region: "Finland", ServerName: "helsinki402", Protocol: "udp", PortForward: true, IP: net.IP{188, 126, 89, 57}},
|
||||
{Region: "Finland", ServerName: "helsinki402", Protocol: "udp", PortForward: true, IP: net.IP{188, 126, 89, 57}},
|
||||
{Region: "Finland", ServerName: "helsinki404", Protocol: "udp", PortForward: true, IP: net.IP{188, 126, 89, 93}},
|
||||
{Region: "Finland", ServerName: "helsinki404", Protocol: "udp", PortForward: true, IP: net.IP{188, 126, 89, 84}},
|
||||
{Region: "France", ServerName: "paris402", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 63, 170}},
|
||||
{Region: "France", ServerName: "paris402", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 63, 178}},
|
||||
{Region: "France", ServerName: "paris404", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 63, 4}},
|
||||
{Region: "France", ServerName: "paris404", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 63, 4}},
|
||||
{Region: "France", ServerName: "paris405", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 63, 103}},
|
||||
{Region: "France", ServerName: "paris405", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 63, 93}},
|
||||
{Region: "France", ServerName: "paris406", Protocol: "udp", PortForward: true, IP: net.IP{143, 244, 57, 148}},
|
||||
{Region: "France", ServerName: "paris406", Protocol: "udp", PortForward: true, IP: net.IP{143, 244, 57, 165}},
|
||||
{Region: "France", ServerName: "paris407", Protocol: "udp", PortForward: true, IP: net.IP{143, 244, 57, 239}},
|
||||
{Region: "France", ServerName: "paris407", Protocol: "udp", PortForward: true, IP: net.IP{143, 244, 57, 203}},
|
||||
{Region: "Georgia", ServerName: "georgia403", Protocol: "udp", PortForward: true, IP: net.IP{95, 181, 236, 6}},
|
||||
{Region: "Georgia", ServerName: "georgia403", Protocol: "udp", PortForward: true, IP: net.IP{95, 181, 236, 4}},
|
||||
{Region: "Greece", ServerName: "athens401", Protocol: "udp", PortForward: true, IP: net.IP{154, 57, 3, 87}},
|
||||
{Region: "Greece", ServerName: "athens401", Protocol: "udp", PortForward: true, IP: net.IP{154, 57, 3, 77}},
|
||||
{Region: "Greece", ServerName: "athens402", Protocol: "udp", PortForward: true, IP: net.IP{154, 57, 3, 93}},
|
||||
{Region: "Greece", ServerName: "athens402", Protocol: "udp", PortForward: true, IP: net.IP{154, 57, 3, 96}},
|
||||
{Region: "Greece", ServerName: "athens403", Protocol: "udp", PortForward: true, IP: net.IP{154, 57, 3, 117}},
|
||||
{Region: "Greece", ServerName: "athens403", Protocol: "udp", PortForward: true, IP: net.IP{154, 57, 3, 114}},
|
||||
{Region: "Greenland", ServerName: "greenland403", Protocol: "udp", PortForward: true, IP: net.IP{91, 90, 120, 134}},
|
||||
{Region: "Greenland", ServerName: "greenland403", Protocol: "udp", PortForward: true, IP: net.IP{91, 90, 120, 131}},
|
||||
{Region: "Greenland", ServerName: "greenland404", Protocol: "udp", PortForward: true, IP: net.IP{91, 90, 120, 148}},
|
||||
{Region: "Greenland", ServerName: "greenland404", Protocol: "udp", PortForward: true, IP: net.IP{91, 90, 120, 156}},
|
||||
{Region: "Hong Kong", ServerName: "china403", Protocol: "udp", PortForward: true, IP: net.IP{86, 107, 104, 213}},
|
||||
{Region: "Hong Kong", ServerName: "china403", Protocol: "udp", PortForward: true, IP: net.IP{86, 107, 104, 214}},
|
||||
{Region: "Hong Kong", ServerName: "hongkong402", Protocol: "udp", PortForward: true, IP: net.IP{86, 107, 104, 244}},
|
||||
{Region: "Hong Kong", ServerName: "hongkong402", Protocol: "udp", PortForward: true, IP: net.IP{86, 107, 104, 243}},
|
||||
{Region: "Hong Kong", ServerName: "hongkong403", Protocol: "udp", PortForward: true, IP: net.IP{91, 219, 213, 7}},
|
||||
{Region: "Hong Kong", ServerName: "hongkong403", Protocol: "udp", PortForward: true, IP: net.IP{91, 219, 213, 18}},
|
||||
{Region: "Hungary", ServerName: "budapest401", Protocol: "udp", PortForward: true, IP: net.IP{217, 138, 192, 218}},
|
||||
{Region: "Hungary", ServerName: "budapest401", Protocol: "udp", PortForward: true, IP: net.IP{217, 138, 192, 222}},
|
||||
{Region: "Hungary", ServerName: "budapest402", Protocol: "udp", PortForward: true, IP: net.IP{86, 106, 74, 116}},
|
||||
{Region: "Hungary", ServerName: "budapest402", Protocol: "udp", PortForward: true, IP: net.IP{86, 106, 74, 116}},
|
||||
{Region: "Iceland", ServerName: "reykjavik401", Protocol: "udp", PortForward: true, IP: net.IP{45, 133, 193, 39}},
|
||||
{Region: "Iceland", ServerName: "reykjavik401", Protocol: "udp", PortForward: true, IP: net.IP{45, 133, 193, 37}},
|
||||
{Region: "Iceland", ServerName: "reykjavik402", Protocol: "udp", PortForward: true, IP: net.IP{45, 133, 193, 84}},
|
||||
{Region: "Iceland", ServerName: "reykjavik402", Protocol: "udp", PortForward: true, IP: net.IP{45, 133, 193, 84}},
|
||||
{Region: "Iceland", ServerName: "reykjavik403", Protocol: "udp", PortForward: true, IP: net.IP{45, 133, 193, 76}},
|
||||
{Region: "Iceland", ServerName: "reykjavik403", Protocol: "udp", PortForward: true, IP: net.IP{45, 133, 193, 67}},
|
||||
{Region: "Iceland", ServerName: "reykjavik404", Protocol: "udp", PortForward: true, IP: net.IP{45, 133, 193, 56}},
|
||||
{Region: "Iceland", ServerName: "reykjavik404", Protocol: "udp", PortForward: true, IP: net.IP{45, 133, 193, 56}},
|
||||
{Region: "India", ServerName: "mumbai401", Protocol: "udp", PortForward: true, IP: net.IP{45, 120, 139, 37}},
|
||||
{Region: "India", ServerName: "mumbai401", Protocol: "udp", PortForward: true, IP: net.IP{45, 120, 139, 33}},
|
||||
{Region: "India", ServerName: "mumbai402", Protocol: "udp", PortForward: true, IP: net.IP{45, 120, 139, 128}},
|
||||
{Region: "India", ServerName: "mumbai402", Protocol: "udp", PortForward: true, IP: net.IP{45, 120, 139, 130}},
|
||||
{Region: "India", ServerName: "mumbai403", Protocol: "udp", PortForward: true, IP: net.IP{103, 150, 187, 4}},
|
||||
{Region: "India", ServerName: "mumbai403", Protocol: "udp", PortForward: true, IP: net.IP{103, 150, 187, 5}},
|
||||
{Region: "India", ServerName: "mumbai405", Protocol: "udp", PortForward: true, IP: net.IP{45, 120, 139, 88}},
|
||||
{Region: "India", ServerName: "mumbai405", Protocol: "udp", PortForward: true, IP: net.IP{45, 120, 139, 98}},
|
||||
{Region: "Ireland", ServerName: "dublin404", Protocol: "udp", PortForward: true, IP: net.IP{193, 56, 252, 20}},
|
||||
{Region: "Ireland", ServerName: "dublin404", Protocol: "udp", PortForward: true, IP: net.IP{193, 56, 252, 20}},
|
||||
{Region: "Ireland", ServerName: "dublin405", Protocol: "udp", PortForward: true, IP: net.IP{193, 56, 252, 10}},
|
||||
{Region: "Ireland", ServerName: "dublin405", Protocol: "udp", PortForward: true, IP: net.IP{193, 56, 252, 8}},
|
||||
{Region: "Ireland", ServerName: "dublin407", Protocol: "udp", PortForward: true, IP: net.IP{193, 56, 252, 236}},
|
||||
{Region: "Ireland", ServerName: "dublin407", Protocol: "udp", PortForward: true, IP: net.IP{193, 56, 252, 230}},
|
||||
{Region: "Ireland", ServerName: "dublin410", Protocol: "udp", PortForward: true, IP: net.IP{188, 241, 178, 5}},
|
||||
{Region: "Ireland", ServerName: "dublin410", Protocol: "udp", PortForward: true, IP: net.IP{188, 241, 178, 14}},
|
||||
{Region: "Ireland", ServerName: "dublin411", Protocol: "udp", PortForward: true, IP: net.IP{188, 241, 178, 26}},
|
||||
{Region: "Ireland", ServerName: "dublin411", Protocol: "udp", PortForward: true, IP: net.IP{188, 241, 178, 26}},
|
||||
{Region: "Isle of Man", ServerName: "douglas403", Protocol: "udp", PortForward: true, IP: net.IP{91, 90, 124, 13}},
|
||||
{Region: "Isle of Man", ServerName: "douglas403", Protocol: "udp", PortForward: true, IP: net.IP{91, 90, 124, 9}},
|
||||
{Region: "Israel", ServerName: "jerusalem402", Protocol: "udp", PortForward: true, IP: net.IP{185, 77, 248, 33}},
|
||||
{Region: "Israel", ServerName: "jerusalem402", Protocol: "udp", PortForward: true, IP: net.IP{185, 77, 248, 25}},
|
||||
{Region: "Israel", ServerName: "jerusalem404", Protocol: "udp", PortForward: true, IP: net.IP{185, 77, 248, 50}},
|
||||
{Region: "Israel", ServerName: "jerusalem404", Protocol: "udp", PortForward: true, IP: net.IP{185, 77, 248, 63}},
|
||||
{Region: "Israel", ServerName: "jerusalem405", Protocol: "udp", PortForward: true, IP: net.IP{185, 77, 248, 66}},
|
||||
{Region: "Israel", ServerName: "jerusalem405", Protocol: "udp", PortForward: true, IP: net.IP{185, 77, 248, 76}},
|
||||
{Region: "Israel", ServerName: "jerusalem406", Protocol: "udp", PortForward: true, IP: net.IP{185, 77, 248, 86}},
|
||||
{Region: "Israel", ServerName: "jerusalem406", Protocol: "udp", PortForward: true, IP: net.IP{185, 77, 248, 84}},
|
||||
{Region: "Israel", ServerName: "jerusalem407", Protocol: "udp", PortForward: true, IP: net.IP{185, 77, 248, 98}},
|
||||
{Region: "Israel", ServerName: "jerusalem407", Protocol: "udp", PortForward: true, IP: net.IP{185, 77, 248, 93}},
|
||||
{Region: "Italy", ServerName: "milano402", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 41, 14}},
|
||||
{Region: "Italy", ServerName: "milano402", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 41, 60}},
|
||||
{Region: "Italy", ServerName: "milano403", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 41, 96}},
|
||||
{Region: "Italy", ServerName: "milano403", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 41, 66}},
|
||||
{Region: "Japan", ServerName: "tokyo401", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 34, 155}},
|
||||
{Region: "Japan", ServerName: "tokyo401", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 34, 155}},
|
||||
{Region: "Japan", ServerName: "tokyo402", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 34, 117}},
|
||||
{Region: "Japan", ServerName: "tokyo402", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 34, 113}},
|
||||
{Region: "Japan", ServerName: "tokyo403", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 34, 15}},
|
||||
{Region: "Japan", ServerName: "tokyo403", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 34, 46}},
|
||||
{Region: "Kazakhstan", ServerName: "kazakhstan403", Protocol: "udp", PortForward: true, IP: net.IP{62, 133, 47, 5}},
|
||||
{Region: "Kazakhstan", ServerName: "kazakhstan403", Protocol: "udp", PortForward: true, IP: net.IP{62, 133, 47, 9}},
|
||||
{Region: "Latvia", ServerName: "riga401", Protocol: "udp", PortForward: true, IP: net.IP{109, 248, 149, 10}},
|
||||
{Region: "Latvia", ServerName: "riga401", Protocol: "udp", PortForward: true, IP: net.IP{109, 248, 149, 4}},
|
||||
{Region: "Latvia", ServerName: "riga402", Protocol: "udp", PortForward: true, IP: net.IP{46, 183, 218, 133}},
|
||||
{Region: "Latvia", ServerName: "riga402", Protocol: "udp", PortForward: true, IP: net.IP{46, 183, 218, 135}},
|
||||
{Region: "Latvia", ServerName: "riga403", Protocol: "udp", PortForward: true, IP: net.IP{46, 183, 218, 153}},
|
||||
{Region: "Latvia", ServerName: "riga403", Protocol: "udp", PortForward: true, IP: net.IP{46, 183, 218, 154}},
|
||||
{Region: "Liechtenstein", ServerName: "liechtenstein403", Protocol: "udp", PortForward: true, IP: net.IP{91, 90, 122, 8}},
|
||||
{Region: "Liechtenstein", ServerName: "liechtenstein403", Protocol: "udp", PortForward: true, IP: net.IP{91, 90, 122, 4}},
|
||||
{Region: "Lithuania", ServerName: "vilnius401", Protocol: "udp", PortForward: true, IP: net.IP{85, 206, 165, 173}},
|
||||
{Region: "Lithuania", ServerName: "vilnius401", Protocol: "udp", PortForward: true, IP: net.IP{85, 206, 165, 173}},
|
||||
{Region: "Lithuania", ServerName: "vilnius402", Protocol: "udp", PortForward: true, IP: net.IP{85, 206, 165, 103}},
|
||||
{Region: "Lithuania", ServerName: "vilnius402", Protocol: "udp", PortForward: true, IP: net.IP{85, 206, 165, 106}},
|
||||
{Region: "Lithuania", ServerName: "vilnius403", Protocol: "udp", PortForward: true, IP: net.IP{85, 206, 165, 123}},
|
||||
{Region: "Lithuania", ServerName: "vilnius403", Protocol: "udp", PortForward: true, IP: net.IP{85, 206, 165, 123}},
|
||||
{Region: "Luxembourg", ServerName: "luxembourg404", Protocol: "udp", PortForward: true, IP: net.IP{5, 253, 204, 110}},
|
||||
{Region: "Luxembourg", ServerName: "luxembourg404", Protocol: "udp", PortForward: true, IP: net.IP{5, 253, 204, 109}},
|
||||
{Region: "Luxembourg", ServerName: "luxembourg405", Protocol: "udp", PortForward: true, IP: net.IP{5, 253, 204, 118}},
|
||||
{Region: "Luxembourg", ServerName: "luxembourg405", Protocol: "udp", PortForward: true, IP: net.IP{5, 253, 204, 119}},
|
||||
{Region: "Luxembourg", ServerName: "luxembourg406", Protocol: "udp", PortForward: true, IP: net.IP{5, 253, 204, 133}},
|
||||
{Region: "Luxembourg", ServerName: "luxembourg406", Protocol: "udp", PortForward: true, IP: net.IP{5, 253, 204, 136}},
|
||||
{Region: "Luxembourg", ServerName: "luxembourg407", Protocol: "udp", PortForward: true, IP: net.IP{5, 253, 204, 156}},
|
||||
{Region: "Luxembourg", ServerName: "luxembourg407", Protocol: "udp", PortForward: true, IP: net.IP{5, 253, 204, 153}},
|
||||
{Region: "Macao", ServerName: "macau403", Protocol: "udp", PortForward: true, IP: net.IP{84, 252, 92, 4}},
|
||||
{Region: "Macao", ServerName: "macau403", Protocol: "udp", PortForward: true, IP: net.IP{84, 252, 92, 4}},
|
||||
{Region: "Macedonia", ServerName: "macedonia401", Protocol: "udp", PortForward: true, IP: net.IP{185, 225, 28, 120}},
|
||||
{Region: "Macedonia", ServerName: "macedonia401", Protocol: "udp", PortForward: true, IP: net.IP{185, 225, 28, 120}},
|
||||
{Region: "Macedonia", ServerName: "macedonia402", Protocol: "udp", PortForward: true, IP: net.IP{185, 225, 28, 140}},
|
||||
{Region: "Macedonia", ServerName: "macedonia402", Protocol: "udp", PortForward: true, IP: net.IP{185, 225, 28, 141}},
|
||||
{Region: "Malta", ServerName: "malta403", Protocol: "udp", PortForward: true, IP: net.IP{176, 125, 230, 5}},
|
||||
{Region: "Malta", ServerName: "malta403", Protocol: "udp", PortForward: true, IP: net.IP{176, 125, 230, 7}},
|
||||
{Region: "Mexico", ServerName: "mexico403", Protocol: "udp", PortForward: true, IP: net.IP{77, 81, 142, 15}},
|
||||
{Region: "Mexico", ServerName: "mexico403", Protocol: "udp", PortForward: true, IP: net.IP{77, 81, 142, 10}},
|
||||
{Region: "Mexico", ServerName: "mexico404", Protocol: "udp", PortForward: true, IP: net.IP{77, 81, 142, 24}},
|
||||
{Region: "Mexico", ServerName: "mexico404", Protocol: "udp", PortForward: true, IP: net.IP{77, 81, 142, 26}},
|
||||
{Region: "Mexico", ServerName: "mexico407", Protocol: "udp", PortForward: true, IP: net.IP{77, 81, 142, 71}},
|
||||
{Region: "Mexico", ServerName: "mexico407", Protocol: "udp", PortForward: true, IP: net.IP{77, 81, 142, 64}},
|
||||
{Region: "Mexico", ServerName: "mexico409", Protocol: "udp", PortForward: true, IP: net.IP{77, 81, 142, 97}},
|
||||
{Region: "Mexico", ServerName: "mexico409", Protocol: "udp", PortForward: true, IP: net.IP{77, 81, 142, 96}},
|
||||
{Region: "Mexico", ServerName: "mexico412", Protocol: "udp", PortForward: true, IP: net.IP{77, 81, 142, 205}},
|
||||
{Region: "Mexico", ServerName: "mexico412", Protocol: "udp", PortForward: true, IP: net.IP{77, 81, 142, 199}},
|
||||
{Region: "Moldova", ServerName: "chisinau401", Protocol: "udp", PortForward: true, IP: net.IP{178, 175, 129, 39}},
|
||||
{Region: "Moldova", ServerName: "chisinau401", Protocol: "udp", PortForward: true, IP: net.IP{178, 175, 129, 44}},
|
||||
{Region: "Monaco", ServerName: "monaco403", Protocol: "udp", PortForward: true, IP: net.IP{95, 181, 233, 4}},
|
||||
{Region: "Monaco", ServerName: "monaco403", Protocol: "udp", PortForward: true, IP: net.IP{95, 181, 233, 3}},
|
||||
{Region: "Mongolia", ServerName: "mongolia403", Protocol: "udp", PortForward: true, IP: net.IP{185, 253, 163, 14}},
|
||||
{Region: "Mongolia", ServerName: "mongolia403", Protocol: "udp", PortForward: true, IP: net.IP{185, 253, 163, 3}},
|
||||
{Region: "Montenegro", ServerName: "montenegro403", Protocol: "udp", PortForward: true, IP: net.IP{176, 125, 229, 15}},
|
||||
{Region: "Montenegro", ServerName: "montenegro403", Protocol: "udp", PortForward: true, IP: net.IP{176, 125, 229, 9}},
|
||||
{Region: "Morocco", ServerName: "morocco403", Protocol: "udp", PortForward: true, IP: net.IP{95, 181, 232, 4}},
|
||||
{Region: "Morocco", ServerName: "morocco403", Protocol: "udp", PortForward: true, IP: net.IP{95, 181, 232, 12}},
|
||||
{Region: "Netherlands", ServerName: "amsterdam401", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 35, 25}},
|
||||
{Region: "Netherlands", ServerName: "amsterdam401", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 35, 27}},
|
||||
{Region: "Netherlands", ServerName: "amsterdam402", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 34, 147}},
|
||||
{Region: "Netherlands", ServerName: "amsterdam402", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 34, 156}},
|
||||
{Region: "Netherlands", ServerName: "amsterdam403", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 34, 170}},
|
||||
{Region: "Netherlands", ServerName: "amsterdam403", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 34, 220}},
|
||||
{Region: "Netherlands", ServerName: "amsterdam408", Protocol: "udp", PortForward: true, IP: net.IP{143, 244, 43, 187}},
|
||||
{Region: "Netherlands", ServerName: "amsterdam408", Protocol: "udp", PortForward: true, IP: net.IP{143, 244, 43, 187}},
|
||||
{Region: "Netherlands", ServerName: "amsterdam420", Protocol: "udp", PortForward: true, IP: net.IP{143, 244, 41, 17}},
|
||||
{Region: "Netherlands", ServerName: "amsterdam420", Protocol: "udp", PortForward: true, IP: net.IP{143, 244, 41, 25}},
|
||||
{Region: "New Zealand", ServerName: "newzealand403", Protocol: "udp", PortForward: true, IP: net.IP{43, 250, 207, 88}},
|
||||
{Region: "New Zealand", ServerName: "newzealand403", Protocol: "udp", PortForward: true, IP: net.IP{43, 250, 207, 84}},
|
||||
{Region: "New Zealand", ServerName: "newzealand404", Protocol: "udp", PortForward: true, IP: net.IP{202, 60, 86, 27}},
|
||||
{Region: "New Zealand", ServerName: "newzealand404", Protocol: "udp", PortForward: true, IP: net.IP{202, 60, 86, 15}},
|
||||
{Region: "New Zealand", ServerName: "newzealand405", Protocol: "udp", PortForward: true, IP: net.IP{202, 60, 86, 99}},
|
||||
{Region: "New Zealand", ServerName: "newzealand405", Protocol: "udp", PortForward: true, IP: net.IP{202, 60, 86, 118}},
|
||||
{Region: "Nigeria", ServerName: "nigeria403", Protocol: "udp", PortForward: true, IP: net.IP{102, 165, 25, 84}},
|
||||
{Region: "Nigeria", ServerName: "nigeria403", Protocol: "udp", PortForward: true, IP: net.IP{102, 165, 25, 90}},
|
||||
{Region: "Nigeria", ServerName: "nigeria404", Protocol: "udp", PortForward: true, IP: net.IP{102, 165, 25, 126}},
|
||||
{Region: "Nigeria", ServerName: "nigeria404", Protocol: "udp", PortForward: true, IP: net.IP{102, 165, 25, 117}},
|
||||
{Region: "Norway", ServerName: "oslo401", Protocol: "udp", PortForward: true, IP: net.IP{46, 246, 122, 35}},
|
||||
{Region: "Norway", ServerName: "oslo401", Protocol: "udp", PortForward: true, IP: net.IP{46, 246, 122, 39}},
|
||||
{Region: "Norway", ServerName: "oslo402", Protocol: "udp", PortForward: true, IP: net.IP{46, 246, 122, 85}},
|
||||
{Region: "Norway", ServerName: "oslo402", Protocol: "udp", PortForward: true, IP: net.IP{46, 246, 122, 69}},
|
||||
{Region: "Norway", ServerName: "oslo403", Protocol: "udp", PortForward: true, IP: net.IP{46, 246, 122, 107}},
|
||||
{Region: "Norway", ServerName: "oslo403", Protocol: "udp", PortForward: true, IP: net.IP{46, 246, 122, 125}},
|
||||
{Region: "Norway", ServerName: "oslo404", Protocol: "udp", PortForward: true, IP: net.IP{46, 246, 122, 167}},
|
||||
{Region: "Norway", ServerName: "oslo404", Protocol: "udp", PortForward: true, IP: net.IP{46, 246, 122, 176}},
|
||||
{Region: "Panama", ServerName: "panama403", Protocol: "udp", PortForward: true, IP: net.IP{91, 90, 126, 14}},
|
||||
{Region: "Panama", ServerName: "panama403", Protocol: "udp", PortForward: true, IP: net.IP{91, 90, 126, 4}},
|
||||
{Region: "Panama", ServerName: "panama404", Protocol: "udp", PortForward: true, IP: net.IP{91, 90, 126, 29}},
|
||||
{Region: "Panama", ServerName: "panama404", Protocol: "udp", PortForward: true, IP: net.IP{91, 90, 126, 23}},
|
||||
{Region: "Philippines", ServerName: "philippines401", Protocol: "udp", PortForward: true, IP: net.IP{188, 214, 125, 135}},
|
||||
{Region: "Philippines", ServerName: "philippines401", Protocol: "udp", PortForward: true, IP: net.IP{188, 214, 125, 134}},
|
||||
{Region: "Philippines", ServerName: "philippines402", Protocol: "udp", PortForward: true, IP: net.IP{188, 214, 125, 147}},
|
||||
{Region: "Philippines", ServerName: "philippines402", Protocol: "udp", PortForward: true, IP: net.IP{188, 214, 125, 149}},
|
||||
{Region: "Poland", ServerName: "warsaw401", Protocol: "udp", PortForward: true, IP: net.IP{217, 138, 209, 244}},
|
||||
{Region: "Poland", ServerName: "warsaw401", Protocol: "udp", PortForward: true, IP: net.IP{217, 138, 209, 242}},
|
||||
{Region: "Poland", ServerName: "warsaw402", Protocol: "udp", PortForward: true, IP: net.IP{194, 110, 114, 13}},
|
||||
{Region: "Poland", ServerName: "warsaw402", Protocol: "udp", PortForward: true, IP: net.IP{194, 110, 114, 4}},
|
||||
{Region: "Poland", ServerName: "warsaw405", Protocol: "udp", PortForward: true, IP: net.IP{194, 110, 114, 55}},
|
||||
{Region: "Poland", ServerName: "warsaw405", Protocol: "udp", PortForward: true, IP: net.IP{194, 110, 114, 53}},
|
||||
{Region: "Poland", ServerName: "warsaw406", Protocol: "udp", PortForward: true, IP: net.IP{194, 110, 114, 68}},
|
||||
{Region: "Poland", ServerName: "warsaw406", Protocol: "udp", PortForward: true, IP: net.IP{194, 110, 114, 69}},
|
||||
{Region: "Poland", ServerName: "warsaw409", Protocol: "udp", PortForward: true, IP: net.IP{194, 110, 114, 119}},
|
||||
{Region: "Poland", ServerName: "warsaw409", Protocol: "udp", PortForward: true, IP: net.IP{194, 110, 114, 115}},
|
||||
{Region: "Portugal", ServerName: "lisbon401", Protocol: "udp", PortForward: true, IP: net.IP{89, 26, 241, 75}},
|
||||
{Region: "Portugal", ServerName: "lisbon401", Protocol: "udp", PortForward: true, IP: net.IP{89, 26, 241, 82}},
|
||||
{Region: "Portugal", ServerName: "lisbon402", Protocol: "udp", PortForward: true, IP: net.IP{89, 26, 241, 99}},
|
||||
{Region: "Portugal", ServerName: "lisbon402", Protocol: "udp", PortForward: true, IP: net.IP{89, 26, 241, 96}},
|
||||
{Region: "Portugal", ServerName: "lisbon403", Protocol: "udp", PortForward: true, IP: net.IP{89, 26, 241, 133}},
|
||||
{Region: "Portugal", ServerName: "lisbon403", Protocol: "udp", PortForward: true, IP: net.IP{89, 26, 241, 145}},
|
||||
{Region: "Portugal", ServerName: "lisbon404", Protocol: "udp", PortForward: true, IP: net.IP{89, 26, 241, 115}},
|
||||
{Region: "Portugal", ServerName: "lisbon404", Protocol: "udp", PortForward: true, IP: net.IP{89, 26, 241, 103}},
|
||||
{Region: "Qatar", ServerName: "qatar403", Protocol: "udp", PortForward: true, IP: net.IP{95, 181, 234, 8}},
|
||||
{Region: "Qatar", ServerName: "qatar403", Protocol: "udp", PortForward: true, IP: net.IP{95, 181, 234, 6}},
|
||||
{Region: "Romania", ServerName: "romania406", Protocol: "udp", PortForward: true, IP: net.IP{143, 244, 52, 19}},
|
||||
{Region: "Romania", ServerName: "romania406", Protocol: "udp", PortForward: true, IP: net.IP{143, 244, 52, 33}},
|
||||
{Region: "Romania", ServerName: "romania407", Protocol: "udp", PortForward: true, IP: net.IP{143, 244, 54, 153}},
|
||||
{Region: "Romania", ServerName: "romania407", Protocol: "udp", PortForward: true, IP: net.IP{143, 244, 54, 154}},
|
||||
{Region: "Romania", ServerName: "romania408", Protocol: "udp", PortForward: true, IP: net.IP{143, 244, 54, 70}},
|
||||
{Region: "Romania", ServerName: "romania408", Protocol: "udp", PortForward: true, IP: net.IP{143, 244, 54, 116}},
|
||||
{Region: "Romania", ServerName: "romania409", Protocol: "udp", PortForward: true, IP: net.IP{143, 244, 54, 43}},
|
||||
{Region: "Romania", ServerName: "romania409", Protocol: "udp", PortForward: true, IP: net.IP{143, 244, 54, 43}},
|
||||
{Region: "Saudi Arabia", ServerName: "saudiarabia403", Protocol: "udp", PortForward: true, IP: net.IP{95, 181, 235, 16}},
|
||||
{Region: "Saudi Arabia", ServerName: "saudiarabia403", Protocol: "udp", PortForward: true, IP: net.IP{95, 181, 235, 16}},
|
||||
{Region: "Serbia", ServerName: "belgrade401", Protocol: "udp", PortForward: true, IP: net.IP{37, 120, 193, 254}},
|
||||
{Region: "Serbia", ServerName: "belgrade401", Protocol: "udp", PortForward: true, IP: net.IP{37, 120, 193, 243}},
|
||||
{Region: "Serbia", ServerName: "belgrade402", Protocol: "udp", PortForward: true, IP: net.IP{37, 120, 193, 237}},
|
||||
{Region: "Serbia", ServerName: "belgrade402", Protocol: "udp", PortForward: true, IP: net.IP{37, 120, 193, 229}},
|
||||
{Region: "Singapore", ServerName: "singapore401", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 57, 175}},
|
||||
{Region: "Singapore", ServerName: "singapore401", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 57, 178}},
|
||||
{Region: "Singapore", ServerName: "singapore402", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 57, 108}},
|
||||
{Region: "Singapore", ServerName: "singapore402", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 57, 160}},
|
||||
{Region: "Singapore", ServerName: "singapore403", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 57, 89}},
|
||||
{Region: "Singapore", ServerName: "singapore403", Protocol: "udp", PortForward: true, IP: net.IP{156, 146, 57, 89}},
|
||||
{Region: "Slovakia", ServerName: "bratislava401", Protocol: "udp", PortForward: true, IP: net.IP{37, 120, 221, 84}},
|
||||
{Region: "Slovakia", ServerName: "bratislava401", Protocol: "udp", PortForward: true, IP: net.IP{37, 120, 221, 86}},
|
||||
{Region: "Slovakia", ServerName: "bratislava402", Protocol: "udp", PortForward: true, IP: net.IP{37, 120, 221, 214}},
|
||||
{Region: "Slovakia", ServerName: "bratislava402", Protocol: "udp", PortForward: true, IP: net.IP{37, 120, 221, 217}},
|
||||
{Region: "South Africa", ServerName: "johannesburg401", Protocol: "udp", PortForward: true, IP: net.IP{154, 16, 93, 34}},
|
||||
{Region: "South Africa", ServerName: "johannesburg401", Protocol: "udp", PortForward: true, IP: net.IP{154, 16, 93, 35}},
|
||||
{Region: "South Africa", ServerName: "johannesburg403", Protocol: "udp", PortForward: true, IP: net.IP{154, 16, 93, 234}},
|
||||
{Region: "South Africa", ServerName: "johannesburg403", Protocol: "udp", PortForward: true, IP: net.IP{154, 16, 93, 233}},
|
||||
{Region: "Spain", ServerName: "madrid401", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 49, 106}},
|
||||
{Region: "Spain", ServerName: "madrid401", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 49, 116}},
|
||||
{Region: "Spain", ServerName: "madrid402", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 49, 34}},
|
||||
{Region: "Spain", ServerName: "madrid402", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 49, 25}},
|
||||
{Region: "Sri Lanka", ServerName: "srilanka403", Protocol: "udp", PortForward: true, IP: net.IP{95, 181, 239, 9}},
|
||||
{Region: "Sri Lanka", ServerName: "srilanka403", Protocol: "udp", PortForward: true, IP: net.IP{95, 181, 239, 10}},
|
||||
{Region: "Sweden", ServerName: "stockholm401", Protocol: "udp", PortForward: true, IP: net.IP{195, 246, 120, 33}},
|
||||
{Region: "Sweden", ServerName: "stockholm401", Protocol: "udp", PortForward: true, IP: net.IP{195, 246, 120, 14}},
|
||||
{Region: "Sweden", ServerName: "stockholm402", Protocol: "udp", PortForward: true, IP: net.IP{195, 246, 120, 59}},
|
||||
{Region: "Sweden", ServerName: "stockholm402", Protocol: "udp", PortForward: true, IP: net.IP{195, 246, 120, 60}},
|
||||
{Region: "Sweden", ServerName: "stockholm403", Protocol: "udp", PortForward: true, IP: net.IP{195, 246, 120, 103}},
|
||||
{Region: "Sweden", ServerName: "stockholm403", Protocol: "udp", PortForward: true, IP: net.IP{195, 246, 120, 84}},
|
||||
{Region: "Sweden", ServerName: "stockholm404", Protocol: "udp", PortForward: true, IP: net.IP{195, 246, 120, 129}},
|
||||
{Region: "Sweden", ServerName: "stockholm404", Protocol: "udp", PortForward: true, IP: net.IP{195, 246, 120, 118}},
|
||||
{Region: "Sweden", ServerName: "stockholm405", Protocol: "udp", PortForward: true, IP: net.IP{46, 246, 3, 204}},
|
||||
{Region: "Sweden", ServerName: "stockholm405", Protocol: "udp", PortForward: true, IP: net.IP{46, 246, 3, 190}},
|
||||
{Region: "Switzerland", ServerName: "zurich403", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 37, 116}},
|
||||
{Region: "Switzerland", ServerName: "zurich403", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 37, 156}},
|
||||
{Region: "Switzerland", ServerName: "zurich404", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 37, 105}},
|
||||
{Region: "Switzerland", ServerName: "zurich404", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 37, 100}},
|
||||
{Region: "Switzerland", ServerName: "zurich405", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 36, 16}},
|
||||
{Region: "Switzerland", ServerName: "zurich405", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 36, 16}},
|
||||
{Region: "Switzerland", ServerName: "zurich407", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 36, 163}},
|
||||
{Region: "Switzerland", ServerName: "zurich407", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 36, 163}},
|
||||
{Region: "Switzerland", ServerName: "zurich408", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 36, 184}},
|
||||
{Region: "Switzerland", ServerName: "zurich408", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 36, 175}},
|
||||
{Region: "Taiwan", ServerName: "taiwan401", Protocol: "udp", PortForward: true, IP: net.IP{188, 214, 106, 69}},
|
||||
{Region: "Taiwan", ServerName: "taiwan401", Protocol: "udp", PortForward: true, IP: net.IP{188, 214, 106, 68}},
|
||||
{Region: "Taiwan", ServerName: "taiwan402", Protocol: "udp", PortForward: true, IP: net.IP{188, 214, 106, 89}},
|
||||
{Region: "Taiwan", ServerName: "taiwan402", Protocol: "udp", PortForward: true, IP: net.IP{188, 214, 106, 89}},
|
||||
{Region: "Taiwan", ServerName: "taiwan403", Protocol: "udp", PortForward: true, IP: net.IP{188, 214, 106, 144}},
|
||||
{Region: "Taiwan", ServerName: "taiwan403", Protocol: "udp", PortForward: true, IP: net.IP{188, 214, 106, 140}},
|
||||
{Region: "Turkey", ServerName: "istanbul401", Protocol: "udp", PortForward: true, IP: net.IP{188, 213, 34, 70}},
|
||||
{Region: "Turkey", ServerName: "istanbul401", Protocol: "udp", PortForward: true, IP: net.IP{188, 213, 34, 73}},
|
||||
{Region: "Turkey", ServerName: "istanbul402", Protocol: "udp", PortForward: true, IP: net.IP{188, 213, 34, 85}},
|
||||
{Region: "Turkey", ServerName: "istanbul402", Protocol: "udp", PortForward: true, IP: net.IP{188, 213, 34, 86}},
|
||||
{Region: "UK London", ServerName: "london402", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 63, 170}},
|
||||
{Region: "UK London", ServerName: "london402", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 63, 140}},
|
||||
{Region: "UK London", ServerName: "london404", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 52, 86}},
|
||||
{Region: "UK London", ServerName: "london404", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 52, 94}},
|
||||
{Region: "UK London", ServerName: "london405", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 53, 53}},
|
||||
{Region: "UK London", ServerName: "london405", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 53, 26}},
|
||||
{Region: "UK London", ServerName: "london412", Protocol: "udp", PortForward: true, IP: net.IP{37, 235, 96, 77}},
|
||||
{Region: "UK London", ServerName: "london412", Protocol: "udp", PortForward: true, IP: net.IP{37, 235, 96, 90}},
|
||||
{Region: "UK London", ServerName: "london414", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 53, 230}},
|
||||
{Region: "UK London", ServerName: "london414", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 53, 194}},
|
||||
{Region: "UK London - Streaming Optimized", ServerName: "london419", Protocol: "udp", PortForward: true, IP: net.IP{37, 235, 97, 19}},
|
||||
{Region: "UK London - Streaming Optimized", ServerName: "london419", Protocol: "udp", PortForward: true, IP: net.IP{37, 235, 97, 16}},
|
||||
{Region: "UK London - Streaming Optimized", ServerName: "london420", Protocol: "udp", PortForward: true, IP: net.IP{37, 235, 96, 203}},
|
||||
{Region: "UK London - Streaming Optimized", ServerName: "london420", Protocol: "udp", PortForward: true, IP: net.IP{37, 235, 96, 199}},
|
||||
{Region: "UK London - Streaming Optimized", ServerName: "london429", Protocol: "udp", PortForward: true, IP: net.IP{138, 199, 29, 139}},
|
||||
{Region: "UK London - Streaming Optimized", ServerName: "london429", Protocol: "udp", PortForward: true, IP: net.IP{138, 199, 29, 133}},
|
||||
{Region: "UK London - Streaming Optimized", ServerName: "london430", Protocol: "udp", PortForward: true, IP: net.IP{138, 199, 29, 146}},
|
||||
{Region: "UK London - Streaming Optimized", ServerName: "london430", Protocol: "udp", PortForward: true, IP: net.IP{138, 199, 29, 146}},
|
||||
{Region: "UK London - Streaming Optimized", ServerName: "london431", Protocol: "udp", PortForward: true, IP: net.IP{138, 199, 29, 160}},
|
||||
{Region: "UK London - Streaming Optimized", ServerName: "london431", Protocol: "udp", PortForward: true, IP: net.IP{138, 199, 29, 164}},
|
||||
{Region: "UK Manchester", ServerName: "manchester403", Protocol: "udp", PortForward: true, IP: net.IP{193, 239, 84, 66}},
|
||||
{Region: "UK Manchester", ServerName: "manchester403", Protocol: "udp", PortForward: true, IP: net.IP{193, 239, 84, 76}},
|
||||
{Region: "UK Manchester", ServerName: "manchester406", Protocol: "udp", PortForward: true, IP: net.IP{89, 44, 201, 245}},
|
||||
{Region: "UK Manchester", ServerName: "manchester406", Protocol: "udp", PortForward: true, IP: net.IP{89, 44, 201, 245}},
|
||||
{Region: "UK Manchester", ServerName: "manchester408", Protocol: "udp", PortForward: true, IP: net.IP{89, 44, 201, 217}},
|
||||
{Region: "UK Manchester", ServerName: "manchester408", Protocol: "udp", PortForward: true, IP: net.IP{89, 44, 201, 210}},
|
||||
{Region: "UK Manchester", ServerName: "manchester409", Protocol: "udp", PortForward: true, IP: net.IP{194, 37, 96, 18}},
|
||||
{Region: "UK Manchester", ServerName: "manchester409", Protocol: "udp", PortForward: true, IP: net.IP{194, 37, 96, 29}},
|
||||
{Region: "UK Manchester", ServerName: "manchester414", Protocol: "udp", PortForward: true, IP: net.IP{194, 37, 96, 198}},
|
||||
{Region: "UK Manchester", ServerName: "manchester414", Protocol: "udp", PortForward: true, IP: net.IP{194, 37, 96, 206}},
|
||||
{Region: "UK Southampton", ServerName: "southampton401", Protocol: "udp", PortForward: true, IP: net.IP{143, 244, 37, 208}},
|
||||
{Region: "UK Southampton", ServerName: "southampton401", Protocol: "udp", PortForward: true, IP: net.IP{143, 244, 37, 228}},
|
||||
{Region: "UK Southampton", ServerName: "southampton402", Protocol: "udp", PortForward: true, IP: net.IP{143, 244, 37, 144}},
|
||||
{Region: "UK Southampton", ServerName: "southampton402", Protocol: "udp", PortForward: true, IP: net.IP{143, 244, 37, 175}},
|
||||
{Region: "UK Southampton", ServerName: "southampton405", Protocol: "udp", PortForward: true, IP: net.IP{143, 244, 36, 104}},
|
||||
{Region: "UK Southampton", ServerName: "southampton405", Protocol: "udp", PortForward: true, IP: net.IP{143, 244, 36, 113}},
|
||||
{Region: "UK Southampton", ServerName: "southampton406", Protocol: "udp", PortForward: true, IP: net.IP{143, 244, 38, 109}},
|
||||
{Region: "UK Southampton", ServerName: "southampton406", Protocol: "udp", PortForward: true, IP: net.IP{143, 244, 38, 109}},
|
||||
{Region: "UK Southampton", ServerName: "southampton410", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 53, 85}},
|
||||
{Region: "UK Southampton", ServerName: "southampton410", Protocol: "udp", PortForward: true, IP: net.IP{212, 102, 53, 84}},
|
||||
{Region: "US Atlanta", ServerName: "atlanta412", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 22, 59}},
|
||||
{Region: "US Atlanta", ServerName: "atlanta412", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 22, 39}},
|
||||
{Region: "US Atlanta", ServerName: "atlanta418", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 22, 229}},
|
||||
{Region: "US Atlanta", ServerName: "atlanta418", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 22, 233}},
|
||||
{Region: "US Atlanta", ServerName: "atlanta419", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 21, 25}},
|
||||
{Region: "US Atlanta", ServerName: "atlanta419", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 21, 33}},
|
||||
{Region: "US Atlanta", ServerName: "atlanta421", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 21, 74}},
|
||||
{Region: "US Atlanta", ServerName: "atlanta421", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 21, 88}},
|
||||
{Region: "US Atlanta", ServerName: "atlanta422", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 21, 103}},
|
||||
{Region: "US Atlanta", ServerName: "atlanta422", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 21, 129}},
|
||||
{Region: "US California", ServerName: "losangeles401", Protocol: "udp", PortForward: false, IP: net.IP{143, 244, 48, 24}},
|
||||
{Region: "US California", ServerName: "losangeles401", Protocol: "udp", PortForward: false, IP: net.IP{143, 244, 48, 36}},
|
||||
{Region: "US California", ServerName: "losangeles402", Protocol: "udp", PortForward: false, IP: net.IP{143, 244, 49, 33}},
|
||||
{Region: "US California", ServerName: "losangeles402", Protocol: "udp", PortForward: false, IP: net.IP{143, 244, 49, 43}},
|
||||
{Region: "US California", ServerName: "losangeles404", Protocol: "udp", PortForward: false, IP: net.IP{84, 17, 45, 40}},
|
||||
{Region: "US California", ServerName: "losangeles404", Protocol: "udp", PortForward: false, IP: net.IP{84, 17, 45, 3}},
|
||||
{Region: "US California", ServerName: "losangeles409", Protocol: "udp", PortForward: false, IP: net.IP{143, 244, 49, 166}},
|
||||
{Region: "US California", ServerName: "losangeles409", Protocol: "udp", PortForward: false, IP: net.IP{143, 244, 49, 166}},
|
||||
{Region: "US California", ServerName: "losangeles418", Protocol: "udp", PortForward: false, IP: net.IP{138, 199, 8, 93}},
|
||||
{Region: "US California", ServerName: "losangeles418", Protocol: "udp", PortForward: false, IP: net.IP{138, 199, 8, 94}},
|
||||
{Region: "US Chicago", ServerName: "chicago407", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 28, 73}},
|
||||
{Region: "US Chicago", ServerName: "chicago407", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 28, 88}},
|
||||
{Region: "US Chicago", ServerName: "chicago410", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 28, 220}},
|
||||
{Region: "US Chicago", ServerName: "chicago410", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 28, 249}},
|
||||
{Region: "US Chicago", ServerName: "chicago411", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 23, 9}},
|
||||
{Region: "US Chicago", ServerName: "chicago411", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 23, 6}},
|
||||
{Region: "US Chicago", ServerName: "chicago412", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 23, 64}},
|
||||
{Region: "US Chicago", ServerName: "chicago412", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 23, 60}},
|
||||
{Region: "US Chicago", ServerName: "chicago418", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 114, 126}},
|
||||
{Region: "US Chicago", ServerName: "chicago418", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 114, 108}},
|
||||
{Region: "US Denver", ServerName: "denver401", Protocol: "udp", PortForward: false, IP: net.IP{70, 39, 81, 148}},
|
||||
{Region: "US Denver", ServerName: "denver401", Protocol: "udp", PortForward: false, IP: net.IP{70, 39, 81, 154}},
|
||||
{Region: "US Denver", ServerName: "denver402", Protocol: "udp", PortForward: false, IP: net.IP{70, 39, 126, 175}},
|
||||
{Region: "US Denver", ServerName: "denver402", Protocol: "udp", PortForward: false, IP: net.IP{70, 39, 126, 174}},
|
||||
{Region: "US Denver", ServerName: "denver405", Protocol: "udp", PortForward: false, IP: net.IP{70, 39, 110, 125}},
|
||||
{Region: "US Denver", ServerName: "denver405", Protocol: "udp", PortForward: false, IP: net.IP{70, 39, 110, 125}},
|
||||
{Region: "US Denver", ServerName: "denver406", Protocol: "udp", PortForward: false, IP: net.IP{70, 39, 77, 166}},
|
||||
{Region: "US Denver", ServerName: "denver406", Protocol: "udp", PortForward: false, IP: net.IP{70, 39, 77, 183}},
|
||||
{Region: "US Denver", ServerName: "denver408", Protocol: "udp", PortForward: false, IP: net.IP{70, 39, 92, 24}},
|
||||
{Region: "US Denver", ServerName: "denver408", Protocol: "udp", PortForward: false, IP: net.IP{70, 39, 92, 28}},
|
||||
{Region: "US East", ServerName: "newjersey401", Protocol: "udp", PortForward: false, IP: net.IP{143, 244, 44, 73}},
|
||||
{Region: "US East", ServerName: "newjersey401", Protocol: "udp", PortForward: false, IP: net.IP{143, 244, 44, 76}},
|
||||
{Region: "US East", ServerName: "newjersey402", Protocol: "udp", PortForward: false, IP: net.IP{143, 244, 45, 85}},
|
||||
{Region: "US East", ServerName: "newjersey402", Protocol: "udp", PortForward: false, IP: net.IP{143, 244, 45, 105}},
|
||||
{Region: "US East", ServerName: "newjersey403", Protocol: "udp", PortForward: false, IP: net.IP{143, 244, 44, 28}},
|
||||
{Region: "US East", ServerName: "newjersey403", Protocol: "udp", PortForward: false, IP: net.IP{143, 244, 44, 43}},
|
||||
{Region: "US East", ServerName: "newjersey407", Protocol: "udp", PortForward: false, IP: net.IP{143, 244, 47, 156}},
|
||||
{Region: "US East", ServerName: "newjersey407", Protocol: "udp", PortForward: false, IP: net.IP{143, 244, 47, 156}},
|
||||
{Region: "US East", ServerName: "newjersey413", Protocol: "udp", PortForward: false, IP: net.IP{143, 244, 45, 190}},
|
||||
{Region: "US East", ServerName: "newjersey413", Protocol: "udp", PortForward: false, IP: net.IP{143, 244, 45, 196}},
|
||||
{Region: "US Florida", ServerName: "miami404", Protocol: "udp", PortForward: false, IP: net.IP{143, 244, 34, 184}},
|
||||
{Region: "US Florida", ServerName: "miami404", Protocol: "udp", PortForward: false, IP: net.IP{143, 244, 34, 184}},
|
||||
{Region: "US Florida", ServerName: "miami405", Protocol: "udp", PortForward: false, IP: net.IP{143, 244, 34, 208}},
|
||||
{Region: "US Florida", ServerName: "miami405", Protocol: "udp", PortForward: false, IP: net.IP{143, 244, 34, 210}},
|
||||
{Region: "US Florida", ServerName: "miami406", Protocol: "udp", PortForward: false, IP: net.IP{156, 146, 42, 13}},
|
||||
{Region: "US Florida", ServerName: "miami406", Protocol: "udp", PortForward: false, IP: net.IP{156, 146, 42, 30}},
|
||||
{Region: "US Florida", ServerName: "miami408", Protocol: "udp", PortForward: false, IP: net.IP{156, 146, 42, 170}},
|
||||
{Region: "US Florida", ServerName: "miami408", Protocol: "udp", PortForward: false, IP: net.IP{156, 146, 42, 176}},
|
||||
{Region: "US Florida", ServerName: "miami413", Protocol: "udp", PortForward: false, IP: net.IP{212, 102, 61, 37}},
|
||||
{Region: "US Florida", ServerName: "miami413", Protocol: "udp", PortForward: false, IP: net.IP{212, 102, 61, 57}},
|
||||
{Region: "US Houston", ServerName: "houston408", Protocol: "udp", PortForward: false, IP: net.IP{205, 251, 139, 99}},
|
||||
{Region: "US Houston", ServerName: "houston408", Protocol: "udp", PortForward: false, IP: net.IP{205, 251, 139, 110}},
|
||||
{Region: "US Houston", ServerName: "houston409", Protocol: "udp", PortForward: false, IP: net.IP{205, 251, 139, 165}},
|
||||
{Region: "US Houston", ServerName: "houston409", Protocol: "udp", PortForward: false, IP: net.IP{205, 251, 139, 166}},
|
||||
{Region: "US Houston", ServerName: "houston415", Protocol: "udp", PortForward: false, IP: net.IP{205, 251, 142, 60}},
|
||||
{Region: "US Houston", ServerName: "houston415", Protocol: "udp", PortForward: false, IP: net.IP{205, 251, 142, 57}},
|
||||
{Region: "US Houston", ServerName: "houston416", Protocol: "udp", PortForward: false, IP: net.IP{205, 251, 142, 105}},
|
||||
{Region: "US Houston", ServerName: "houston416", Protocol: "udp", PortForward: false, IP: net.IP{205, 251, 142, 107}},
|
||||
{Region: "US Houston", ServerName: "houston418", Protocol: "udp", PortForward: false, IP: net.IP{205, 251, 154, 208}},
|
||||
{Region: "US Houston", ServerName: "houston418", Protocol: "udp", PortForward: false, IP: net.IP{205, 251, 154, 205}},
|
||||
{Region: "US Las Vegas", ServerName: "lasvegas401", Protocol: "udp", PortForward: false, IP: net.IP{173, 239, 226, 38}},
|
||||
{Region: "US Las Vegas", ServerName: "lasvegas401", Protocol: "udp", PortForward: false, IP: net.IP{173, 239, 226, 38}},
|
||||
{Region: "US Las Vegas", ServerName: "lasvegas402", Protocol: "udp", PortForward: false, IP: net.IP{45, 89, 173, 180}},
|
||||
{Region: "US Las Vegas", ServerName: "lasvegas402", Protocol: "udp", PortForward: false, IP: net.IP{45, 89, 173, 179}},
|
||||
{Region: "US Las Vegas", ServerName: "lasvegas405", Protocol: "udp", PortForward: false, IP: net.IP{82, 102, 31, 105}},
|
||||
{Region: "US Las Vegas", ServerName: "lasvegas405", Protocol: "udp", PortForward: false, IP: net.IP{82, 102, 31, 108}},
|
||||
{Region: "US Las Vegas", ServerName: "lasvegas406", Protocol: "udp", PortForward: false, IP: net.IP{82, 102, 31, 188}},
|
||||
{Region: "US Las Vegas", ServerName: "lasvegas406", Protocol: "udp", PortForward: false, IP: net.IP{82, 102, 31, 183}},
|
||||
{Region: "US Las Vegas", ServerName: "lasvegas410", Protocol: "udp", PortForward: false, IP: net.IP{79, 110, 53, 247}},
|
||||
{Region: "US Las Vegas", ServerName: "lasvegas410", Protocol: "udp", PortForward: false, IP: net.IP{79, 110, 53, 243}},
|
||||
{Region: "US New York", ServerName: "newjersey414", Protocol: "udp", PortForward: false, IP: net.IP{138, 199, 10, 47}},
|
||||
{Region: "US New York", ServerName: "newjersey414", Protocol: "udp", PortForward: false, IP: net.IP{138, 199, 10, 30}},
|
||||
{Region: "US New York", ServerName: "newyork404", Protocol: "udp", PortForward: false, IP: net.IP{143, 244, 44, 238}},
|
||||
{Region: "US New York", ServerName: "newyork404", Protocol: "udp", PortForward: false, IP: net.IP{143, 244, 44, 208}},
|
||||
{Region: "US New York", ServerName: "newyork409", Protocol: "udp", PortForward: false, IP: net.IP{156, 146, 55, 244}},
|
||||
{Region: "US New York", ServerName: "newyork409", Protocol: "udp", PortForward: false, IP: net.IP{156, 146, 55, 244}},
|
||||
{Region: "US New York", ServerName: "newyork413", Protocol: "udp", PortForward: false, IP: net.IP{156, 146, 54, 30}},
|
||||
{Region: "US New York", ServerName: "newyork413", Protocol: "udp", PortForward: false, IP: net.IP{156, 146, 54, 39}},
|
||||
{Region: "US New York", ServerName: "newyork420", Protocol: "udp", PortForward: false, IP: net.IP{138, 199, 10, 83}},
|
||||
{Region: "US New York", ServerName: "newyork420", Protocol: "udp", PortForward: false, IP: net.IP{138, 199, 10, 67}},
|
||||
{Region: "US Seattle", ServerName: "seattle406", Protocol: "udp", PortForward: false, IP: net.IP{154, 9, 128, 66}},
|
||||
{Region: "US Seattle", ServerName: "seattle406", Protocol: "udp", PortForward: false, IP: net.IP{154, 9, 128, 65}},
|
||||
{Region: "US Seattle", ServerName: "seattle413", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 20, 56}},
|
||||
{Region: "US Seattle", ServerName: "seattle413", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 20, 40}},
|
||||
{Region: "US Seattle", ServerName: "seattle417", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 20, 163}},
|
||||
{Region: "US Seattle", ServerName: "seattle417", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 20, 170}},
|
||||
{Region: "US Seattle", ServerName: "seattle418", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 20, 196}},
|
||||
{Region: "US Seattle", ServerName: "seattle418", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 20, 213}},
|
||||
{Region: "US Seattle", ServerName: "seattle423", Protocol: "udp", PortForward: false, IP: net.IP{156, 146, 48, 175}},
|
||||
{Region: "US Seattle", ServerName: "seattle423", Protocol: "udp", PortForward: false, IP: net.IP{156, 146, 48, 193}},
|
||||
{Region: "US Silicon Valley", ServerName: "siliconvalley403", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 212, 98}},
|
||||
{Region: "US Silicon Valley", ServerName: "siliconvalley403", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 212, 98}},
|
||||
{Region: "US Silicon Valley", ServerName: "siliconvalley407", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 212, 203}},
|
||||
{Region: "US Silicon Valley", ServerName: "siliconvalley407", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 212, 203}},
|
||||
{Region: "US Silicon Valley", ServerName: "siliconvalley414", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 216, 33}},
|
||||
{Region: "US Silicon Valley", ServerName: "siliconvalley414", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 216, 26}},
|
||||
{Region: "US Silicon Valley", ServerName: "siliconvalley415", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 216, 53}},
|
||||
{Region: "US Silicon Valley", ServerName: "siliconvalley415", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 216, 93}},
|
||||
{Region: "US Silicon Valley", ServerName: "siliconvalley417", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 216, 165}},
|
||||
{Region: "US Silicon Valley", ServerName: "siliconvalley417", Protocol: "udp", PortForward: false, IP: net.IP{154, 21, 216, 159}},
|
||||
{Region: "US Texas", ServerName: "dallas404", Protocol: "udp", PortForward: false, IP: net.IP{154, 3, 251, 49}},
|
||||
{Region: "US Texas", ServerName: "dallas404", Protocol: "udp", PortForward: false, IP: net.IP{154, 3, 251, 36}},
|
||||
{Region: "US Texas", ServerName: "dallas405", Protocol: "udp", PortForward: false, IP: net.IP{154, 3, 251, 79}},
|
||||
{Region: "US Texas", ServerName: "dallas405", Protocol: "udp", PortForward: false, IP: net.IP{154, 3, 251, 65}},
|
||||
{Region: "US Texas", ServerName: "dallas407", Protocol: "udp", PortForward: false, IP: net.IP{154, 3, 251, 149}},
|
||||
{Region: "US Texas", ServerName: "dallas407", Protocol: "udp", PortForward: false, IP: net.IP{154, 3, 251, 155}},
|
||||
{Region: "US Texas", ServerName: "dallas414", Protocol: "udp", PortForward: false, IP: net.IP{154, 29, 131, 229}},
|
||||
{Region: "US Texas", ServerName: "dallas414", Protocol: "udp", PortForward: false, IP: net.IP{154, 29, 131, 229}},
|
||||
{Region: "US Texas", ServerName: "dallas417", Protocol: "udp", PortForward: false, IP: net.IP{154, 3, 250, 99}},
|
||||
{Region: "US Texas", ServerName: "dallas417", Protocol: "udp", PortForward: false, IP: net.IP{154, 3, 250, 103}},
|
||||
{Region: "US Washington DC", ServerName: "washington435", Protocol: "udp", PortForward: false, IP: net.IP{154, 3, 44, 126}},
|
||||
{Region: "US Washington DC", ServerName: "washington435", Protocol: "udp", PortForward: false, IP: net.IP{154, 3, 44, 126}},
|
||||
{Region: "US Washington DC", ServerName: "washington436", Protocol: "udp", PortForward: false, IP: net.IP{154, 3, 44, 147}},
|
||||
{Region: "US Washington DC", ServerName: "washington436", Protocol: "udp", PortForward: false, IP: net.IP{154, 3, 44, 149}},
|
||||
{Region: "US Washington DC", ServerName: "washington440", Protocol: "udp", PortForward: false, IP: net.IP{38, 70, 11, 10}},
|
||||
{Region: "US Washington DC", ServerName: "washington440", Protocol: "udp", PortForward: false, IP: net.IP{38, 70, 11, 27}},
|
||||
{Region: "US Washington DC", ServerName: "washington444", Protocol: "udp", PortForward: false, IP: net.IP{38, 70, 11, 157}},
|
||||
{Region: "US Washington DC", ServerName: "washington444", Protocol: "udp", PortForward: false, IP: net.IP{38, 70, 11, 147}},
|
||||
{Region: "US Washington DC", ServerName: "washington445", Protocol: "udp", PortForward: false, IP: net.IP{38, 70, 11, 190}},
|
||||
{Region: "US Washington DC", ServerName: "washington445", Protocol: "udp", PortForward: false, IP: net.IP{38, 70, 11, 164}},
|
||||
{Region: "US West", ServerName: "phoenix406", Protocol: "udp", PortForward: false, IP: net.IP{184, 170, 241, 49}},
|
||||
{Region: "US West", ServerName: "phoenix406", Protocol: "udp", PortForward: false, IP: net.IP{184, 170, 241, 6}},
|
||||
{Region: "US West", ServerName: "phoenix407", Protocol: "udp", PortForward: false, IP: net.IP{184, 170, 241, 76}},
|
||||
{Region: "US West", ServerName: "phoenix407", Protocol: "udp", PortForward: false, IP: net.IP{184, 170, 241, 110}},
|
||||
{Region: "US West", ServerName: "phoenix410", Protocol: "udp", PortForward: false, IP: net.IP{184, 170, 252, 193}},
|
||||
{Region: "US West", ServerName: "phoenix410", Protocol: "udp", PortForward: false, IP: net.IP{184, 170, 252, 193}},
|
||||
{Region: "US West", ServerName: "phoenix412", Protocol: "udp", PortForward: false, IP: net.IP{107, 181, 184, 210}},
|
||||
{Region: "US West", ServerName: "phoenix412", Protocol: "udp", PortForward: false, IP: net.IP{107, 181, 184, 210}},
|
||||
{Region: "US West", ServerName: "phoenix414", Protocol: "udp", PortForward: false, IP: net.IP{184, 170, 242, 155}},
|
||||
{Region: "US West", ServerName: "phoenix414", Protocol: "udp", PortForward: false, IP: net.IP{184, 170, 242, 155}},
|
||||
{Region: "Ukraine", ServerName: "kiev401", Protocol: "udp", PortForward: true, IP: net.IP{62, 149, 20, 58}},
|
||||
{Region: "Ukraine", ServerName: "kiev401", Protocol: "udp", PortForward: true, IP: net.IP{62, 149, 20, 55}},
|
||||
{Region: "Ukraine", ServerName: "kiev402", Protocol: "udp", PortForward: true, IP: net.IP{62, 149, 20, 28}},
|
||||
{Region: "Ukraine", ServerName: "kiev402", Protocol: "udp", PortForward: true, IP: net.IP{62, 149, 20, 23}},
|
||||
{Region: "Ukraine", ServerName: "kiev403", Protocol: "udp", PortForward: true, IP: net.IP{62, 149, 20, 5}},
|
||||
{Region: "Ukraine", ServerName: "kiev403", Protocol: "udp", PortForward: true, IP: net.IP{62, 149, 20, 4}},
|
||||
{Region: "Ukraine", ServerName: "kiev404", Protocol: "udp", PortForward: true, IP: net.IP{62, 149, 20, 44}},
|
||||
{Region: "Ukraine", ServerName: "kiev404", Protocol: "udp", PortForward: true, IP: net.IP{62, 149, 20, 44}},
|
||||
{Region: "United Arab Emirates", ServerName: "dubai403", Protocol: "udp", PortForward: true, IP: net.IP{217, 138, 193, 153}},
|
||||
{Region: "United Arab Emirates", ServerName: "dubai403", Protocol: "udp", PortForward: true, IP: net.IP{217, 138, 193, 156}},
|
||||
{Region: "United Arab Emirates", ServerName: "dubai404", Protocol: "udp", PortForward: true, IP: net.IP{217, 138, 193, 173}},
|
||||
{Region: "United Arab Emirates", ServerName: "dubai404", Protocol: "udp", PortForward: true, IP: net.IP{217, 138, 193, 164}},
|
||||
{Region: "Venezuela", ServerName: "venezuela403", Protocol: "udp", PortForward: true, IP: net.IP{95, 181, 237, 5}},
|
||||
{Region: "Venezuela", ServerName: "venezuela403", Protocol: "udp", PortForward: true, IP: net.IP{95, 181, 237, 3}},
|
||||
{Region: "Venezuela", ServerName: "venezuela404", Protocol: "udp", PortForward: true, IP: net.IP{95, 181, 237, 15}},
|
||||
{Region: "Venezuela", ServerName: "venezuela404", Protocol: "udp", PortForward: true, IP: net.IP{95, 181, 237, 17}},
|
||||
{Region: "Vietnam", ServerName: "vietnam401", Protocol: "udp", PortForward: true, IP: net.IP{188, 214, 152, 70}},
|
||||
{Region: "Vietnam", ServerName: "vietnam401", Protocol: "udp", PortForward: true, IP: net.IP{188, 214, 152, 77}},
|
||||
{Region: "Vietnam", ServerName: "vietnam402", Protocol: "udp", PortForward: true, IP: net.IP{188, 214, 152, 93}},
|
||||
{Region: "Vietnam", ServerName: "vietnam402", Protocol: "udp", PortForward: true, IP: net.IP{188, 214, 152, 88}},
|
||||
func PIAHostnameChoices() (choices []string) {
|
||||
servers := PIAServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Hostname
|
||||
}
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
func PIANameChoices() (choices []string) {
|
||||
servers := PIAServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].ServerName
|
||||
}
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
// PIAServers returns a slice of all the server information for PIA.
|
||||
func PIAServers() (servers []models.PIAServer) {
|
||||
servers = make([]models.PIAServer, len(allServers.Pia.Servers))
|
||||
copy(servers, allServers.Pia.Servers)
|
||||
return servers
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package constants
|
||||
|
||||
import (
|
||||
"net"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
)
|
||||
|
||||
@@ -11,201 +9,45 @@ const (
|
||||
PrivadoCertificate = "MIIFKDCCAxCgAwIBAgIJAMtrmqZxIV/OMA0GCSqGSIb3DQEBDQUAMBIxEDAOBgNVBAMMB1ByaXZhZG8wHhcNMjAwMTA4MjEyODQ1WhcNMzUwMTA5MjEyODQ1WjASMRAwDgYDVQQDDAdQcml2YWRvMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxPwOgiwNJzZTnKIXwAB0TSu/Lu2qt2U2I8obtQjwhi/7OrfmbmYykSdro70al2XPhnwAGGdCxW6LDnp0UN/IOhD11mgBPo14f5CLkBQjSJ6VN5miPbvK746LsNZl9H8rQGvDuPo4CG9BfPZMiDRGlsMxij/jztzgT1gmuxQ7WHfFRcNzBas1dHa9hV/d3TU6/t47x4SE/ljdcCtJiu7Zn6ODKQoys3mB7Luz2ngqUJWvkqsg+E4+3eJ0M8Hlbn5TPaRJBID7DAdYo6Vs6xGCYr981ThFcmoIQ10js10yANrrfGAzd03b3TnLAgko0uQMHjliMZL6L8sWOPHxyxJI0us88SFh4UgcFyRHKHPKux7w24SxAlZUYoUcTHp9VjG5XvDKYxzgV2RdM4ulBGbQRQ3y3/CyddsyQYMvA55Ets0LfPaBvDIcct70iXijGsdvlX1du3ArGpG7Vaje/RU4nbbGT6HYRdt5YyZfof288ukMOSj20nVcmS+c/4tqsxSerRb1aq5LOi1IemSkTMeC5gCbexk+L1vl7NT/58sxjGmu5bXwnvev/lIItfi2AlITrfUSEv19iDMKkeshwn/+sFJBMWYyluP+yJ56yR+MWoXvLlSWphLDTqq19yx3BZn0P1tgbXoR0g8PTdJFcz8z3RIb7myVLYulV1oGG/3rka0CAwEAAaOBgDB+MB0GA1UdDgQWBBTFtJkZCVDuDAD6k5bJzefjJdO3DTBCBgNVHSMEOzA5gBTFtJkZCVDuDAD6k5bJzefjJdO3DaEWpBQwEjEQMA4GA1UEAwwHUHJpdmFkb4IJAMtrmqZxIV/OMAwGA1UdEwQFMAMBAf8wCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBDQUAA4ICAQB7MUSXMeBb9wlSv4sUaT1JHEwE26nlBw+TKmezfuPU5pBlY0LYr6qQZY95DHqsRJ7ByUzGUrGo17dNGXlcuNc6TAaQQEDRPo6y+LVh2TWMk15TUMI+MkqryJtCret7xGvDigKYMJgBy58HN3RAVr1B7cL9youwzLgc2Y/NcFKvnQJKeiIYAJ7g0CcnJiQvgZTS7xdwkEBXfsngmUCIG320DLPEL+Ze0HiUrxwWljMRya6i40AeH3Zu2i532xX1wV5+cjA4RJWIKg6ri/Q54iFGtZrA9/nc6y9uoQHkmz8cGyVUmJxFzMrrIICVqUtVRxLhkTMe4UzwRWTBeGgtW4tS0yq1QonAKfOyjgRw/CeY55D2UGvnAFZdTadtYXS4Alu2P9zdwoEk3fzHiVmDjqfJVr5wz9383aABUFrPI3nz6ed/Z6LZflKh1k+DUDEp8NxU4klUULWsSOKoa5zGX51G8cdHxwQLImXvtGuN5eSR8jCTgxFZhdps/xes4KkyfIz9FMYG748M+uOTgKITf4zdJ9BAyiQaOufVQZ8WjhWzWk9YHec9VqPkzpWNGkVjiRI5ewuXwZzZ164tMv2hikBXSuUCnFz37/ZNwGlDi0oBdDszCk2GxccdFHHaCSmpjU5MrdJ+5IhtTKGeTx+US2hTIVHQFIO99DmacxSYvLNcSQ=="
|
||||
)
|
||||
|
||||
func PrivadoCountryChoices() (choices []string) {
|
||||
servers := PrivadoServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Country
|
||||
}
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
func PrivadoRegionChoices() (choices []string) {
|
||||
servers := PrivadoServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Region
|
||||
}
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
func PrivadoCityChoices() (choices []string) {
|
||||
servers := PrivadoServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].City
|
||||
}
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
func PrivadoHostnameChoices() (choices []string) {
|
||||
servers := PrivadoServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Hostname
|
||||
}
|
||||
return choices
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
func PrivadoServers() []models.PrivadoServer {
|
||||
return []models.PrivadoServer{
|
||||
{Hostname: "akl-001.vpn.privado.io", IP: net.IP{23, 254, 104, 114}},
|
||||
{Hostname: "akl-002.vpn.privado.io", IP: net.IP{23, 254, 104, 120}},
|
||||
{Hostname: "akl-003.vpn.privado.io", IP: net.IP{23, 254, 104, 51}},
|
||||
{Hostname: "ams-001.vpn.privado.io", IP: net.IP{91, 148, 224, 10}},
|
||||
{Hostname: "ams-002.vpn.privado.io", IP: net.IP{91, 148, 224, 20}},
|
||||
{Hostname: "ams-003.vpn.privado.io", IP: net.IP{91, 148, 224, 30}},
|
||||
{Hostname: "ams-004.vpn.privado.io", IP: net.IP{91, 148, 224, 40}},
|
||||
{Hostname: "ams-005.vpn.privado.io", IP: net.IP{91, 148, 224, 50}},
|
||||
{Hostname: "ams-006.vpn.privado.io", IP: net.IP{91, 148, 224, 60}},
|
||||
{Hostname: "ams-007.vpn.privado.io", IP: net.IP{91, 148, 224, 70}},
|
||||
{Hostname: "ams-008.vpn.privado.io", IP: net.IP{91, 148, 224, 80}},
|
||||
{Hostname: "ams-009.vpn.privado.io", IP: net.IP{91, 148, 228, 10}},
|
||||
{Hostname: "ams-010.vpn.privado.io", IP: net.IP{91, 148, 228, 20}},
|
||||
{Hostname: "ams-011.vpn.privado.io", IP: net.IP{91, 148, 228, 30}},
|
||||
{Hostname: "ams-012.vpn.privado.io", IP: net.IP{91, 148, 228, 40}},
|
||||
{Hostname: "arn-001.vpn.privado.io", IP: net.IP{86, 106, 103, 67}},
|
||||
{Hostname: "arn-002.vpn.privado.io", IP: net.IP{86, 106, 103, 74}},
|
||||
{Hostname: "arn-003.vpn.privado.io", IP: net.IP{86, 106, 103, 81}},
|
||||
{Hostname: "arn-004.vpn.privado.io", IP: net.IP{86, 106, 103, 88}},
|
||||
{Hostname: "ath-001.vpn.privado.io", IP: net.IP{188, 123, 126, 61}},
|
||||
{Hostname: "ath-002.vpn.privado.io", IP: net.IP{188, 123, 126, 64}},
|
||||
{Hostname: "ath-003.vpn.privado.io", IP: net.IP{188, 123, 126, 68}},
|
||||
{Hostname: "ath-004.vpn.privado.io", IP: net.IP{188, 123, 126, 72}},
|
||||
{Hostname: "beg-001.vpn.privado.io", IP: net.IP{89, 38, 224, 19}},
|
||||
{Hostname: "beg-002.vpn.privado.io", IP: net.IP{89, 38, 224, 25}},
|
||||
{Hostname: "bkk-001.vpn.privado.io", IP: net.IP{119, 59, 111, 3}},
|
||||
{Hostname: "bkk-002.vpn.privado.io", IP: net.IP{119, 59, 111, 11}},
|
||||
{Hostname: "bom-001.vpn.privado.io", IP: net.IP{103, 26, 204, 61}},
|
||||
{Hostname: "bom-002.vpn.privado.io", IP: net.IP{103, 26, 204, 70}},
|
||||
{Hostname: "bru-001.vpn.privado.io", IP: net.IP{217, 138, 211, 163}},
|
||||
{Hostname: "bru-002.vpn.privado.io", IP: net.IP{217, 138, 211, 170}},
|
||||
{Hostname: "bru-003.vpn.privado.io", IP: net.IP{217, 138, 211, 177}},
|
||||
{Hostname: "bru-004.vpn.privado.io", IP: net.IP{217, 138, 211, 184}},
|
||||
{Hostname: "bts-001.vpn.privado.io", IP: net.IP{37, 120, 221, 227}},
|
||||
{Hostname: "bts-002.vpn.privado.io", IP: net.IP{37, 120, 221, 233}},
|
||||
{Hostname: "bud-001.vpn.privado.io", IP: net.IP{185, 128, 26, 194}},
|
||||
{Hostname: "bud-002.vpn.privado.io", IP: net.IP{185, 128, 26, 200}},
|
||||
{Hostname: "cdg-001.vpn.privado.io", IP: net.IP{89, 40, 183, 99}},
|
||||
{Hostname: "cdg-002.vpn.privado.io", IP: net.IP{89, 40, 183, 104}},
|
||||
{Hostname: "cdg-003.vpn.privado.io", IP: net.IP{89, 40, 183, 109}},
|
||||
{Hostname: "cdg-004.vpn.privado.io", IP: net.IP{89, 40, 183, 114}},
|
||||
{Hostname: "cph-001.vpn.privado.io", IP: net.IP{2, 58, 46, 35}},
|
||||
{Hostname: "cph-002.vpn.privado.io", IP: net.IP{2, 58, 46, 42}},
|
||||
{Hostname: "cph-003.vpn.privado.io", IP: net.IP{2, 58, 46, 49}},
|
||||
{Hostname: "cph-004.vpn.privado.io", IP: net.IP{2, 58, 46, 56}},
|
||||
{Hostname: "dca-005.vpn.privado.io", IP: net.IP{85, 12, 61, 50}},
|
||||
{Hostname: "dca-006.vpn.privado.io", IP: net.IP{85, 12, 61, 60}},
|
||||
{Hostname: "dca-007.vpn.privado.io", IP: net.IP{85, 12, 61, 70}},
|
||||
{Hostname: "dca-008.vpn.privado.io", IP: net.IP{85, 12, 61, 80}},
|
||||
{Hostname: "dca-009.vpn.privado.io", IP: net.IP{85, 12, 61, 90}},
|
||||
{Hostname: "dca-010.vpn.privado.io", IP: net.IP{85, 12, 61, 100}},
|
||||
{Hostname: "dca-011.vpn.privado.io", IP: net.IP{85, 12, 61, 110}},
|
||||
{Hostname: "dca-012.vpn.privado.io", IP: net.IP{85, 12, 61, 120}},
|
||||
{Hostname: "dca-013.vpn.privado.io", IP: net.IP{185, 247, 68, 3}},
|
||||
{Hostname: "dca-014.vpn.privado.io", IP: net.IP{185, 247, 68, 14}},
|
||||
{Hostname: "dfw-001.vpn.privado.io", IP: net.IP{23, 105, 32, 243}},
|
||||
{Hostname: "dfw-002.vpn.privado.io", IP: net.IP{23, 105, 32, 244}},
|
||||
{Hostname: "dub-001.vpn.privado.io", IP: net.IP{84, 247, 48, 227}},
|
||||
{Hostname: "dub-002.vpn.privado.io", IP: net.IP{84, 247, 48, 234}},
|
||||
{Hostname: "dub-003.vpn.privado.io", IP: net.IP{84, 247, 48, 241}},
|
||||
{Hostname: "dub-004.vpn.privado.io", IP: net.IP{84, 247, 48, 248}},
|
||||
{Hostname: "eze-001.vpn.privado.io", IP: net.IP{168, 205, 93, 211}},
|
||||
{Hostname: "eze-002.vpn.privado.io", IP: net.IP{168, 205, 93, 215}},
|
||||
{Hostname: "fra-001.vpn.privado.io", IP: net.IP{91, 148, 232, 10}},
|
||||
{Hostname: "fra-002.vpn.privado.io", IP: net.IP{91, 148, 232, 20}},
|
||||
{Hostname: "fra-003.vpn.privado.io", IP: net.IP{91, 148, 232, 30}},
|
||||
{Hostname: "fra-004.vpn.privado.io", IP: net.IP{91, 148, 232, 40}},
|
||||
{Hostname: "fra-005.vpn.privado.io", IP: net.IP{91, 148, 233, 7}},
|
||||
{Hostname: "fra-006.vpn.privado.io", IP: net.IP{91, 148, 233, 8}},
|
||||
{Hostname: "fra-007.vpn.privado.io", IP: net.IP{91, 148, 233, 9}},
|
||||
{Hostname: "fra-008.vpn.privado.io", IP: net.IP{91, 148, 233, 10}},
|
||||
{Hostname: "gru-001.vpn.privado.io", IP: net.IP{177, 54, 145, 193}},
|
||||
{Hostname: "gru-002.vpn.privado.io", IP: net.IP{177, 54, 145, 197}},
|
||||
{Hostname: "hel-001.vpn.privado.io", IP: net.IP{194, 34, 134, 219}},
|
||||
{Hostname: "hel-002.vpn.privado.io", IP: net.IP{194, 34, 134, 227}},
|
||||
{Hostname: "hkg-001.vpn.privado.io", IP: net.IP{209, 58, 185, 88}},
|
||||
{Hostname: "hkg-002.vpn.privado.io", IP: net.IP{209, 58, 185, 97}},
|
||||
{Hostname: "hkg-003.vpn.privado.io", IP: net.IP{209, 58, 185, 108}},
|
||||
{Hostname: "hkg-004.vpn.privado.io", IP: net.IP{209, 58, 185, 120}},
|
||||
{Hostname: "icn-001.vpn.privado.io", IP: net.IP{169, 56, 73, 146}},
|
||||
{Hostname: "icn-002.vpn.privado.io", IP: net.IP{169, 56, 73, 153}},
|
||||
{Hostname: "iev-001.vpn.privado.io", IP: net.IP{176, 103, 52, 40}},
|
||||
{Hostname: "iev-002.vpn.privado.io", IP: net.IP{176, 103, 53, 40}},
|
||||
{Hostname: "ist-001.vpn.privado.io", IP: net.IP{185, 84, 183, 3}},
|
||||
{Hostname: "ist-002.vpn.privado.io", IP: net.IP{185, 84, 183, 4}},
|
||||
{Hostname: "jfk-001.vpn.privado.io", IP: net.IP{217, 138, 208, 99}},
|
||||
{Hostname: "jfk-002.vpn.privado.io", IP: net.IP{217, 138, 208, 106}},
|
||||
{Hostname: "jfk-003.vpn.privado.io", IP: net.IP{217, 138, 208, 113}},
|
||||
{Hostname: "jfk-004.vpn.privado.io", IP: net.IP{217, 138, 208, 120}},
|
||||
{Hostname: "jnb-001.vpn.privado.io", IP: net.IP{172, 107, 93, 131}},
|
||||
{Hostname: "jnb-002.vpn.privado.io", IP: net.IP{172, 107, 93, 137}},
|
||||
{Hostname: "lax-001.vpn.privado.io", IP: net.IP{81, 171, 62, 3}},
|
||||
{Hostname: "lax-002.vpn.privado.io", IP: net.IP{81, 171, 62, 13}},
|
||||
{Hostname: "lax-003.vpn.privado.io", IP: net.IP{81, 171, 62, 24}},
|
||||
{Hostname: "lax-004.vpn.privado.io", IP: net.IP{81, 171, 62, 34}},
|
||||
{Hostname: "lax-005.vpn.privado.io", IP: net.IP{81, 171, 62, 70}},
|
||||
{Hostname: "lax-006.vpn.privado.io", IP: net.IP{81, 171, 62, 80}},
|
||||
{Hostname: "lax-007.vpn.privado.io", IP: net.IP{81, 171, 62, 90}},
|
||||
{Hostname: "lax-008.vpn.privado.io", IP: net.IP{81, 171, 62, 100}},
|
||||
{Hostname: "lax-009.vpn.privado.io", IP: net.IP{45, 152, 182, 227}},
|
||||
{Hostname: "lax-010.vpn.privado.io", IP: net.IP{45, 152, 182, 234}},
|
||||
{Hostname: "lax-011.vpn.privado.io", IP: net.IP{45, 152, 182, 241}},
|
||||
{Hostname: "lax-012.vpn.privado.io", IP: net.IP{45, 152, 182, 248}},
|
||||
{Hostname: "lis-001.vpn.privado.io", IP: net.IP{89, 26, 243, 153}},
|
||||
{Hostname: "lis-002.vpn.privado.io", IP: net.IP{89, 26, 243, 154}},
|
||||
{Hostname: "lon-001.vpn.privado.io", IP: net.IP{217, 138, 195, 163}},
|
||||
{Hostname: "lon-002.vpn.privado.io", IP: net.IP{217, 138, 195, 168}},
|
||||
{Hostname: "lon-003.vpn.privado.io", IP: net.IP{217, 138, 195, 173}},
|
||||
{Hostname: "lon-004.vpn.privado.io", IP: net.IP{217, 138, 195, 178}},
|
||||
{Hostname: "mad-001.vpn.privado.io", IP: net.IP{217, 138, 218, 131}},
|
||||
{Hostname: "mad-002.vpn.privado.io", IP: net.IP{217, 138, 218, 138}},
|
||||
{Hostname: "mad-003.vpn.privado.io", IP: net.IP{217, 138, 218, 145}},
|
||||
{Hostname: "mad-004.vpn.privado.io", IP: net.IP{217, 138, 218, 152}},
|
||||
{Hostname: "man-001.vpn.privado.io", IP: net.IP{217, 138, 196, 131}},
|
||||
{Hostname: "man-002.vpn.privado.io", IP: net.IP{217, 138, 196, 138}},
|
||||
{Hostname: "man-003.vpn.privado.io", IP: net.IP{217, 138, 196, 145}},
|
||||
{Hostname: "man-004.vpn.privado.io", IP: net.IP{217, 138, 196, 152}},
|
||||
{Hostname: "mex-001.vpn.privado.io", IP: net.IP{169, 57, 96, 52}},
|
||||
{Hostname: "mex-002.vpn.privado.io", IP: net.IP{169, 57, 96, 57}},
|
||||
{Hostname: "mia-001.vpn.privado.io", IP: net.IP{86, 106, 87, 131}},
|
||||
{Hostname: "mia-002.vpn.privado.io", IP: net.IP{86, 106, 87, 136}},
|
||||
{Hostname: "mia-003.vpn.privado.io", IP: net.IP{86, 106, 87, 141}},
|
||||
{Hostname: "mia-004.vpn.privado.io", IP: net.IP{86, 106, 87, 146}},
|
||||
{Hostname: "mxp-001.vpn.privado.io", IP: net.IP{89, 40, 182, 195}},
|
||||
{Hostname: "mxp-002.vpn.privado.io", IP: net.IP{89, 40, 182, 201}},
|
||||
{Hostname: "nrt-001.vpn.privado.io", IP: net.IP{217, 138, 252, 3}},
|
||||
{Hostname: "nrt-002.vpn.privado.io", IP: net.IP{217, 138, 252, 10}},
|
||||
{Hostname: "nrt-003.vpn.privado.io", IP: net.IP{217, 138, 252, 17}},
|
||||
{Hostname: "nrt-004.vpn.privado.io", IP: net.IP{217, 138, 252, 24}},
|
||||
{Hostname: "ord-001.vpn.privado.io", IP: net.IP{23, 108, 95, 129}},
|
||||
{Hostname: "ord-002.vpn.privado.io", IP: net.IP{23, 108, 95, 167}},
|
||||
{Hostname: "osl-001.vpn.privado.io", IP: net.IP{84, 247, 50, 115}},
|
||||
{Hostname: "osl-002.vpn.privado.io", IP: net.IP{84, 247, 50, 119}},
|
||||
{Hostname: "osl-003.vpn.privado.io", IP: net.IP{84, 247, 50, 123}},
|
||||
{Hostname: "otp-001.vpn.privado.io", IP: net.IP{89, 46, 102, 179}},
|
||||
{Hostname: "otp-002.vpn.privado.io", IP: net.IP{89, 46, 102, 185}},
|
||||
{Hostname: "phx-001.vpn.privado.io", IP: net.IP{91, 148, 236, 10}},
|
||||
{Hostname: "phx-002.vpn.privado.io", IP: net.IP{91, 148, 236, 20}},
|
||||
{Hostname: "phx-003.vpn.privado.io", IP: net.IP{91, 148, 236, 30}},
|
||||
{Hostname: "phx-004.vpn.privado.io", IP: net.IP{91, 148, 236, 40}},
|
||||
{Hostname: "phx-005.vpn.privado.io", IP: net.IP{91, 148, 236, 50}},
|
||||
{Hostname: "phx-006.vpn.privado.io", IP: net.IP{91, 148, 236, 60}},
|
||||
{Hostname: "phx-007.vpn.privado.io", IP: net.IP{91, 148, 236, 70}},
|
||||
{Hostname: "phx-008.vpn.privado.io", IP: net.IP{91, 148, 236, 80}},
|
||||
{Hostname: "prg-001.vpn.privado.io", IP: net.IP{185, 216, 35, 99}},
|
||||
{Hostname: "prg-002.vpn.privado.io", IP: net.IP{185, 216, 35, 105}},
|
||||
{Hostname: "rix-001.vpn.privado.io", IP: net.IP{109, 248, 149, 35}},
|
||||
{Hostname: "rix-002.vpn.privado.io", IP: net.IP{109, 248, 149, 40}},
|
||||
{Hostname: "rkv-001.vpn.privado.io", IP: net.IP{82, 221, 131, 78}},
|
||||
{Hostname: "rkv-002.vpn.privado.io", IP: net.IP{82, 221, 131, 127}},
|
||||
{Hostname: "sea-001.vpn.privado.io", IP: net.IP{23, 81, 208, 96}},
|
||||
{Hostname: "sea-002.vpn.privado.io", IP: net.IP{23, 81, 208, 104}},
|
||||
{Hostname: "sin-001.vpn.privado.io", IP: net.IP{92, 119, 178, 131}},
|
||||
{Hostname: "sin-002.vpn.privado.io", IP: net.IP{92, 119, 178, 138}},
|
||||
{Hostname: "sin-003.vpn.privado.io", IP: net.IP{92, 119, 178, 145}},
|
||||
{Hostname: "sin-004.vpn.privado.io", IP: net.IP{92, 119, 178, 152}},
|
||||
{Hostname: "sof-001.vpn.privado.io", IP: net.IP{217, 138, 221, 163}},
|
||||
{Hostname: "sof-002.vpn.privado.io", IP: net.IP{217, 138, 221, 169}},
|
||||
{Hostname: "stl-001.vpn.privado.io", IP: net.IP{148, 72, 170, 145}},
|
||||
{Hostname: "stl-002.vpn.privado.io", IP: net.IP{148, 72, 172, 82}},
|
||||
{Hostname: "syd-001.vpn.privado.io", IP: net.IP{93, 115, 35, 35}},
|
||||
{Hostname: "syd-002.vpn.privado.io", IP: net.IP{93, 115, 35, 42}},
|
||||
{Hostname: "syd-003.vpn.privado.io", IP: net.IP{93, 115, 35, 49}},
|
||||
{Hostname: "syd-004.vpn.privado.io", IP: net.IP{93, 115, 35, 56}},
|
||||
{Hostname: "vie-001.vpn.privado.io", IP: net.IP{5, 253, 207, 227}},
|
||||
{Hostname: "vie-002.vpn.privado.io", IP: net.IP{5, 253, 207, 234}},
|
||||
{Hostname: "vie-003.vpn.privado.io", IP: net.IP{5, 253, 207, 241}},
|
||||
{Hostname: "vie-004.vpn.privado.io", IP: net.IP{5, 253, 207, 248}},
|
||||
{Hostname: "vno-001.vpn.privado.io", IP: net.IP{185, 64, 104, 176}},
|
||||
{Hostname: "vno-002.vpn.privado.io", IP: net.IP{185, 64, 104, 180}},
|
||||
{Hostname: "waw-001.vpn.privado.io", IP: net.IP{217, 138, 209, 163}},
|
||||
{Hostname: "waw-002.vpn.privado.io", IP: net.IP{217, 138, 209, 164}},
|
||||
{Hostname: "waw-003.vpn.privado.io", IP: net.IP{217, 138, 209, 165}},
|
||||
{Hostname: "waw-004.vpn.privado.io", IP: net.IP{217, 138, 209, 166}},
|
||||
{Hostname: "yul-001.vpn.privado.io", IP: net.IP{217, 138, 213, 67}},
|
||||
{Hostname: "yul-002.vpn.privado.io", IP: net.IP{217, 138, 213, 72}},
|
||||
{Hostname: "yul-003.vpn.privado.io", IP: net.IP{217, 138, 213, 77}},
|
||||
{Hostname: "yul-004.vpn.privado.io", IP: net.IP{217, 138, 213, 82}},
|
||||
{Hostname: "yvr-001.vpn.privado.io", IP: net.IP{71, 19, 248, 57}},
|
||||
{Hostname: "yvr-002.vpn.privado.io", IP: net.IP{71, 19, 248, 113}},
|
||||
{Hostname: "yyz-003.vpn.privado.io", IP: net.IP{199, 189, 27, 19}},
|
||||
{Hostname: "zrh-001.vpn.privado.io", IP: net.IP{185, 156, 175, 195}},
|
||||
{Hostname: "zrh-002.vpn.privado.io", IP: net.IP{185, 156, 175, 202}},
|
||||
{Hostname: "zrh-003.vpn.privado.io", IP: net.IP{185, 156, 175, 209}},
|
||||
{Hostname: "zrh-004.vpn.privado.io", IP: net.IP{185, 156, 175, 216}},
|
||||
}
|
||||
// PrivadoServers returns a slice of all the Privado servers.
|
||||
func PrivadoServers() (servers []models.PrivadoServer) {
|
||||
servers = make([]models.PrivadoServer, len(allServers.Privado.Servers))
|
||||
copy(servers, allServers.Privado.Servers)
|
||||
return servers
|
||||
}
|
||||
|
||||
44
internal/constants/privatevpn.go
Normal file
44
internal/constants/privatevpn.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package constants
|
||||
|
||||
import (
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
)
|
||||
|
||||
//nolint:lll
|
||||
const (
|
||||
PrivatevpnCertificate = "MIIErTCCA5WgAwIBAgIJAPp3HmtYGCIOMA0GCSqGSIb3DQEBCwUAMIGVMQswCQYDVQQGEwJTRTELMAkGA1UECBMCQ0ExEjAQBgNVBAcTCVN0b2NraG9sbTETMBEGA1UEChMKUHJpdmF0ZVZQTjEWMBQGA1UEAxMNUHJpdmF0ZVZQTiBDQTETMBEGA1UEKRMKUHJpdmF0ZVZQTjEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBwcml2YXR2cG4uc2UwHhcNMTcwNTI0MjAxNTM3WhcNMjcwNTIyMjAxNTM3WjCBlTELMAkGA1UEBhMCU0UxCzAJBgNVBAgTAkNBMRIwEAYDVQQHEwlTdG9ja2hvbG0xEzARBgNVBAoTClByaXZhdGVWUE4xFjAUBgNVBAMTDVByaXZhdGVWUE4gQ0ExEzARBgNVBCkTClByaXZhdGVWUE4xIzAhBgkqhkiG9w0BCQEWFHN1cHBvcnRAcHJpdmF0dnBuLnNlMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwjqTWbKk85WN8nd1TaBgBnBHceQWosp8mMHr4xWMTLagWRcq2Modfy7RPnBo9kyn5j/ZZwL/21gLWJbxidurGyZZdEV9Wb5KQl3DUNxa19kwAbkkEchdES61e99MjmQlWq4vGPXAHjEuDxOZ906AXglCyAvQoXcYW0mNm9yybWllVp1aBrCaZQrNYr7eoFvolqJXdQQ3FFsTBCYa5bHJcKQLBfsiqdJ/BAxhNkQtcmWNSgLy16qoxQpCsxNCxAcYnasuL4rwOP+RazBkJTPXA/2neCJC5rt+sXR9CSfiXdJGwMpYso5m31ZEd7JL2+is0FeAZ6ETrKMnEZMsTpTkdwIDAQABo4H9MIH6MB0GA1UdDgQWBBRCkBlC94zCY6VNncMnK36JxT7bazCBygYDVR0jBIHCMIG/gBRCkBlC94zCY6VNncMnK36JxT7ba6GBm6SBmDCBlTELMAkGA1UEBhMCU0UxCzAJBgNVBAgTAkNBMRIwEAYDVQQHEwlTdG9ja2hvbG0xEzARBgNVBAoTClByaXZhdGVWUE4xFjAUBgNVBAMTDVByaXZhdGVWUE4gQ0ExEzARBgNVBCkTClByaXZhdGVWUE4xIzAhBgkqhkiG9w0BCQEWFHN1cHBvcnRAcHJpdmF0dnBuLnNlggkA+ncea1gYIg4wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAayugvExKDHar7t1zyYn99Vt1NMf46J8x4Dt9TNjBml5mR9nKvWmreMUuuOhLaO8Da466KGdXeDFNLcBYZd/J2iTawE6/3fmrML9H2sa+k/+E4uU5nQ84ZGOwCinCkMalVjM8EZ0/H2RZvLAVUnvPuUz2JfJhmiRkbeE75fVuqpAm9qdE+/7lg3oICYzxa6BJPxT+Imdjy3Q/FWdsXqX6aallhohPAZlMZgZL4eXECnV8rAfzyjOJggkMDZQt3Flc0Y4iDMfzrEhSOWMkNFBFwjK0F/dnhsX+fPX6GGRpUZgZcCt/hWvypqc05/SnrdKM/vV/jV/yZe0NVzY7S8Ur5g=="
|
||||
PrivatevpnOpenvpnStaticKeyV1 = "a49082f082ca89d6a6bb4ecc7c047c6d428a1d3c8254a95206d38a61d7fbe65984214cd7d56eacc5a60803bffd677fa7294d4bfe555036339312de2dfb1335bd9d5fd94b04bba3a15fc5192aeb02fb6d8dd2ca831fad7509be5eefa8d1eaa689dc586c831a23b589c512662652ecf1bb3a4a673816aba434a04f6857b8c2f8bb265bfe48a7b8112539729d2f7d9734a720e1035188118c73fef1824d0237d5579ca382d703b4bb252acaedc753b12199f00154d3769efbcf85ef5ad6ee755cbeaa944cb98e7654286df54c793a8443f5363078e3da548ba0beed079df633283cefb256f6a4bcfc4ab2c4affc24955c1864d5458e84a7c210d0d186269e55dcf6"
|
||||
)
|
||||
|
||||
func PrivatevpnCountryChoices() (choices []string) {
|
||||
servers := PrivatevpnServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Country
|
||||
}
|
||||
return makeChoicesUnique(choices)
|
||||
}
|
||||
|
||||
func PrivatevpnCityChoices() (choices []string) {
|
||||
servers := PrivatevpnServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].City
|
||||
}
|
||||
return makeChoicesUnique(choices)
|
||||
}
|
||||
|
||||
func PrivatevpnHostnameChoices() (choices []string) {
|
||||
servers := PrivatevpnServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Hostname
|
||||
}
|
||||
return makeChoicesUnique(choices)
|
||||
}
|
||||
|
||||
func PrivatevpnServers() (servers []models.PrivatevpnServer) {
|
||||
servers = make([]models.PrivatevpnServer, len(allServers.Privatevpn.Servers))
|
||||
copy(servers, allServers.Privatevpn.Servers)
|
||||
return servers
|
||||
}
|
||||
63
internal/constants/protonvpn.go
Normal file
63
internal/constants/protonvpn.go
Normal file
@@ -0,0 +1,63 @@
|
||||
package constants
|
||||
|
||||
import (
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
)
|
||||
|
||||
//nolint:lll
|
||||
const (
|
||||
ProtonvpnCertificate = "MIIFozCCA4ugAwIBAgIBATANBgkqhkiG9w0BAQ0FADBAMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMUHJvdG9uVlBOIEFHMRowGAYDVQQDExFQcm90b25WUE4gUm9vdCBDQTAeFw0xNzAyMTUxNDM4MDBaFw0yNzAyMTUxNDM4MDBaMEAxCzAJBgNVBAYTAkNIMRUwEwYDVQQKEwxQcm90b25WUE4gQUcxGjAYBgNVBAMTEVByb3RvblZQTiBSb290IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAt+BsSsZg7+AuqTq7vDbPzfygtl9f8fLJqO4amsyOXlI7pquL5IsEZhpWyJIIvYybqS4s1/T7BbvHPLVEwlrq8A5DBIXcfuXrBbKoYkmpICGc2u1KYVGOZ9A+PH9z4Tr6OXFfXRnsbZToie8t2Xjv/dZDdUDAqeW89I/mXg3k5x08m2nfGCQDm4gCanN1r5MT7ge56z0MkY3FFGCOqRwspIEUzu1ZqGSTkG1eQiOYIrdOF5cc7n2APyvBIcfvp/W3cpTOEmEBJ7/14RnXnHo0fcx61Inx/6ZxzKkW8BMdGGQF3tF6u2M0FjVN0lLH9S0ul1TgoOS56yEJ34hrJSRTqHuar3t/xdCbKFZjyXFZFNsXVvgJu34CNLrHHTGJj9jiUfFnxWQYMo9UNUd4a3PPG1HnbG7LAjlvj5JlJ5aqO5gshdnqb9uIQeR2CdzcCJgklwRGCyDT1pm7eoivWV19YBd81vKulLzgPavu3kRRe83yl29It2hwQ9FMs5w6ZV/X6ciTKo3etkX9nBD9ZzJPsGQsBUy7CzO1jK4W01+u3ItmQS+1s4xtcFxdFY8o/q1zoqBlxpe5MQIWN6QalryiET74gMHE/S5WrPlsq/gehxsdgc6GDUXG4dk8vn6OUMa6wb5wRO3VXGEc67IYm4mDFTYiPvLaFOxtndlUWuCruKcCAwEAAaOBpzCBpDAMBgNVHRMEBTADAQH/MB0GA1UdDgQWBBSDkIaYhLVZTwyLNTetNB2qV0gkVDBoBgNVHSMEYTBfgBSDkIaYhLVZTwyLNTetNB2qV0gkVKFEpEIwQDELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFByb3RvblZQTiBBRzEaMBgGA1UEAxMRUHJvdG9uVlBOIFJvb3QgQ0GCAQEwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBDQUAA4ICAQCYr7LpvnfZXBCxVIVc2ea1fjxQ6vkTj0zMhtFs3qfeXpMRf+g1NAh4vv1UIwLsczilMt87SjpJ25pZPyS3O+/VlI9ceZMvtGXdMGfXhTDp//zRoL1cbzSHee9tQlmEm1tKFxB0wfWd/inGRjZxpJCTQh8oc7CTziHZufS+Jkfpc4Rasr31fl7mHhJahF1j/ka/OOWmFbiHBNjzmNWPQInJm+0ygFqij5qs51OEvubR8yh5Mdq4TNuWhFuTxpqoJ87VKaSOx/Aefca44Etwcj4gHb7LThidw/kyzysZiWjyrbfX/31RX7QanKiMk2RDtgZaWi/lMfsl5O+6E2lJ1vo4xv9pW8225B5XeAeXHCfjV/vrrCFqeCprNF6a3Tn/LX6VNy3jbeC+167QagBOaoDA01XPOx7OdhsbGd7cJ5VkgyycZgLnT9zrChgwjx59JQosFEG1DsaAgHfpEl/N3YPJh68N7fwN41Cjzsk39v6iZdfuet/sP7oiP5/gLmA/CIPNhdIYxaojbLjFPkftVjVPn49RqwqzJJPRN8BOyb94yhQ7KO4F3IcLT/y/dsWitY0ZH4lCnAVV/v2YjWAWS3OWyC8BFx/Jmc3WDK/yPwECUcPgHIeXiRjHnJt0Zcm23O2Q3RphpU+1SO3XixsXpOVOYP6rJIXW9bMZA1gTTlpi7A=="
|
||||
ProtonvpnOpenvpnStaticKeyV1 = "6acef03f62675b4b1bbd03e53b187727423cea742242106cb2916a8a4c8297563d22c7e5cef430b1103c6f66eb1fc5b375a672f158e2e2e936c3faa48b035a6de17beaac23b5f03b10b868d53d03521d8ba115059da777a60cbfd7b2c9c5747278a15b8f6e68a3ef7fd583ec9f398c8bd4735dab40cbd1e3c62a822e97489186c30a0b48c7c38ea32ceb056d3fa5a710e10ccc7a0ddb363b08c3d2777a3395e10c0b6080f56309192ab5aacd4b45f55da61fc77af39bd81a19218a79762c33862df55785075f37d8c71dc8a42097ee43344739a0dd48d03025b0450cf1fb5e8caeb893d9a96d1f15519bb3c4dcb40ee316672ea16c012664f8a9f11255518deb"
|
||||
)
|
||||
|
||||
func ProtonvpnCountryChoices() (choices []string) {
|
||||
servers := ProtonvpnServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Country
|
||||
}
|
||||
return makeChoicesUnique(choices)
|
||||
}
|
||||
|
||||
func ProtonvpnRegionChoices() (choices []string) {
|
||||
servers := ProtonvpnServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Region
|
||||
}
|
||||
return makeChoicesUnique(choices)
|
||||
}
|
||||
|
||||
func ProtonvpnCityChoices() (choices []string) {
|
||||
servers := ProtonvpnServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].City
|
||||
}
|
||||
return makeChoicesUnique(choices)
|
||||
}
|
||||
|
||||
func ProtonvpnNameChoices() (choices []string) {
|
||||
servers := ProtonvpnServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Name
|
||||
}
|
||||
return makeChoicesUnique(choices)
|
||||
}
|
||||
|
||||
func ProtonvpnHostnameChoices() (choices []string) {
|
||||
servers := ProtonvpnServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Hostname
|
||||
}
|
||||
return makeChoicesUnique(choices)
|
||||
}
|
||||
|
||||
// ProtonvpnServers returns a slice of all the server information for Protonvpn.
|
||||
func ProtonvpnServers() (servers []models.ProtonvpnServer) {
|
||||
servers = make([]models.ProtonvpnServer, len(allServers.Protonvpn.Servers))
|
||||
copy(servers, allServers.Protonvpn.Servers)
|
||||
return servers
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
package constants
|
||||
|
||||
import (
|
||||
"net"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
)
|
||||
|
||||
@@ -20,7 +18,7 @@ func PurevpnRegionChoices() (choices []string) {
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Region
|
||||
}
|
||||
return choices
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
func PurevpnCountryChoices() (choices []string) {
|
||||
@@ -29,7 +27,7 @@ func PurevpnCountryChoices() (choices []string) {
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Country
|
||||
}
|
||||
return choices
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
func PurevpnCityChoices() (choices []string) {
|
||||
@@ -38,49 +36,21 @@ func PurevpnCityChoices() (choices []string) {
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].City
|
||||
}
|
||||
return choices
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
//nolint:lll
|
||||
func PurevpnServers() []models.PurevpnServer {
|
||||
return []models.PurevpnServer{
|
||||
{Country: "Australia", Region: "New South Wales", City: "Sydney", IPs: []net.IP{{192, 253, 241, 4}, {43, 245, 161, 84}}},
|
||||
{Country: "Australia", Region: "Western Australia", City: "Perth", IPs: []net.IP{{172, 94, 123, 4}}},
|
||||
{Country: "Austria", Region: "Lower Austria", City: "Langenzersdorf", IPs: []net.IP{{172, 94, 109, 4}}},
|
||||
{Country: "Austria", Region: "Vienna", City: "Vienna", IPs: []net.IP{{217, 64, 127, 251}}},
|
||||
{Country: "Belgium", Region: "Flanders", City: "Zaventem", IPs: []net.IP{{172, 111, 223, 4}}},
|
||||
{Country: "Bulgaria", Region: "Sofia-Capital", City: "Sofia", IPs: []net.IP{{217, 138, 221, 121}}},
|
||||
{Country: "Canada", Region: "Alberta", City: "Calgary", IPs: []net.IP{{172, 94, 34, 4}}},
|
||||
{Country: "Canada", Region: "Ontario", City: "Toronto", IPs: []net.IP{{104, 200, 138, 196}}},
|
||||
{Country: "France", Region: "Île-de-France", City: "Paris", IPs: []net.IP{{89, 40, 183, 178}}},
|
||||
{Country: "Germany", Region: "Hesse", City: "Frankfurt am Main", IPs: []net.IP{{82, 102, 16, 110}}},
|
||||
{Country: "Greece", Region: "Central Macedonia", City: "Thessaloníki", IPs: []net.IP{{178, 21, 169, 244}}},
|
||||
{Country: "Hong Kong", Region: "Central and Western", City: "Hong Kong", IPs: []net.IP{{103, 109, 103, 60}, {43, 226, 231, 4}}},
|
||||
{Country: "Hong Kong", Region: "Kowloon City", City: "Kowloon", IPs: []net.IP{{36, 255, 97, 3}}},
|
||||
{Country: "Italy", Region: "Trentino-Alto Adige", City: "Trento", IPs: []net.IP{{172, 111, 173, 3}}},
|
||||
{Country: "Japan", Region: "Ōsaka", City: "Osaka", IPs: []net.IP{{172, 94, 56, 4}}},
|
||||
{Country: "Malaysia", Region: "Kuala Lumpur", City: "Kuala Lumpur", IPs: []net.IP{{103, 55, 10, 133}}},
|
||||
{Country: "Netherlands", Region: "North Holland", City: "Amsterdam", IPs: []net.IP{{79, 142, 64, 51}}},
|
||||
{Country: "Norway", Region: "Oslo", City: "Oslo", IPs: []net.IP{{82, 102, 22, 212}}},
|
||||
{Country: "Poland", Region: "Mazovia", City: "Warsaw", IPs: []net.IP{{5, 253, 206, 251}}},
|
||||
{Country: "Portugal", Region: "Lisbon", City: "Lisbon", IPs: []net.IP{{5, 154, 174, 3}}},
|
||||
{Country: "Russian Federation", Region: "Moscow", City: "Moscow", IPs: []net.IP{{206, 123, 139, 4}}},
|
||||
{Country: "Singapore", Region: "Singapore", City: "Singapore", IPs: []net.IP{{37, 120, 208, 147}, {129, 227, 107, 242}}},
|
||||
{Country: "South Africa", Region: "Gauteng", City: "Johannesburg", IPs: []net.IP{{102, 165, 3, 34}}},
|
||||
{Country: "Spain", Region: "Madrid", City: "Madrid", IPs: []net.IP{{217, 138, 218, 210}}},
|
||||
{Country: "Sweden", Region: "Stockholm", City: "Kista", IPs: []net.IP{{172, 111, 246, 4}}},
|
||||
{Country: "Switzerland", Region: "Zurich", City: "Zürich", IPs: []net.IP{{45, 12, 222, 106}}},
|
||||
{Country: "Taiwan", Region: "Taiwan", City: "Taipei", IPs: []net.IP{{128, 1, 155, 178}}},
|
||||
{Country: "United Kingdom", Region: "England", City: "Birmingham", IPs: []net.IP{{188, 72, 89, 4}}},
|
||||
{Country: "United Kingdom", Region: "England", City: "London", IPs: []net.IP{{193, 9, 113, 70}, {104, 37, 6, 4}, {45, 141, 154, 189}}},
|
||||
{Country: "United States", Region: "Arkansas", City: "Hot Springs", IPs: []net.IP{{172, 111, 147, 4}}},
|
||||
{Country: "United States", Region: "Florida", City: "Miami", IPs: []net.IP{{86, 106, 87, 178}}},
|
||||
{Country: "United States", Region: "Illinois", City: "Lincolnshire", IPs: []net.IP{{141, 101, 149, 4}, {141, 101, 149, 4}, {141, 101, 149, 4}, {141, 101, 149, 4}}},
|
||||
{Country: "United States", Region: "Massachusetts", City: "Newton", IPs: []net.IP{{104, 243, 244, 2}}},
|
||||
{Country: "United States", Region: "New Mexico", City: "Rio Rancho", IPs: []net.IP{{104, 243, 243, 131}}},
|
||||
{Country: "United States", Region: "New York", City: "New York City", IPs: []net.IP{{172, 111, 149, 4}}},
|
||||
{Country: "United States", Region: "Texas", City: "Dallas", IPs: []net.IP{{172, 94, 1, 4}, {172, 94, 1, 4}, {172, 94, 1, 4}, {172, 94, 1, 4}, {172, 94, 1, 4}, {172, 94, 1, 4}, {208, 84, 155, 104}}},
|
||||
{Country: "United States", Region: "Virginia", City: "Reston", IPs: []net.IP{{5, 254, 77, 27}}},
|
||||
{Country: "Vietnam", Region: "Ho Chi Minh", City: "Ho Chi Minh City", IPs: []net.IP{{192, 253, 249, 132}}},
|
||||
func PurevpnHostnameChoices() (choices []string) {
|
||||
servers := PurevpnServers()
|
||||
choices = make([]string, len(servers))
|
||||
for i := range servers {
|
||||
choices[i] = servers[i].Hostname
|
||||
}
|
||||
return makeUnique(choices)
|
||||
}
|
||||
|
||||
// PurevpnServers returns a slice of all the server information for Purevpn.
|
||||
func PurevpnServers() (servers []models.PurevpnServer) {
|
||||
servers = make([]models.PurevpnServer, len(allServers.Purevpn.Servers))
|
||||
copy(servers, allServers.Purevpn.Servers)
|
||||
return servers
|
||||
}
|
||||
|
||||
@@ -1,55 +1,34 @@
|
||||
package constants
|
||||
|
||||
import "github.com/qdm12/gluetun/internal/models"
|
||||
import (
|
||||
"embed"
|
||||
"encoding/json"
|
||||
"sync"
|
||||
|
||||
func GetAllServers() (allServers models.AllServers) {
|
||||
//nolint:gomnd
|
||||
return models.AllServers{
|
||||
Version: 1, // used for migration of the top level scheme
|
||||
Cyberghost: models.CyberghostServers{
|
||||
Version: 1, // model version
|
||||
Timestamp: 1612031135, // latest takes precedence
|
||||
Servers: CyberghostServers(),
|
||||
},
|
||||
Mullvad: models.MullvadServers{
|
||||
Version: 1,
|
||||
Timestamp: 1612031135,
|
||||
Servers: MullvadServers(),
|
||||
},
|
||||
Nordvpn: models.NordvpnServers{
|
||||
Version: 1,
|
||||
Timestamp: 1611096594,
|
||||
Servers: NordvpnServers(),
|
||||
},
|
||||
Pia: models.PiaServers{
|
||||
Version: 3,
|
||||
Timestamp: 1611877630,
|
||||
Servers: PIAServers(),
|
||||
},
|
||||
Purevpn: models.PurevpnServers{
|
||||
Version: 1,
|
||||
Timestamp: 1612031135,
|
||||
Servers: PurevpnServers(),
|
||||
},
|
||||
Privado: models.PrivadoServers{
|
||||
Version: 2,
|
||||
Timestamp: 1612031135,
|
||||
Servers: PrivadoServers(),
|
||||
},
|
||||
Surfshark: models.SurfsharkServers{
|
||||
Version: 1,
|
||||
Timestamp: 1612031135,
|
||||
Servers: SurfsharkServers(),
|
||||
},
|
||||
Vyprvpn: models.VyprvpnServers{
|
||||
Version: 1,
|
||||
Timestamp: 1612031135,
|
||||
Servers: VyprvpnServers(),
|
||||
},
|
||||
Windscribe: models.WindscribeServers{
|
||||
Version: 2,
|
||||
Timestamp: 1612031135,
|
||||
Servers: WindscribeServers(),
|
||||
},
|
||||
}
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
)
|
||||
|
||||
//go:embed servers.json
|
||||
var allServersEmbedFS embed.FS //nolint:gochecknoglobals
|
||||
var allServers models.AllServers //nolint:gochecknoglobals
|
||||
var parseOnce sync.Once //nolint:gochecknoglobals
|
||||
|
||||
func init() { //nolint:gochecknoinits
|
||||
// error returned covered by unit test
|
||||
parseOnce.Do(func() { allServers, _ = parseAllServers() })
|
||||
}
|
||||
|
||||
func parseAllServers() (allServers models.AllServers, err error) {
|
||||
f, err := allServersEmbedFS.Open("servers.json")
|
||||
if err != nil {
|
||||
return allServers, err
|
||||
}
|
||||
decoder := json.NewDecoder(f)
|
||||
err = decoder.Decode(&allServers)
|
||||
return allServers, err
|
||||
}
|
||||
|
||||
func GetAllServers() models.AllServers {
|
||||
parseOnce.Do(func() { allServers, _ = parseAllServers() }) // init did not execute, used in tests
|
||||
return allServers
|
||||
}
|
||||
|
||||
108072
internal/constants/servers.json
Normal file
108072
internal/constants/servers.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -9,9 +9,20 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func Test_parseAllServers(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
servers, err := parseAllServers()
|
||||
|
||||
require.NoError(t, err)
|
||||
require.NotEmpty(t, len(servers.Cyberghost.Servers))
|
||||
}
|
||||
|
||||
func digestServerModelVersion(t *testing.T, server interface{}, version uint16) string {
|
||||
t.Helper()
|
||||
bytes, err := json.Marshal(server)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -37,47 +48,87 @@ func Test_versions(t *testing.T) {
|
||||
"Cyberghost": {
|
||||
model: models.CyberghostServer{},
|
||||
version: allServers.Cyberghost.Version,
|
||||
digest: "fd6242bb",
|
||||
digest: "229828de",
|
||||
},
|
||||
"Fastestvpn": {
|
||||
model: models.FastestvpnServer{},
|
||||
version: allServers.Fastestvpn.Version,
|
||||
digest: "8825919b",
|
||||
},
|
||||
"HideMyAss": {
|
||||
model: models.HideMyAssServer{},
|
||||
version: allServers.HideMyAss.Version,
|
||||
digest: "a93b4057",
|
||||
},
|
||||
"Ipvanish": {
|
||||
model: models.IpvanishServer{},
|
||||
version: allServers.Ipvanish.Version,
|
||||
digest: "2eb80d28",
|
||||
},
|
||||
"Ivpn": {
|
||||
model: models.IvpnServer{},
|
||||
version: allServers.Ivpn.Version,
|
||||
digest: "2eb80d28",
|
||||
},
|
||||
"Mullvad": {
|
||||
model: models.MullvadServer{},
|
||||
version: allServers.Mullvad.Version,
|
||||
digest: "665e9dc1",
|
||||
digest: "2a009192",
|
||||
},
|
||||
"Nordvpn": {
|
||||
model: models.NordvpnServer{},
|
||||
version: allServers.Nordvpn.Version,
|
||||
digest: "040de8d0",
|
||||
},
|
||||
"Private Internet Access": {
|
||||
model: models.PIAServer{},
|
||||
version: allServers.Pia.Version,
|
||||
digest: "b90147aa",
|
||||
digest: "a3b5d609",
|
||||
},
|
||||
"Privado": {
|
||||
model: models.PrivadoServer{},
|
||||
version: allServers.Privado.Version,
|
||||
digest: "1d5aeb23",
|
||||
digest: "dba6736c",
|
||||
},
|
||||
"Private Internet Access": {
|
||||
model: models.PIAServer{},
|
||||
version: allServers.Pia.Version,
|
||||
digest: "91db9bc9",
|
||||
},
|
||||
"Privatevpn": {
|
||||
model: models.PrivatevpnServer{},
|
||||
version: allServers.Privatevpn.Version,
|
||||
digest: "cba13d78",
|
||||
},
|
||||
"Protonvpn": {
|
||||
model: models.ProtonvpnServer{},
|
||||
version: allServers.Protonvpn.Version,
|
||||
digest: "b964085b",
|
||||
},
|
||||
"Purevpn": {
|
||||
model: models.PurevpnServer{},
|
||||
version: allServers.Purevpn.Version,
|
||||
digest: "ada45379",
|
||||
digest: "23f2d422",
|
||||
},
|
||||
"Surfshark": {
|
||||
model: models.SurfsharkServer{},
|
||||
version: allServers.Surfshark.Version,
|
||||
digest: "042bef64",
|
||||
digest: "58de06d8",
|
||||
},
|
||||
"Torguard": {
|
||||
model: models.TorguardServer{},
|
||||
version: allServers.Torguard.Version,
|
||||
digest: "6eb9028e",
|
||||
},
|
||||
"VPN Unlimited": {
|
||||
model: models.VPNUnlimitedServer{},
|
||||
version: allServers.VPNUnlimited.Version,
|
||||
digest: "5cb51319",
|
||||
},
|
||||
"Vyprvpn": {
|
||||
model: models.VyprvpnServer{},
|
||||
version: allServers.Vyprvpn.Version,
|
||||
digest: "042bef64",
|
||||
digest: "58de06d8",
|
||||
},
|
||||
"Windscribe": {
|
||||
model: models.WindscribeServer{},
|
||||
version: allServers.Windscribe.Version,
|
||||
digest: "6e3ca639",
|
||||
digest: "6f6c16d6",
|
||||
},
|
||||
}
|
||||
for name, testCase := range testCases {
|
||||
@@ -91,84 +142,3 @@ func Test_versions(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func digestServersTimestamp(t *testing.T, servers interface{}, timestamp int64) string {
|
||||
bytes, err := json.Marshal(servers)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
bytes = append(bytes, []byte(fmt.Sprintf("%d", timestamp))...)
|
||||
arr := sha256.Sum256(bytes)
|
||||
hexString := hex.EncodeToString(arr[:])
|
||||
if len(hexString) > 8 {
|
||||
hexString = hexString[:8]
|
||||
}
|
||||
return hexString
|
||||
}
|
||||
|
||||
func Test_timestamps(t *testing.T) {
|
||||
t.Parallel()
|
||||
allServers := GetAllServers()
|
||||
const format = "you forgot to update the timestamp for %s"
|
||||
testCases := map[string]struct {
|
||||
servers interface{}
|
||||
timestamp int64
|
||||
digest string
|
||||
}{
|
||||
"Cyberghost": {
|
||||
servers: allServers.Cyberghost.Servers,
|
||||
timestamp: allServers.Cyberghost.Timestamp,
|
||||
digest: "5d3a8cbf",
|
||||
},
|
||||
"Mullvad": {
|
||||
servers: allServers.Mullvad.Servers,
|
||||
timestamp: allServers.Mullvad.Timestamp,
|
||||
digest: "e2e006cf",
|
||||
},
|
||||
"Nordvpn": {
|
||||
servers: allServers.Nordvpn.Servers,
|
||||
timestamp: allServers.Nordvpn.Timestamp,
|
||||
digest: "2296312c",
|
||||
},
|
||||
"Private Internet Access": {
|
||||
servers: allServers.Pia.Servers,
|
||||
timestamp: allServers.Pia.Timestamp,
|
||||
digest: "1d2938a1",
|
||||
},
|
||||
"Purevpn": {
|
||||
servers: allServers.Purevpn.Servers,
|
||||
timestamp: allServers.Purevpn.Timestamp,
|
||||
digest: "cd19edf5",
|
||||
},
|
||||
"Privado": {
|
||||
servers: allServers.Privado.Servers,
|
||||
timestamp: allServers.Privado.Timestamp,
|
||||
digest: "2ac55360",
|
||||
},
|
||||
"Surfshark": {
|
||||
servers: allServers.Surfshark.Servers,
|
||||
timestamp: allServers.Surfshark.Timestamp,
|
||||
digest: "1a7f38bb",
|
||||
},
|
||||
"Vyprvpn": {
|
||||
servers: allServers.Vyprvpn.Servers,
|
||||
timestamp: allServers.Vyprvpn.Timestamp,
|
||||
digest: "1753d4f8",
|
||||
},
|
||||
"Windscribe": {
|
||||
servers: allServers.Windscribe.Servers,
|
||||
timestamp: allServers.Windscribe.Timestamp,
|
||||
digest: "4e719aa3",
|
||||
},
|
||||
}
|
||||
for name, testCase := range testCases {
|
||||
name := name
|
||||
testCase := testCase
|
||||
t.Run(name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
digest := digestServersTimestamp(t, testCase.servers, testCase.timestamp)
|
||||
failureMessage := fmt.Sprintf(format, name)
|
||||
assert.Equal(t, testCase.digest, digest, failureMessage)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package constants
|
||||
|
||||
const (
|
||||
// Announcement is a message announcement.
|
||||
Announcement = "New Docker image qmcgaw/gluetun"
|
||||
// AnnouncementExpiration is the expiration date of the announcement in format yyyy-mm-dd.
|
||||
AnnouncementExpiration = "2021-01-20"
|
||||
)
|
||||
|
||||
const (
|
||||
// IssueLink is the link for users to use to create issues.
|
||||
IssueLink = "https://github.com/qdm12/gluetun/issues/new"
|
||||
)
|
||||
@@ -1,17 +0,0 @@
|
||||
package constants
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func Test_AnnouncementExpiration(t *testing.T) {
|
||||
t.Parallel()
|
||||
if len(AnnouncementExpiration) == 0 {
|
||||
return
|
||||
}
|
||||
_, err := time.Parse("2006-01-02", AnnouncementExpiration)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user