#!/usr/bin/env bash ########################################################################### ## Copyright (C) Wizardry and Steamworks 2025 - License: MIT ## ########################################################################### # define default parameters [ -z "$TOR_SOCKS_PORT" ] && TOR_SOCKS_PORT='0.0.0.0:9050' [ -z "$TOR_HTTP_TUNNEL_PORT" ] && TOR_HTTP_TUNNEL_PORT='0.0.0.0:9055' [ -z "$TOR_DNS_PORT" ] && TOR_DNS_PORT='0.0.0.0:9053' [ -z "$CHECK_CIRCUIT_PORT" ] && CHECK_CIRCUIT_PORT='0.0.0.0:7050' # launch tor from command line /usr/local/bin/tor \ --Log "notice stdout" \ --SocksPort "$TOR_SOCKS_PORT" \ --HTTPTunnelPort "$TOR_HTTP_TUNNEL_PORT" \ --RunAsDaemon 0 \ --DataDirectory /run \ --ControlPort 8050 \ --HashedControlPassword 16:9F840FFC85EF83CE60469C431DC9FF43DB889305B7653C2CB653302594 \ --SocksPolicy "accept *" \ --VirtualAddrNetwork 10.192.0.0/10 \ --AutomapHostsOnResolve 1 \ --AutomapHostsSuffixes .exit,.onion \ --DNSPort $TOR_DNS_PORT \ --UseBridges 1 \ --ClientTransportPlugin "snowflake exec /usr/local/bin/snowflake-client -log /dev/stdout" \ --Bridge "snowflake 192.0.2.3:80 2B280B23E1107BB62ABFC40DDCC8824814F80A72 fingerprint=2B280B23E1107BB62ABFC40DDCC8824814F80A72 url=https://1098762253.rsc.cdn77.org/ fronts=www.cdn77.com,www.phpmyadmin.net ice=stun:stun.l.google.com:19302,stun:stun.antisip.com:3478,stun:stun.bluesip.net:3478,stun:stun.dus.net:3478,stun:stun.epygi.com:3478,stun:stun.sonetel.com:3478,stun:stun.uls.co.za:3478,stun:stun.voipgate.com:3478,stun:stun.voys.nl:3478 utls-imitate=hellorandomizedalpn" \ --Bridge "snowflake 192.0.2.4:80 8838024498816A039FCBBAB14E6F40A0843051FA fingerprint=8838024498816A039FCBBAB14E6F40A0843051FA url=https://1098762253.rsc.cdn77.org/ fronts=www.cdn77.com,www.phpmyadmin.net ice=stun:stun.l.google.com:19302,stun:stun.antisip.com:3478,stun:stun.bluesip.net:3478,stun:stun.dus.net:3478,stun:stun.epygi.com:3478,stun:stun.sonetel.net:3478,stun:stun.uls.co.za:3478,stun:stun.voipgate.com:3478,stun:stun.voys.nl:3478 utls-imitate=hellorandomizedalpn" \ & # 0x80004005 when temporary directory is not writeable (/run should be tmpfs) export TMPDIR=/run # circuit checker for tor (queryable via $CHECK_CIRCUIT_PORT) /usr/local/bin/CheckCircuit \ -l $CHECK_CIRCUIT_PORT \ -c 127.0.0.1:8050 \ -p tor \ & # terminate container when any process spawned by this shell in the background terminates for JOB in `jobs -p`; do (lsof -p $JOB +r 1 &>/dev/null; kill -s TERM 1) & done sleep infinity