-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
13 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
FROM alpine:latest | ||
|
||
RUN apk --no-cache --update --upgrade add tor curl grep \ | ||
RUN apk --no-cache --update --upgrade add tor curl grep netcat-openbsd \ | ||
&& mv /etc/tor/torrc.sample /etc/tor/torrc \ | ||
&& sed -i \ | ||
-e 's/#SOCKSPort 192.168.0.1:9100/SOCKSPort 0.0.0.0:9050/g' \ | ||
/etc/tor/torrc \ | ||
&& chown -R tor /var/lib/tor | ||
&& chown -R tor /var/lib/tor \ | ||
&& echo "#!/bin/sh" > /usr/local/bin/check-and-renew.sh \ | ||
&& echo "while true; do" >> /usr/local/bin/check-and-renew.sh \ | ||
&& echo " curl -x socks5h://127.0.0.1:9050 -s http://btdigggink2pdqzqrik3blmqemsbntpzwxottujilcdjfz56jumzfsyd.onion/search?q=Kraftfahrzeughaftpflichtversicherung | grep -qm1 Histats || (echo -e 'AUTHENTICATE \"\"\\nsignal NEWNYM\\nQUIT' | nc 127.0.0.1 9051)" >> /usr/local/bin/check-and-renew.sh \ | ||
&& echo " sleep 30" >> /usr/local/bin/check-and-renew.sh \ | ||
&& echo "done" >> /usr/local/bin/check-and-renew.sh \ | ||
&& chmod +x /usr/local/bin/check-and-renew.sh | ||
|
||
USER tor | ||
ENTRYPOINT tor | ||
ENTRYPOINT tor & /usr/local/bin/check-and-renew.sh | ||
|
||
EXPOSE 9050/tcp | ||
|
||
HEALTHCHECK --interval=10s --timeout=5s --start-period=5s --retries=1 \ | ||
CMD curl -x socks5h://127.0.0.1:9050 -s http://btdigggink2pdqzqrik3blmqemsbntpzwxottujilcdjfz56jumzfsyd.onion/search?q=Kraftfahrzeughaftpflichtversicherung | grep -qm1 Histats | ||
HEALTHCHECK --interval=60s --timeout=15s --start-period=20s \ | ||
CMD curl -s --socks5 127.0.0.1:9050 'https://check.torproject.org/api/ip' | grep -qm1 -E '"IsTor"\s*:\s*true' |