mirror of
https://github.com/qdm12/gluetun.git
synced 2026-05-06 20:10:11 +02:00
chore(ci): test protonvpn OpenVPN with port forwarding
This commit is contained in:
@@ -78,7 +78,7 @@ jobs:
|
|||||||
github.event_name == 'release' ||
|
github.event_name == 'release' ||
|
||||||
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')
|
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')
|
||||||
)
|
)
|
||||||
needs: [verify]
|
needs: [ verify ]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: secrets
|
environment: secrets
|
||||||
steps:
|
steps:
|
||||||
@@ -95,13 +95,20 @@ jobs:
|
|||||||
run: go build -C ./ci -o runner ./cmd/main.go
|
run: go build -C ./ci -o runner ./cmd/main.go
|
||||||
|
|
||||||
- name: Run Gluetun container with Mullvad configuration
|
- name: Run Gluetun container with Mullvad configuration
|
||||||
run: echo -e "${{ secrets.MULLVAD_WIREGUARD_PRIVATE_KEY }}\n${{ secrets.MULLVAD_WIREGUARD_ADDRESS }}" | ./ci/runner mullvad
|
run: echo -e "${{ secrets.MULLVAD_WIREGUARD_PRIVATE_KEY }}\n${{
|
||||||
|
secrets.MULLVAD_WIREGUARD_ADDRESS }}" | ./ci/runner mullvad
|
||||||
|
|
||||||
- name: Run Gluetun container with ProtonVPN Wireguard and port forwarding
|
- name: Run Gluetun container with ProtonVPN Wireguard and port forwarding
|
||||||
configuration
|
configuration
|
||||||
run: echo -e "${{ secrets.PROTONVPN_WIREGUARD_PRIVATE_KEY }}" | ./ci/runner
|
run: echo -e "${{ secrets.PROTONVPN_WIREGUARD_PRIVATE_KEY }}" | ./ci/runner
|
||||||
protonvpn-wireguard-port-forwarding
|
protonvpn-wireguard-port-forwarding
|
||||||
|
|
||||||
|
- name: Run Gluetun container with ProtonVPN OpenVPN and port forwarding
|
||||||
|
configuration
|
||||||
|
run: echo -e "${{ secrets.PROTONVPN_OPENVPN_USER }}\n${{
|
||||||
|
secrets.PROTONVPN_OPENVPN_PASSWORD }}" | ./ci/runner
|
||||||
|
protonvpn-openvpn-port-forwarding
|
||||||
|
|
||||||
codeql:
|
codeql:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
@@ -127,7 +134,7 @@ jobs:
|
|||||||
github.event_name == 'release' ||
|
github.event_name == 'release' ||
|
||||||
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')
|
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')
|
||||||
)
|
)
|
||||||
needs: [verify, verify-private, codeql]
|
needs: [ verify, verify-private, codeql ]
|
||||||
permissions:
|
permissions:
|
||||||
actions: read
|
actions: read
|
||||||
contents: read
|
contents: read
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ func main() {
|
|||||||
err = internal.MullvadTest(ctx, logger)
|
err = internal.MullvadTest(ctx, logger)
|
||||||
case "protonvpn-wireguard-port-forwarding":
|
case "protonvpn-wireguard-port-forwarding":
|
||||||
err = internal.ProtonVPNWireguardPortForwardingTest(ctx, logger)
|
err = internal.ProtonVPNWireguardPortForwardingTest(ctx, logger)
|
||||||
|
case "protonvpn-openvpn-port-forwarding":
|
||||||
|
err = internal.ProtonVPNOpenVPNPortForwardingTest(ctx, logger)
|
||||||
default:
|
default:
|
||||||
err = fmt.Errorf("unknown command: %s", os.Args[1])
|
err = fmt.Errorf("unknown command: %s", os.Args[1])
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,3 +27,26 @@ func ProtonVPNWireguardPortForwardingTest(ctx context.Context, logger Logger) er
|
|||||||
const timeout = 80 * time.Second
|
const timeout = 80 * time.Second
|
||||||
return runContainerTest(ctx, env, []*regexp.Regexp{successRegexp, portForwardingRegexp}, timeout, logger)
|
return runContainerTest(ctx, env, []*regexp.Regexp{successRegexp, portForwardingRegexp}, timeout, logger)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ProtonVPNOpenVPNPortForwardingTest(ctx context.Context, logger Logger) error {
|
||||||
|
expectedSecrets := []string{
|
||||||
|
"OpenVPN username",
|
||||||
|
"OpenVPN password",
|
||||||
|
}
|
||||||
|
secrets, err := readSecrets(ctx, expectedSecrets, logger)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("reading secrets: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
env := []string{
|
||||||
|
"VPN_SERVICE_PROVIDER=protonvpn",
|
||||||
|
"VPN_TYPE=openvpn",
|
||||||
|
"LOG_LEVEL=debug",
|
||||||
|
"SERVER_COUNTRIES=United States",
|
||||||
|
"OPENVPN_USER=" + secrets[0],
|
||||||
|
"OPENVPN_PASSWORD=" + secrets[1],
|
||||||
|
"VPN_PORT_FORWARDING=on",
|
||||||
|
}
|
||||||
|
const timeout = 80 * time.Second
|
||||||
|
return runContainerTest(ctx, env, []*regexp.Regexp{successRegexp, portForwardingRegexp}, timeout, logger)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user