From 7ad2852d13ca4e362a9165f78d813a7f6ad5e36c Mon Sep 17 00:00:00 2001 From: meftimes Date: Tue, 5 Dec 2023 18:40:26 -0500 Subject: [PATCH] wireguard protonvpn port auto-updater --- gluetun-transmission-chromium/.env | 8 +++++-- .../gluetun-transmission-chromium.yml | 14 ++++------- .../transmission-port.sh | 24 +++++++++++++++++++ 3 files changed, 34 insertions(+), 12 deletions(-) create mode 100755 gluetun-transmission-chromium/transmission-port.sh diff --git a/gluetun-transmission-chromium/.env b/gluetun-transmission-chromium/.env index 6aa57e2..44fb00c 100644 --- a/gluetun-transmission-chromium/.env +++ b/gluetun-transmission-chromium/.env @@ -1,2 +1,6 @@ -WIREGUARD_PRIVATE_KEY=private_key_goes_here_see_https://github.com/qdm12/gluetun-wiki/blob/main/setup/providers/mullvad.md -WIREGUARD_ADDRESSES=addresses_go_here +VPN_ENDPOINT_IP=from-wireguard-conf-file +VPN_ENDPOINT_PORT=from-wireguard-conf-file +WIREGUARD_PUBLIC_KEY=from-wireguard-conf-file +WIREGUARD_PRIVATE_KEY=from-wireguard-conf-file +WIREGUARD_ADDRESSES=from-wireguard-conf-file + diff --git a/gluetun-transmission-chromium/gluetun-transmission-chromium.yml b/gluetun-transmission-chromium/gluetun-transmission-chromium.yml index 1ad6e92..d91adf4 100644 --- a/gluetun-transmission-chromium/gluetun-transmission-chromium.yml +++ b/gluetun-transmission-chromium/gluetun-transmission-chromium.yml @@ -7,13 +7,12 @@ services: cap_add: - NET_ADMIN ports: - - 40605:40605 # transmission - - 40605:40605/udp # transmission - 3000:3000 # chromium environment: - - VPN_SERVICE_PROVIDER=mullvad + - VPN_SERVICE_PROVIDER=custom - VPN_TYPE=wireguard - - SERVER_CITIES=Toronto + - VPN_PORT_FORWARDING=on + - VPN_PORT_FORWARDING_PROVIDER=protonvpn env_file: - .env restart: unless-stopped @@ -27,15 +26,10 @@ services: - PUID=1001 - PGID=1001 - TZ=America/New_York - - PEERPORT=40605 volumes: - /home/meftimes/docker/gluetun-transmission-chromium/transmission-config:/config - /home/meftimes/docker/transmission/downloads:/downloads - /home/meftimes/docker/gluetun-transmission-chromium/watch:/watch - # ports: - # - 9091:9091 - # - 40605:40605 - # - 40605:40605/udp labels: - "traefik.enable=true" - "traefik.passHostHeader=true" @@ -51,7 +45,7 @@ services: restart: unless-stopped chromium: - image: linuxserver/chromium:latest + image: linuxserver/chromium container_name: chromium security_opt: - seccomp:unconfined #optional diff --git a/gluetun-transmission-chromium/transmission-port.sh b/gluetun-transmission-chromium/transmission-port.sh new file mode 100755 index 0000000..9e5358f --- /dev/null +++ b/gluetun-transmission-chromium/transmission-port.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +#Requires systemd unit (transmission.service) to run on boot +# +#[Unit] +#Description=Script +# +#[Service] +#ExecStart=/usr/bin/transmission-port.sh +#User=meftimes +#Group=meftimes +# +#[Install] +#WantedBy=multi-user.target + +# Make executable and move to /usr/bin/ +sleep 10 +docker stop transmission +sleep 10 +sed -i "/\"peer-port\"/c\ \"peer-port\": $(docker exec gluetun cat /tmp/gluetun/forwarded_port)," /home/meftimes/docker/gluetun-transmission-chromium/transmission-config/settings.json +sleep 10 +docker start transmission +sleep 10 +docker restart chromium