diff --git a/Dockerfile b/Dockerfile
index e6cec95..0a6c505 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -33,22 +33,6 @@ ADD config/nobody/ /home/nobody/
RUN chmod +x /root/*.sh /home/nobody/*.sh /home/nobody/*.py && \
/bin/bash /root/install.sh "${RELEASETAG}" "${TARGETARCH}"
-# docker settings
-#################
-
-# expose port for deluge webui
-EXPOSE 8112
-
-# expose port for privoxy
-EXPOSE 8118
-
-# expose port for deluge daemon (used in conjunction with LAN_NETWORK env var)
-EXPOSE 58846
-
-# expose port for deluge incoming port (used only if VPN_ENABLED=no)
-EXPOSE 58946
-EXPOSE 58946/udp
-
# set permissions
#################
diff --git a/README.md b/README.md
index 6b57c46..784aa96 100644
--- a/README.md
+++ b/README.md
@@ -18,18 +18,21 @@ This Docker includes OpenVPN and WireGuard to ensure a secure and private connec
Latest stable Deluge release from Arch Linux repo.
Latest stable Privoxy release from Arch Linux repo.
+Latest stable microsocks release from GitHub.
Latest stable OpenVPN release from Arch Linux repo.
Latest stable WireGuard release from Arch Linux repo.
## Usage
-```bash
+```text
docker run -d \
--cap-add=NET_ADMIN \
-p 8112:8112 \
-p 8118:8118 \
+ -p 9118:9118 \
-p 58846:58846 \
-p 58946:58946 \
+ -p 58946:58946/udp \
--name= \
-v :/data \
-v :/config \
@@ -73,6 +76,12 @@ Default password for the webui is "deluge"
`http://:8118`
+## Access microsocks
+
+`:9118`
+
+default credentials: admin/socks
+
## PIA example
```bash
@@ -80,8 +89,10 @@ docker run -d \
--cap-add=NET_ADMIN \
-p 8112:8112 \
-p 8118:8118 \
+ -p 9118:9118 \
-p 58846:58846 \
-p 58946:58946 \
+ -p 58946:58946/udp \
--name=delugevpn \
-v /apps/docker/deluge/data:/data \
-v /apps/docker/deluge/config:/config \
@@ -112,10 +123,6 @@ docker run -d \
binhex/arch-delugevpn
```
-## IMPORTANT
-
-Please note `VPN_INPUT_PORTS` is **NOT** to define the incoming port for the VPN, this environment variable is used to define port(s) you want to allow in to the VPN network when network binding multiple containers together, configuring this incorrectly with the VPN provider assigned incoming port COULD result in IP leakage, you have been warned!.
-
## OpenVPN
Please note this Docker image does not include the required OpenVPN configuration file and certificates. These will typically be downloaded from your VPN providers website (look for OpenVPN configuration files), and generally are zipped.
@@ -158,6 +165,10 @@ The list of default NS providers in the above example(s) is as follows:-
37.235.x.x = FreeDNS
1.x.x.x = Cloudflare
+---
+**IMPORTANT**
+Please note `VPN_INPUT_PORTS` is **NOT** to define the incoming port for the VPN, this environment variable is used to define port(s) you want to allow in to the VPN network when network binding multiple containers together, configuring this incorrectly with the VPN provider assigned incoming port COULD result in IP leakage, you have been warned!.
+
---
User ID (PUID) and Group ID (PGID) can be found by issuing the following command for the user you want to run the container as:-
diff --git a/run/nobody/watchdog.sh b/run/nobody/watchdog.sh
index 7a3344a..f9a57ee 100644
--- a/run/nobody/watchdog.sh
+++ b/run/nobody/watchdog.sh
@@ -154,6 +154,44 @@ while true; do
fi
+ if [[ "${ENABLE_SOCKS}" == "yes" ]]; then
+
+ # get current bind ip for microsocks, if different to vpn_ip then kill
+ microsocks_current_bind_ip=$(pgrep -fa 'microsocks' | grep -o -P -m 1 '(?<=-b\s)[\d\.]+')
+
+ if [[ "${microsocks_current_bind_ip}" != "${vpn_ip}" ]]; then
+
+ echo "[info] Restarting microsocks due to change in vpn ip..."
+ pkill -SIGTERM "microsocks"
+
+ # run script to start microsocks
+ source /home/nobody/microsocks.sh
+
+ else
+
+ # check if microsocks is running, if not then skip shutdown of process
+ if ! pgrep -fa "/usr/local/bin/microsocks" > /dev/null; then
+
+ echo "[info] microsocks not running"
+
+ else
+
+ # mark microsocks as running
+ microsocks_running="true"
+
+ fi
+
+ if [[ "${microsocks_running}" == "false" ]]; then
+
+ # run script to start microsocks
+ source /home/nobody/microsocks.sh
+
+ fi
+
+ fi
+
+ fi
+
else
echo "[warn] VPN IP not detected, VPN tunnel maybe down"
@@ -198,6 +236,20 @@ while true; do
fi
+ if [[ "${ENABLE_SOCKS}" == "yes" ]]; then
+
+ # check if microsocks is running, if not then start via microsocks.sh
+ if ! pgrep -fa "/usr/local/bin/microsocks" > /dev/null; then
+
+ echo "[info] microsocks not running"
+
+ # run script to start microsocks
+ source /home/nobody/microsocks.sh
+
+ fi
+
+ fi
+
if [[ "${deluge_running}" == "false" || "${deluge_web_running}" == "false" ]]; then
# run script to start deluge