added ability to exclude exit nodes via EXCLUDE_EXIT_NODES environment variable

This commit is contained in:
Fabian Peter Hammerle
2021-07-07 18:15:27 +02:00
parent e17905a023
commit 58fe2f7c03
6 changed files with 19 additions and 1 deletions
+2
View File
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- added ability to exclude exit nodes via `EXCLUDE_EXIT_NODES` environment variable
## [4.3.1] - 2021-05-15
### Fixed
+1
View File
@@ -11,6 +11,7 @@ VOLUME /var/lib/tor
#RUN apk add --no-cache \
# less \
# man-db \
# strace \
# tor-doc=$TOR_PACKAGE_VERSION
#ENV PAGER=less
+6
View File
@@ -48,6 +48,12 @@ sudo iptables -A OUTPUT ! -o lo -j REJECT --reject-with icmp-admin-prohibited
$ sudo docker run -e SOCKS_TIMEOUT_SECONDS=60 …
```
### Exclude Exit Nodes
```sh
$ sudo docker run -e EXCLUDE_EXIT_NODES=1.2.3.4,1.2.3.5 …
```
### Show Circuits
```sh
+2 -1
View File
@@ -9,6 +9,7 @@ services:
image: fphammerle/tor-proxy
environment:
SOCKS_TIMEOUT_SECONDS: 30
#EXCLUDE_EXIT_NODES: '{xx},{yy},1.2.3.4,128.0.0.0/1'
volumes:
- type: volume
source: data
@@ -19,7 +20,7 @@ services:
tmpfs:
# nosuid,nodev,noexec added by default
mode: '1777'
size: 4k
size: 5k
read_only: yes
ports:
- '127.0.0.1:9050:9050/tcp'
+6
View File
@@ -20,4 +20,10 @@ else
sed -e "s/{socks_timeout_seconds}/$SOCKS_TIMEOUT_SECONDS/" /torrc.template > /tmp/torrc
fi
if [ -z "$EXCLUDE_EXIT_NODES" ]; then
sed --in-place -e '/{exclude_exit_nodes}/d' /tmp/torrc
else
sed --in-place -e "s#{exclude_exit_nodes}#$EXCLUDE_EXIT_NODES#" /tmp/torrc
fi
exec "$@"
+2
View File
@@ -26,5 +26,7 @@ SocksTimeout {socks_timeout_seconds}
# https://github.com/mitmproxy/mitmproxy/blob/v6.0.2/mitmproxy/platform/linux.py#L27
TransPort 0.0.0.0:9040 IsolateClientAddr IsolateClientProtocol
ExcludeExitNodes {exclude_exit_nodes}
# try to
HardwareAccel 1