Compare commits

..

8 Commits

Author SHA1 Message Date
Fabian Peter Hammerle c44166f264 release v2.1.0 2020-09-27 08:47:11 +02:00
Fabian Peter Hammerle b0d0e8da22 docker-compose: drop capabilities 2020-09-27 08:45:20 +02:00
Fabian Peter Hammerle ef97bc410f healthcheck: remove circuit-established check via control port to avoid spamming container log
> [notice] New control connection opened from 127.0.0.1.
2020-09-26 22:56:19 +02:00
Fabian Peter Hammerle a4f7946ced enable control listener 2020-09-26 22:52:13 +02:00
Fabian Peter Hammerle dcb78b66c5 upgrade default tor version: 0.4.1.9 -> 0.4.3.5 2020-09-26 21:56:41 +02:00
Fabian Peter Hammerle 7bce89fedf fix DNS port in readme & sample playbook 2020-03-24 20:18:30 +01:00
Fabian Peter Hammerle 22dcf7e9f4 release v2.0.0 2020-03-24 20:14:53 +01:00
Fabian Peter Hammerle 95b977d216 run tor as unprivileged user; DNS port 53 -> 9053 (breaking)
> [warn] You are running Tor as root. You don't need to, and you probably shouldn't.
2020-03-24 20:08:49 +01:00
7 changed files with 54 additions and 31 deletions
+17 -6
View File
@@ -6,6 +6,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [2.1.0] - 2020-09-27
### Added
- Enable [Tor control](https://gitweb.torproject.org/torspec.git/tree/control-spec.txt)
listener on port `9051`
(listening on loopback device only)
## [2.0.0] - 2020-03-24
### Changed
- Changed DNS port from 53 to 9053
### Fixed
- Run as unprivileged user
## [1.1.1] - 2020-03-21
### Fixed
- Fix invalid torrc path
@@ -14,15 +27,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Change `SocksTimeout` option by setting `$SOCKS_TIMEOUT_SECONDS`
### Fixed
- upgrade default tor version: 0.4.1.6 -> 0.4.1.9
(non-breaking, fixes only, https://gitweb.torproject.org/tor.git/plain/ChangeLog)
## [1.0.0] - 2019-10-12
### Added
- Tor Socks5 & DNS proxy
[Unreleased]: https://github.com/fphammerle/docker-tor-proxy/compare/v1.1.1...HEAD
[1.1.1]: https://github.com/fphammerle/docker-tor-proxy/compare/1.0.0...v1.1.1
[Unreleased]: https://github.com/fphammerle/docker-tor-proxy/compare/v2.1.0...HEAD
[2.1.0]: https://github.com/fphammerle/docker-tor-proxy/compare/v2.0.0...v2.1.0
[2.0.0]: https://github.com/fphammerle/docker-tor-proxy/compare/v1.1.1...v2.0.0
[1.1.1]: https://github.com/fphammerle/docker-tor-proxy/compare/v1.1.0...v1.1.1
[1.1.0]: https://github.com/fphammerle/docker-tor-proxy/compare/1.0.0...v1.1.0
[1.0.0]: https://github.com/fphammerle/docker-tor-proxy/releases/tag/1.0.0
+14 -12
View File
@@ -1,29 +1,31 @@
FROM alpine:3.11
FROM alpine:3.12
ARG CURL_PACKAGE_VERSION=7.67.0-r0
ARG BIND_TOOLS_PACKAGE_VERSION=9.14.8-r5
ARG TOR_PACKAGE_VERSION=0.4.1.9-r0
ARG CURL_PACKAGE_VERSION=7.69.1-r0
ARG BIND_TOOLS_PACKAGE_VERSION=9.16.6-r0
ARG TOR_PACKAGE_VERSION=0.4.3.5-r0
RUN adduser -S onion \
&& apk add --no-cache \
curl=$CURL_PACKAGE_VERSION \
bind-tools=$BIND_TOOLS_PACKAGE_VERSION `# dig` \
tor=$TOR_PACKAGE_VERSION
# RUN apk add --no-cache \
# less \
# man \
# tor-doc=$TOR_PACKAGE_VERSION
# ENV PAGER=less
#RUN apk add --no-cache \
# less \
# man-db \
# tor-doc=$TOR_PACKAGE_VERSION
#ENV PAGER=less
EXPOSE 9050/tcp
EXPOSE 53/udp
EXPOSE 9053/udp
COPY torrc.template entrypoint.sh /
ENV SOCKS_TIMEOUT_SECONDS=
ENTRYPOINT ["/entrypoint.sh"]
RUN chmod -c a+rX /torrc.template /entrypoint.sh
CMD ["tor"]
USER onion
CMD ["tor", "-f", "/tmp/torrc"]
HEALTHCHECK CMD \
curl --silent --socks5 localhost:9050 https://google.com > /dev/null \
&& [ ! -z "$(dig +notcp +short one.one.one.one @localhost)" ] \
&& [ ! -z "$(dig -p 9053 +notcp +short one.one.one.one @localhost)" ] \
|| exit 1
+10 -5
View File
@@ -5,15 +5,15 @@ docker hub: https://hub.docker.com/r/fphammerle/tor-proxy
signed tags: https://github.com/fphammerle/docker-tor-proxy/tags
```sh
$ docker run --rm --name tor-proxy \
$ sudo docker run --rm --name tor_proxy \
-p 127.0.0.1:9050:9050/tcp \
-p 127.0.0.1:53:53/udp \
-p 127.0.0.1:53:9053/udp \
fphammerle/tor-proxy
```
or after cloning the repository 🐙
```sh
$ docker-compose up
$ sudo docker-compose up
```
test proxies:
@@ -29,10 +29,15 @@ $ chromium-browser --proxy-server=socks5://localhost:9050 ipinfo.io
isolate:
```sh
iptables -A OUTPUT ! -o lo -j REJECT --reject-with icmp-admin-prohibited
sudo iptables -A OUTPUT ! -o lo -j REJECT --reject-with icmp-admin-prohibited
```
change `SocksTimeout` option:
```sh
$ docker run -e SOCKS_TIMEOUT_SECONDS=60
$ sudo docker run -e SOCKS_TIMEOUT_SECONDS=60
```
show circuits:
```sh
$ sudo docker exec tor_proxy sh -c 'printf "AUTHENTICATE\nGETINFO circuit-status\n" | nc localhost 9051'
```
+1 -1
View File
@@ -14,7 +14,7 @@
purge_networks: yes
ports:
- '127.0.0.1:9050:9050/tcp'
- '127.0.0.1:53:53/udp'
- '127.0.0.1:53:9053/udp'
restart_policy: unless-stopped
memory: 128M
- iptables:
+5 -3
View File
@@ -6,12 +6,14 @@ services:
image: fphammerle/tor-proxy
ports:
- '127.0.0.1:9050:9050/tcp'
- '127.0.0.1:53:53/udp'
- '127.0.0.1:53:9053/udp'
environment:
SOCKS_TIMEOUT_SECONDS: 240
security_opt: ['no-new-privileges']
restart: unless-stopped
cap_drop: [ALL]
#cap_add: [SYS_PTRACE]
security_opt: [no-new-privileges]
cpus: 0.5
mem_limit: 128m
restart: unless-stopped
# https://docs.docker.com/compose/compose-file/compose-file-v2/
+2 -2
View File
@@ -5,9 +5,9 @@ set -e
# default: 120 sec
# https://github.com/torproject/tor/blob/tor-0.4.1.7/src/core/or/connection_edge.c#L1099
if [ -z "$SOCKS_TIMEOUT_SECONDS" ]; then
sed -e '/{socks_timeout_seconds}/d' /torrc.template > /etc/tor/torrc
sed -e '/{socks_timeout_seconds}/d' /torrc.template > /tmp/torrc
else
sed -e "s/{socks_timeout_seconds}/$SOCKS_TIMEOUT_SECONDS/" /torrc.template > /etc/tor/torrc
sed -e "s/{socks_timeout_seconds}/$SOCKS_TIMEOUT_SECONDS/" /torrc.template > /tmp/torrc
fi
exec "$@"
+5 -2
View File
@@ -1,8 +1,11 @@
Log notice stdout
SocksPort 0.0.0.0:9050
DNSPort 0.0.0.0:53
# https://gitweb.torproject.org/torspec.git/tree/control-spec.txt
ControlPort localhost:9051
DNSPort 0.0.0.0:9053
SocksPort 0.0.0.0:9050
SocksTimeout {socks_timeout_seconds}
# try to