mirror of
https://github.com/casjaysdevdocker/tor
synced 2025-09-18 03:57:42 -04:00
🗃️ Committing everything that changed 🗃️
Dockerfile rootfs/tmp/etc/tor/hidden/ rootfs/tmp/etc/tor/torrc rootfs/usr/local/etc/docker/init.d/tor.sh
This commit is contained in:
@@ -168,6 +168,9 @@ CMD_ENV=""
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# Per Application Variables or imports
|
||||
TOR_DNS="${TOR_DNS:-yes}"
|
||||
TOR_HIDDEN="${TOR_HIDDEN:-yes}"
|
||||
TOR_BRIDGE="${TOR_BRIDGE:-yes}"
|
||||
RANDOM_NICK="$(head -n50 '/dev/random' | tr -dc 'a-zA-Z' | tr -d '[:space:]\042\047\134' | fold -w "32" | sed 's| ||g' | head -n 1)"
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# Custom commands to run before copying to /config
|
||||
@@ -235,9 +238,27 @@ __update_conf_files() {
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# define actions
|
||||
if [ "$TOR_BRIDGE" = "enabled" ] && ! grep -sq 'BridgeRelay' '/config/tor/torrc'; then
|
||||
cat <<EOF >>/config/tor/torrc
|
||||
BridgeRelay 1
|
||||
if [ "$TOR_DNS" = "yes" ]; then
|
||||
mkdir -p "/config/tor/conf.d"
|
||||
cat <<EOF >"/config/tor/conf.d/dns.conf"
|
||||
DNSPort 9053
|
||||
AutomapHostsOnResolve 1
|
||||
AutomapHostsSuffixes .exit,.onion
|
||||
|
||||
EOF
|
||||
fi
|
||||
if [ "$TOR_HIDDEN" = "yes" ]; then
|
||||
mkdir -p "/config/tor/hidden"
|
||||
cat <<EOF >"/config/tor/hidden/default.conf"
|
||||
HiddenServiceDir /data/tor/hidden_service/default
|
||||
HiddenServicePort 80 127.0.0.1:80
|
||||
|
||||
EOF
|
||||
fi
|
||||
if [ "$TOR_BRIDGE" = "yes" ]; then
|
||||
mkdir -p "/config/tor/relay"
|
||||
cat <<EOF >"/config/tor/relay/default.conf"
|
||||
BridgeRelay ${TOR_RELAY:-1}
|
||||
ExtORPort auto
|
||||
Nickname ${TOR_NICK_NAME:-$RANDOM_NICK}
|
||||
ServerTransportPlugin obfs4 exec /usr/bin/lyrebird
|
||||
@@ -248,6 +269,7 @@ Exitpolicy accept *:*
|
||||
AccountingMax ${TOR_ACCOUNT_MAX:-1000} GBytes
|
||||
AccountingStart month 1 00:00
|
||||
AddressDisableIPv6 0
|
||||
|
||||
EOF
|
||||
fi
|
||||
# allow custom functions
|
||||
|
Reference in New Issue
Block a user