diff --git a/.env.sample b/.env.sample index d43ccc5..b81d404 100644 --- a/.env.sample +++ b/.env.sample @@ -6,3 +6,7 @@ DOMAIN=qbit.example.com #EXTRA_DOMAINS=', `www.qbit.example.com`' 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" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5807599 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM linuxserver/qbittorrent:latest + +RUN apk update && apk upgrade +RUN apk add \ + wireguard-tools \ + ip6tables \ + vim diff --git a/README.md b/README.md index 76c2b65..84825fd 100644 --- a/README.md +++ b/README.md @@ -22,3 +22,10 @@ * `abra app deploy ` For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech). + +## VPN + +* Save wireguard config file in a file named vpn.conf +* `abra app cp 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. \ No newline at end of file diff --git a/abra.sh b/abra.sh new file mode 100644 index 0000000..2506715 --- /dev/null +++ b/abra.sh @@ -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 +} diff --git a/compose.vpn.yml b/compose.vpn.yml new file mode 100644 index 0000000..655567d --- /dev/null +++ b/compose.vpn.yml @@ -0,0 +1,7 @@ +--- +version: "3.8" + +services: + app: + cap_add: + - ALL \ No newline at end of file diff --git a/compose.yml b/compose.yml index 35cc089..c397a77 100644 --- a/compose.yml +++ b/compose.yml @@ -3,7 +3,7 @@ version: "3.8" services: app: - image: lscr.io/linuxserver/qbittorrent:5.0.2-r0-ls366 + image: git.coopcloud.tech/ammaratef45/qbit-vpn:0.1.1 networks: - proxy deploy: