Skip to content

Commit

Permalink
🩺 Add health check to improve HA watchdog (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored Dec 16, 2022
1 parent 595d1d3 commit 0df9deb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions tor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ RUN \
openssl=3.0.7-r0 \
tor=0.4.7.12-r0

HEALTHCHECK \
--start-period=5m \
--interval=60s \
--timeout=30s \
CMD curl \
--silent \
--location \
--socks5-hostname localhost:9050 \
https://check.torproject.org/?lang=en_US \
| grep -qm1 Congratulations

# Build arguments
ARG BUILD_ARCH
ARG BUILD_DATE
Expand Down
2 changes: 1 addition & 1 deletion tor/rootfs/etc/s6-overlay/s6-rc.d/init-tor/run
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ fi
if bashio::config.true 'socks'; then
echo 'SOCKSPort 0.0.0.0:9050' >> "${torrc}"
else
echo 'SOCKSPort 0' >> "${torrc}"
echo 'SOCKSPort 127.0.0.1:9050' >> "${torrc}"
fi

# Configure hidden services
Expand Down

0 comments on commit 0df9deb

Please sign in to comment.