mirror of
https://github.com/fphammerle/docker-tor-proxy.git
synced 2025-10-27 02:43:35 +01:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| afcf2b4cc1 | |||
| eb23db5412 | |||
| 9e41750ca9 | |||
| 6a1098af3d | |||
| 7fc341fb34 | |||
| 4b287edbd4 | |||
| 1eb9583069 | |||
| 946bc9db19 | |||
| ce0fce96e0 | |||
| d7d5518a21 | |||
| 5db662d486 | |||
| 31a69d9d90 | |||
| b26c721e60 | |||
| fc3f461cdd | |||
| 4bdd61e3b2 | |||
| 5a9d489a1d | |||
| db1f87c85c | |||
| 0cf3a5f284 | |||
| 2cb4dfeb05 |
@@ -13,13 +13,13 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: docker/setup-qemu-action@v1.2.0
|
||||
- uses: docker/setup-buildx-action@v1.4.1
|
||||
- uses: docker/setup-buildx-action@v1.6.0
|
||||
# > By default, this action uses the Git context so you don't need to use
|
||||
# > the actions/checkout action to checkout the repository because this
|
||||
# > will be done directly by buildkit. [...]
|
||||
# > any file mutation in the steps that precede [...] will be ignored
|
||||
# https://github.com/marketplace/actions/build-and-push-docker-images
|
||||
- uses: docker/build-push-action@v2.6.1
|
||||
- uses: docker/build-push-action@v2.9.0
|
||||
with:
|
||||
platforms: |
|
||||
linux/amd64
|
||||
|
||||
+11
-1
@@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [4.5.1] - 2022-02-27
|
||||
### Fixed
|
||||
- "sed: write error" for large values of `EXIT_NODES` and `EXCLUDE_EXIT_NODES`
|
||||
|
||||
## [4.5.0] - 2021-09-06
|
||||
### Added
|
||||
- added ability to select exit nodes explicitly via `EXIT_NODES` environment variable
|
||||
|
||||
## [4.4.0] - 2021-07-07
|
||||
### Added
|
||||
- added ability to exclude exit nodes via `EXCLUDE_EXIT_NODES` environment variable
|
||||
@@ -83,7 +91,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
### Added
|
||||
- tor socks5 & DNS proxy
|
||||
|
||||
[Unreleased]: https://github.com/fphammerle/docker-tor-proxy/compare/v4.4.0...HEAD
|
||||
[Unreleased]: https://github.com/fphammerle/docker-tor-proxy/compare/v4.5.1...HEAD
|
||||
[4.5.1]: https://github.com/fphammerle/docker-tor-proxy/compare/v4.5.0...v4.5.1
|
||||
[4.5.0]: https://github.com/fphammerle/docker-tor-proxy/compare/v4.4.0...v4.5.0
|
||||
[4.4.0]: https://github.com/fphammerle/docker-tor-proxy/compare/v4.3.1...v4.4.0
|
||||
[4.3.1]: https://github.com/fphammerle/docker-tor-proxy/compare/v4.3.0...v4.3.1
|
||||
[4.3.0]: https://github.com/fphammerle/docker-tor-proxy/compare/v4.2.0...v4.3.0
|
||||
|
||||
+6
-4
@@ -1,8 +1,8 @@
|
||||
FROM docker.io/alpine:3.14.0
|
||||
FROM docker.io/alpine:3.15.0
|
||||
|
||||
# nftables + dependencies add 2.3MB to image
|
||||
ARG TOR_PACKAGE_VERSION=0.4.5.9-r0
|
||||
ARG NFTABLES_PACKAGE_VERSION=0.9.9-r0
|
||||
ARG TOR_PACKAGE_VERSION=0.4.6.9-r0
|
||||
ARG NFTABLES_PACKAGE_VERSION=1.0.1-r0
|
||||
RUN apk add --no-cache \
|
||||
nftables=$NFTABLES_PACKAGE_VERSION \
|
||||
tor=$TOR_PACKAGE_VERSION
|
||||
@@ -19,7 +19,9 @@ EXPOSE 9050/tcp
|
||||
EXPOSE 9053/udp
|
||||
COPY torrc.template entrypoint.sh /
|
||||
RUN chmod -c a+rX /torrc.template /entrypoint.sh
|
||||
ENV SOCKS_TIMEOUT_SECONDS=
|
||||
ENV SOCKS_TIMEOUT_SECONDS= \
|
||||
EXIT_NODES= \
|
||||
EXCLUDE_EXIT_NODES=
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
# entrypoint.sh drops privileges after configuring nftables for transparent proxy
|
||||
|
||||
@@ -29,4 +29,4 @@ podman-build: worktree-clean
|
||||
|
||||
docker-push: docker-build
|
||||
sudo docker push "${IMAGE_NAME}:${IMAGE_TAG}"
|
||||
@echo git tag --sign --message '$(shell sudo docker image inspect --format '{{join .RepoDigests "\n"}}' "${IMAGE_NAME}:${IMAGE_TAG}")' docker/${IMAGE_TAG} $(shell git rev-parse HEAD)
|
||||
@echo git tag --sign --message '$(shell sudo docker image inspect --format '{{join .RepoDigests "\n"}}' "${IMAGE_NAME}:${IMAGE_TAG}" | sed "s/@/:${IMAGE_TAG}@/")' docker/${IMAGE_TAG} $(shell git rev-parse HEAD)
|
||||
|
||||
@@ -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 …
|
||||
```
|
||||
|
||||
### Select Exit Nodes
|
||||
|
||||
```sh
|
||||
$ sudo docker run -e EXIT_NODES=1.2.3.4,1.2.3.5,{at} …
|
||||
```
|
||||
|
||||
### Exclude Exit Nodes
|
||||
|
||||
```sh
|
||||
|
||||
@@ -9,6 +9,7 @@ services:
|
||||
image: fphammerle/tor-proxy
|
||||
environment:
|
||||
SOCKS_TIMEOUT_SECONDS: 30
|
||||
#EXIT_NODES: '1.2.3.4,1.2.3.5,{at}'
|
||||
#EXCLUDE_EXIT_NODES: '{xx},{yy},1.2.3.4,128.0.0.0/1'
|
||||
volumes:
|
||||
- type: volume
|
||||
|
||||
+8
-4
@@ -20,10 +20,14 @@ 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
|
||||
# > 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
|
||||
echo -n 'ExcludeExitNodes ' >> /tmp/torrc
|
||||
printenv EXCLUDE_EXIT_NODES >> /tmp/torrc
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
https://git.alpinelinux.org/aports/log/main/nftables?h=3.15-stable
|
||||
@@ -0,0 +1 @@
|
||||
https://git.alpinelinux.org/aports/log/community/tor?h=3.15-stable
|
||||
@@ -26,7 +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
|
||||
|
||||
ExcludeExitNodes {exclude_exit_nodes}
|
||||
|
||||
# try to
|
||||
HardwareAccel 1
|
||||
|
||||
Reference in New Issue
Block a user