Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ CONTROL_HOST=0.0.0.0

# Comma-separated IP/CIDR allow-list for the SOCKS proxy.
# Default: RFC 1918 private ranges + loopback.
SOCKS_POLICY=accept 127.0.0.1,accept 10.0.0.0/8,accept 172.16.0.0/12,accept 192.168.0.0/16
SOCKS_POLICY=accept 127.0.0.1,accept 10.0.0.0/8,accept 172.16.0.0/12,accept 192.168.0.0/16,reject *
2 changes: 1 addition & 1 deletion compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ services:
CONTROL_HOST: '${CONTROL_HOST:-0.0.0.0}'

# Which source IPs may use the proxy.
SOCKS_POLICY: '${SOCKS_POLICY:-accept 127.0.0.1,accept 10.0.0.0/8,accept 172.16.0.0/12,accept 192.168.0.0/16}'
SOCKS_POLICY: '${SOCKS_POLICY:-accept 127.0.0.1,accept 10.0.0.0/8,accept 172.16.0.0/12,accept 192.168.0.0/16,reject *}'

ports:
# SOCKS5 proxy — your scraper connects here
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ EXPOSE 9150 9151
ENV CONTROL_PASSWORD="changeme" \
SOCKS_HOST="0.0.0.0" \
CONTROL_HOST="0.0.0.0" \
SOCKS_POLICY="accept 127.0.0.1,accept 10.0.0.0/8,accept 172.16.0.0/12,accept 192.168.0.0/16"
SOCKS_POLICY="accept 127.0.0.1,accept 10.0.0.0/8,accept 172.16.0.0/12,accept 192.168.0.0/16,reject *"

ENTRYPOINT ["/entrypoint.sh"]
3 changes: 1 addition & 2 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ SocksPort ${SOCKS_HOST}:9150

# Accept policy: allow only the listed CIDRs, reject everything else.
$(echo "${SOCKS_POLICY}" | tr ',' '\n' | sed 's/^ */SocksPolicy /')
SocksPolicy reject *

# === Control port (used by stem for NEWNYM / circuit rotation) ===
ControlPort ${CONTROL_HOST}:9151
Expand All @@ -34,4 +33,4 @@ echo "[tor-proxy] SOCKS5 -> ${SOCKS_HOST}:9150"
echo "[tor-proxy] Control -> ${CONTROL_HOST}:9151 (password auth)"

# Run as the 'tor' user created by the apk package.
exec su-exec tor tor -f /etc/tor/torrc "$@"
exec su-exec tor tor -f /etc/tor/torrc "$@"
Loading