add support for vpn using wireguard
This commit is contained in:
parent
94e777f311
commit
be6f480fc9
@ -6,3 +6,7 @@ DOMAIN=qbit.example.com
|
|||||||
#EXTRA_DOMAINS=', `www.qbit.example.com`'
|
#EXTRA_DOMAINS=', `www.qbit.example.com`'
|
||||||
|
|
||||||
LETS_ENCRYPT_ENV=production
|
LETS_ENCRYPT_ENV=production
|
||||||
|
|
||||||
|
COMPOSE_FILE="compose.yml"
|
||||||
|
# Be careful, uncommenting the line below runs the container in privileged mode
|
||||||
|
# COMPOSE_FILE="$COMPOSE_FILE:compose.vpn.yml"
|
||||||
|
7
Dockerfile
Normal file
7
Dockerfile
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
FROM linuxserver/qbittorrent:latest
|
||||||
|
|
||||||
|
RUN apk update && apk upgrade
|
||||||
|
RUN apk add \
|
||||||
|
wireguard-tools \
|
||||||
|
ip6tables \
|
||||||
|
vim
|
@ -22,3 +22,10 @@
|
|||||||
* `abra app deploy <app-name>`
|
* `abra app deploy <app-name>`
|
||||||
|
|
||||||
For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech).
|
For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech).
|
||||||
|
|
||||||
|
## VPN
|
||||||
|
|
||||||
|
* Save wireguard config file in a file named vpn.conf
|
||||||
|
* `abra app cp <app-name> vpn.conf app:/etc/wireguard/vpn.conf`
|
||||||
|
* `abra app cmd qbit.ammaratef45.ddns.net app setup_vpn` (this will also start the vpn)
|
||||||
|
* `start_vpn`, `stop_vpn`, `vpn_status`, and `container_ip` functions commands can be used to manage the vpn connection.
|
23
abra.sh
Normal file
23
abra.sh
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
setup_vpn() {
|
||||||
|
wgScript=`which wg-quick`
|
||||||
|
sed -i '/sysctl -q net.ipv4.conf.all.src_valid_mark=1/d' $wgScript
|
||||||
|
start_vpn
|
||||||
|
}
|
||||||
|
|
||||||
|
start_vpn() {
|
||||||
|
wg-quick up vpn
|
||||||
|
}
|
||||||
|
|
||||||
|
stop_vpn() {
|
||||||
|
wg-quick down vpn
|
||||||
|
}
|
||||||
|
|
||||||
|
vpn_status() {
|
||||||
|
wg
|
||||||
|
}
|
||||||
|
|
||||||
|
container_ip() {
|
||||||
|
curl ifconfig.me
|
||||||
|
}
|
7
compose.vpn.yml
Normal file
7
compose.vpn.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
version: "3.8"
|
||||||
|
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
cap_add:
|
||||||
|
- ALL
|
@ -3,7 +3,7 @@ version: "3.8"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: lscr.io/linuxserver/qbittorrent:5.0.2-r0-ls366
|
image: git.coopcloud.tech/ammaratef45/qbit-vpn:0.1.1
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
- proxy
|
||||||
deploy:
|
deploy:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user