MISSION COMPLETED
After a long and painful journey in finding the solution, I found it:
version: '2'
services:
transmission:
image: haugene/transmission-openvpn:latest-armhf
container_name: vpntrans
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun
restart: unless-stopped
ports:
- 9093:9091
# - 8888:8888
# dns:
# - 1.1.1.1
#sysctls:
# - net.ipv6.conf.all.disable_ipv6=1
volumes:
- /etc/localtime:/etc/localtime:ro
- /sharedfolders/:/data
- /sharedfolders/appdata/vpntrans:/config
environment:
- OPENVPN_PROVIDER=xxxxxx
- OPENVPN_CONFIG=xxxxxx
- OPENVPN_USERNAME=xxxxxx
- OPENVPN_PASSWORD=xxxxxx
- OPENVPN_OPTS=--inactive 3600 --ping 10 --ping-exit 60
- LOCAL_NETWORK=192.168.0.0/24 10.8.0.0/24
- WEBPROXY_ENABLED=false
- TRANSMISSION_PORT_FORWARDING_ENABLED=true
- TRANSMISSION_PEER_PORT=51414
- PUID=1000
- PGID=100
- TRANSMISSION_WATCH_DIR=/data/torrent/watch
- TRANSMISSION_WATCH_DIR_ENABLED=true
- TRANSMISSION_RPC_AUTHENTICATION_REQUIRED=true
- TRANSMISSION_RPC_USERNAME=xxxxxxxxxxxx
- TRANSMISSION_RPC_PASSWORD=xxxxxxxxxxxx
- TRANSMISSION_RPC_PORT=9091
- TRANSMISSION_INCOMPLETE_DIR_ENABLED=false
- TRANSMISSION_DOWNLOAD_DIR=/data/video
- TRANSMISSION_PEER_LIMIT_GLOBAL=500
- TRANSMISSION_ALT_SPEED_DOWN=2400000
- TRANSMISSION_ALT_SPEED_UP=4000
- TRANSMISSION_ALT_SPEED_TIME_ENABLED=true
- TRANSMISSION_ALT_SPEED_TIME_BEGIN=630
- TRANSMISSION_ALT_SPEED_TIME_DAY=0
- TRANSMISSION_ALT_SPEED_TIME_END=1650
- TRANSMISSION_SPEED_LIMIT_DOWN_ENABLED=true
- TRANSMISSION_SPEED_LIMIT_DOWN=80000
- TRANSMISSION_SPEED_LIMIT_UP_ENABLED=true
- TRANSMISSION_SPEED_LIMIT_UP=1
- TRANSMISSION_HOME=/data/appdata/transmissionovpn
# - TRANSMISSION_WEB_HOME=/data/appdata/transmissionovpn/ui
- TRANSMISSION_WEB_UI=transmission-web-control
# - HEALTH_CHECK_HOST=google.com
Display More
Multiple LOCAL_NETWORKs could be added with e.g. LOCAL_NETWORK=192.168.0.0/24 10.8.0.0/24 (separated with spaces).
New, better UI could be applied with TRANSMISSION_WEB_UI=transmission-web-control
If somewhy it doesn't work just stop your VPN Server with systemctl stop openvpn@server. Then start the container/stack. In the end, you can use systemctl status openvpn@server to check or systemctl start openvpn@server to start VPN Server again. (Exit with q)
Anyone can use this config, just please, customize it before running! I have several options, ports reconfigured and your IP address may be different.
Special thanks for sabamimi who helped me even when I was silly. Some parts of this code belongs to them.
P.S: Use stacks, they're cool.