mirror of
https://github.com/fphammerle/docker-tor-proxy.git
synced 2025-10-27 02:43:35 +01:00
adapt entrypoint script to fix "sed: write error" for large values of EXIT_NODES and EXCLUDE_EXIT_NODES
This commit is contained in:
@@ -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]
|
||||
### Fixed
|
||||
- "sed: write error" for large values of `EXIT_NODES` and `EXCLUDE_EXIT_NODES`
|
||||
|
||||
## [4.5.0] - 2021-09-06
|
||||
### Added
|
||||
|
||||
+7
-8
@@ -20,15 +20,14 @@ else
|
||||
sed -e "s/{socks_timeout_seconds}/$SOCKS_TIMEOUT_SECONDS/" /torrc.template > /tmp/torrc
|
||||
fi
|
||||
|
||||
if [ -z "$EXIT_NODES" ]; then
|
||||
sed --in-place -e '/{exit_nodes}/d' /tmp/torrc
|
||||
else
|
||||
sed --in-place -e "s#{exit_nodes}#$EXIT_NODES#" /tmp/torrc
|
||||
# > list of identity fingerprints, country codes, and address patterns
|
||||
if [ ! -z "$EXIT_NODES" ]; then
|
||||
echo -n 'ExitNodes ' >> /tmp/torrc
|
||||
printenv EXIT_NODES >> /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
|
||||
if [ ! -z "$EXCLUDE_EXIT_NODES" ]; then
|
||||
echo -n 'ExcludeExitNodes ' >> /tmp/torrc
|
||||
printenv EXCLUDE_EXIT_NODES >> /tmp/torrc
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
|
||||
@@ -26,9 +26,5 @@ 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
|
||||
|
||||
# > list of identity fingerprints, country codes, and address patterns
|
||||
ExitNodes {exit_nodes}
|
||||
ExcludeExitNodes {exclude_exit_nodes}
|
||||
|
||||
# try to
|
||||
HardwareAccel 1
|
||||
|
||||
Reference in New Issue
Block a user