Updated: to new wireguard option without the use of the scripts

From Torguard Mail on July:
TorGuard’s Stable Peers API Update for External Wireguard Clients:
Good news - we have now updated our wireguard API to prevent the 24hr config expiration on third party clients - all new configs generated using our config generator from now on will now stay active for the time your account has an active subscription.
pull/317/head
TRaSH 3 years ago
parent a39b1f171a
commit 05cbe647bd

@ -195,64 +195,6 @@ Choose your preferred VPN Tunnel type.
Rename the file from `*.conf` to `wg0.conf` and copy it to your wireguard folder of your VPN torrent client.
Before we can make use of it you will need to edit the `wg0.conf` file first and add the following at line 7.
```bash
PreUp = bash /config/wireguard/torguard.sh
```
Your wg0.conf should look something like this:
```shell linenums="1"
# TorGuard WireGuard Config
[Interface]
PrivateKey = secretprivatekey
ListenPort = 51820
DNS = 1.1.1.1
Address = xx.xx.xxx.xx/24
PreUp = bash /config/wireguard/torguard.sh
[Peer]
PublicKey = publickey
AllowedIPs = 0.0.0.0/0
Endpoint = xx.xxx.xx.xxx:1443
PersistentKeepalive = 25
```
Then you will need to create a bash script in your `/config/wireguard` of your torrent client appdata folder named `torguard.sh` (*This script will get executed just before starting WireGuard*) with the following info it depending which images you're using.
##### Hotio's VPN Containers
??? example "Hotio's VPN Containers"
```bash
#!/usr/bin/bash
pubkey=$(grep PrivateKey "${CONFIG_DIR}/wireguard/wg0.conf" | awk '{print $3}' | wg pubkey)
wgserver=$(grep Endpoint "${CONFIG_DIR}/wireguard/wg0.conf" | awk '{print $3}')
curl -ksG -u "${TORGUARD_USER}":"${TORGUARD_PASS}" \
--data-urlencode "public-key=${pubkey}" "https://${wgserver}/api/v1/setup"
```
You will also have to add the additional environment variables `TORGUARD_USER` and `TORGUARD_PASS` or fill them in into the script directly (see curl command). These credentials are the ones we created [HERE](#create-a-user-account).
##### Binhex VPN Containers
??? example "Binhex VPN Containers"
```bash
#!/usr/bin/bash
pubkey=$(grep PrivateKey "config/wireguard/wg0.conf" | awk '{print $3}' | wg pubkey)
wgserver=$(grep Endpoint "config/wireguard/wg0.conf" | awk '{print $3}')
curl -ksG -u "${VPN_USER}":"${VPN_PASS}" \
--data-urlencode "public-key=${pubkey}" "https://${wgserver}/api/v1/setup"
```
You will also have to add the additional environment variables `VPN_USER` and `VPN_PASS or fill them in into the script directly (see curl command). These credentials are the ones we created [HERE](#create-a-user-account).
------
THNX:

Loading…
Cancel
Save