Add aria2 and readme.

This commit is contained in:
redxef 2021-08-07 20:09:36 +02:00
parent acd9008b22
commit e870639b5f
4 changed files with 21 additions and 2 deletions

View file

@ -1,6 +1,6 @@
FROM alpine:latest FROM alpine:latest
RUN apk add bash openvpn openresolv RUN apk add bash openvpn openresolv aria2
ADD https://raw.githubusercontent.com/alfredopalhares/openvpn-update-resolv-conf/master/update-resolv-conf.sh \ ADD https://raw.githubusercontent.com/alfredopalhares/openvpn-update-resolv-conf/master/update-resolv-conf.sh \
/etc/openvpn/update-resolv-conf /etc/openvpn/update-resolv-conf
COPY start-openvpn.sh /usr/local/bin/start-openvpn.sh COPY start-openvpn.sh /usr/local/bin/start-openvpn.sh

7
README.md Normal file
View file

@ -0,0 +1,7 @@
# Openvpn with torrent client
Just add your openvpn configuration `config.ovpn` and the authorization file
`auth.txt` and modify `config.ovpn` to use the auth file: `auth-user-pass /opt/auth.txt`
Next run `./start` to drop into a shell as your user in your home directory.
Now you can use aria2 to download everything over a VPN.

7
start Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env sh
docker-compose run \
-e OVPN_USER="$USER" \
-e OVPN_HOME="$HOME" \
-v "$HOME:$HOME" \
openvpn sh

View file

@ -10,6 +10,11 @@ connect_vpn() {
openvpn --config "$OVPN_CONFIGURATION_FILE" --daemon openvpn --config "$OVPN_CONFIGURATION_FILE" --daemon
} }
switch_user() {
cd "$OVPN_HOME"
su "$OVPN_USER"
}
create_net_dev create_net_dev
connect_vpn connect_vpn
"$@" switch_user