mirror of
https://github.com/fphammerle/docker-tor-proxy.git
synced 2025-10-27 02:43:35 +01:00
76f7fcaf09
> One of these vulnerabilities (TROVE-2021-001) would allow an attacker > who can send directory data to a Tor instance to force that Tor > instance to consume huge amounts of CPU. https://gitweb.torproject.org/tor.git/plain/ChangeLog https://cve.circl.lu/cve/CVE-2021-28089 https://git.alpinelinux.org/aports/commit/community/tor?id=dc7ce7e4b63c64d11026e307ada830c33d8309a4 https://github.com/fphammerle/docker-onion-service/commit/48c53ae15c2780b3ac97ac55a91748e947a55ead
36 lines
1.1 KiB
Docker
36 lines
1.1 KiB
Docker
FROM docker.io/alpine:3.13.3
|
|
|
|
ARG TOR_PACKAGE_VERSION=0.4.4.8-r0
|
|
RUN apk add --no-cache tor=$TOR_PACKAGE_VERSION
|
|
VOLUME /var/lib/tor
|
|
|
|
#RUN apk add --no-cache \
|
|
# less \
|
|
# man-db \
|
|
# tor-doc=$TOR_PACKAGE_VERSION
|
|
#ENV PAGER=less
|
|
|
|
EXPOSE 9050/tcp
|
|
EXPOSE 9053/udp
|
|
COPY torrc.template entrypoint.sh /
|
|
RUN chmod -c a+rX /torrc.template /entrypoint.sh
|
|
ENV SOCKS_TIMEOUT_SECONDS=
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
|
|
USER tor
|
|
CMD ["tor", "-f", "/tmp/torrc"]
|
|
|
|
# keeping dns requests as network-liveness is too optimistic
|
|
# https://gitweb.torproject.org/torspec.git/tree/control-spec.txt
|
|
HEALTHCHECK CMD \
|
|
printf "AUTHENTICATE\nGETINFO network-liveness\nQUIT\n" | nc localhost 9051 \
|
|
| grep -q network-liveness=up \
|
|
&& nslookup -port=9053 google.com localhost | grep -v NXDOMAIN | grep -q google \
|
|
|| exit 1
|
|
|
|
# https://github.com/opencontainers/image-spec/blob/v1.0.1/annotations.md
|
|
ARG REVISION=
|
|
LABEL org.opencontainers.image.title="tor socks, dns & transparent proxy" \
|
|
org.opencontainers.image.source="https://github.com/fphammerle/docker-tor-proxy" \
|
|
org.opencontainers.image.revision="$REVISION"
|