Sign inSign up

crasivo/tor-proxy

By crasivo

â€ĸUpdated 9 months ago

Image
Networking
Security
Developer tools
0

829

crasivo/tor-proxy repository overview

⁠🧅 Tor Proxy

Tor (The Onion Router) — is free and open-source software for enabling online anonymity. Traffic passes through a distributed network of nodes, which hides the user's location and protects them from traffic analysis.

This image will allow you to:

  • ✅ Use a Socks5 proxy to anonymize application traffic.
  • ✅ Bypass network restrictions and blockages.
  • ✅ Centrally manage DNS queries through an anonymous network.

Implementation features:

  • ✅ Root & Rootless container launch modes.
  • ✅ Using packages from the official Tor Project repository.
  • ✅ Configuration control via environment variables and files.
  • ✅ Simple customization of ENTRYPOINT & torrc.
  • ✅ Traffic obfuscation support via obfs4proxy.
  • ✅ Built-in healtcheck to monitor service status.
â âš ī¸ Disclaimer

Information for everyone:

  1. This project is a private initiative (pet-project) and is provided "as is". The author is not responsible for any direct or indirect losses resulting from the use of this software.
  2. This project is not an official Tor Project product. The author is not affiliated with the developers of The Tor Project, Inc. This is an independent Docker container implementation to simplify service startup.
  3. Do not use this tool to commit illegal actions. You are fully personally responsible for complying with the laws of your jurisdiction.
  4. Tor is not a "magic solution". Incorrect configuration of applications running through a proxy can lead to data leaks.
  5. If you are in a region with high internet censorship, remember that direct access to public Tor nodes may be restricted. In this case, use Bridges.

⁠🚀 Quick Start

Example commands to start the service via Docker Run⁠:

# Root
$ docker run -d --name tor-proxy -p 9050:9050 -e TORRC_USER=tor crasivo/tor-proxy
# Rootless
$ docker run -d --name tor-proxy -p 9050:9050 --user tor crasivo/tor-proxy

Example configuration file Docker Compose⁠:

services:
  proxy:
    image: crasivo/tor-proxy:latest
    restart: unless-stopped
    container_name: tor-proxy
    user: tor
    environment:
      - "TORRC_SOCKS_PORT=9050"
      - "TORRC_DNS_PORT=9053"
    hostname: tor-proxy
    networks:
      - tor
    ports:
      - "9050:9050" # Socks5
      - "9053:9053" # DNS
    volumes:
      - tor_config:/etc/tor/conf.d:cached

volumes:
  tor_config:

networks:
  tor:
    driver: bridge
    internal: false
    name: tor

â đŸ•šī¸ Usage

⁠Environment variables

The image supports dynamic modification of the /etc/tor/torrc file before starting the Tor service itself.

Summary table of available environment variables:

Env variableTorrc variableDefaultAdditional description
TORRC_SOCKS_PORTSocksPort0.0.0.0:9050Socks5 port for network access
TORRC_CONTROL_PORTControlPort—Tor service management port
TORRC_DNS_PORTDNSPort0.0.0.0:9053DNS port
TORRC_ENTRY_NODESEntryNodesEU countriesEntry nodes (countries/nodes)
TORRC_EXCLUDE_NODESExcludeNodes—Excluded chains (see below)
TORRC_EXIT_NODESExitNodesEU countriesExit nodes (countries/nodes)
TORRC_STRICT_NODESStrictNodes0Strict definition of routing rules
TORRC_MAX_CIRCUIT_DIRTINESSMaxCircuitDirtiness600Chain change interval (in seconds)

[!INFO] A complete list of supported variables can be found in the tor-bootstrap.sh⁠ file.

⁠Configuration files

If you need to create a "specific" configuration (for example, configure a list of bridges), you can mount your *.conf files into a separate directory /etc/tor/conf.d/. All files from this folder will be automatically connected when Tor starts.

Note

It is not recommended to touch (modify/mount) the main file `/etc/tor/torrc` in any way.

In some countries, internet providers block Tor traffic. For the service to work correctly, you need to configure an entry point to the network through the UseBridges & Bridges directives. A list of entry nodes can be viewed on the official website Tor⁠.

Example configuration of the /etc/tor/conf.d/torrc.custom file:

UseEntryGuards 1
UseBridges 1
ClientTransportPlugin obfs4 exec /usr/bin/obfs4proxy
Bridge obfs4 192.95.36.106:443 CDF2E31C532003348C36083BC13F00780E24D04C cert=97yMeXW6S0+yHlI+D5M8qA iat-mode=0
Bridge obfs4 85.31.186.26:443 011E240742967963A9AD9F037A3D73A602B72352 cert=9385S... iat-mode=0

Important

The `UseBridges` directive is incompatible with `EntryNodes`, so the environment variable `TORRC_USE_BRIDGES=1` removes the explicit specification of `EntryNodes` from the `/etc/tor/torrc` file.

Note

The image already contains the `obfs4proxy` package, which additionally obfuscates traffic.

⁠📜 License

This project (repository/image) is distributed under the MIT⁠ license.

Tag summary

Content type

Image

Digest

sha256:f62c8099eâ€Ļ

Size

46.9 MB

Last updated

9 months ago

docker pull crasivo/tor-proxy