From 6931aab5dfa9ff2f459c42d6b1b96d50675aa8d4 Mon Sep 17 00:00:00 2001 From: casjay Date: Sat, 2 Aug 2025 18:42:31 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Committing=20everything?= =?UTF-8?q?=20that=20changed=20=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rootfs/usr/local/etc/docker/init.d/01-tor-bridge.sh rootfs/usr/local/etc/docker/init.d/02-tor-relay.sh rootfs/usr/local/etc/docker/init.d/03-tor-server.sh --- .../local/etc/docker/init.d/01-tor-bridge.sh | 6 ++++-- .../local/etc/docker/init.d/02-tor-relay.sh | 4 +++- .../local/etc/docker/init.d/03-tor-server.sh | 21 +++++++++++++++---- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/rootfs/usr/local/etc/docker/init.d/01-tor-bridge.sh b/rootfs/usr/local/etc/docker/init.d/01-tor-bridge.sh index 580d9b3..4bffe0d 100755 --- a/rootfs/usr/local/etc/docker/init.d/01-tor-bridge.sh +++ b/rootfs/usr/local/etc/docker/init.d/01-tor-bridge.sh @@ -277,9 +277,11 @@ ORPort ${TOR_BRIDGE_OR_PORT:-57004} DirPort ${TOR_BRIDGE_DIR_PORT:-57005} Nickname ${TOR_BRIDGE_NICK_NAME:-$RANDOM_NICK} ContactInfo ${TOR_BRIDGE_ADMIN:-tor-admin@$HOSTNAME} -AccountingMax ${TOR_BRIDGE_ACCOUNT_MAX:-2000 GBytes} -PublishServerDescriptor 1 +AccountingMax ${TOR_BRIDGE_ACCOUNT_MAX:-250 GBytes} +RelayBandwidthRate ${TOR_BRIDGE_BANDWIDTH_RATE:-96 KB} +RelayBandwidthBurst ${TOR_BRIDGE_BANDWIDTH_BURST:-192 KB} AccountingStart month 1 00:00 +PublishServerDescriptor 1 # Block ports ExitPolicy reject *:25 diff --git a/rootfs/usr/local/etc/docker/init.d/02-tor-relay.sh b/rootfs/usr/local/etc/docker/init.d/02-tor-relay.sh index 495fc6f..32559d8 100755 --- a/rootfs/usr/local/etc/docker/init.d/02-tor-relay.sh +++ b/rootfs/usr/local/etc/docker/init.d/02-tor-relay.sh @@ -278,7 +278,9 @@ ExitRelay 1 PublishServerDescriptor 1 Nickname ${TOR_RELAY_NICK_NAME:-$RANDOM_NICK} ContactInfo ${TOR_RELAY_ADMIN:-tor-admin@$HOSTNAME} -AccountingMax ${TOR_RELAY_ACCOUNT_MAX:-2000 GBytes} +AccountingMax ${TOR_RELAY_ACCOUNT_MAX:-250 GBytes} +RelayBandwidthRate ${TOR_RELAY_BANDWIDTH_RATE:-96 KB} +RelayBandwidthBurst ${TOR_RELAY_BANDWIDTH_BURST:-192 KB} AccountingStart month 1 00:00 DirPortFrontPage /usr/share/tor/html/exit.html diff --git a/rootfs/usr/local/etc/docker/init.d/03-tor-server.sh b/rootfs/usr/local/etc/docker/init.d/03-tor-server.sh index 93e0430..c1dd744 100755 --- a/rootfs/usr/local/etc/docker/init.d/03-tor-server.sh +++ b/rootfs/usr/local/etc/docker/init.d/03-tor-server.sh @@ -251,6 +251,12 @@ CookieAuthentication 1 CookieAuthFileGroupReadable 1 HashedControlPassword 16:C30604D1D90F341360A14D9A1048C1DF4A3CA2411444E52EE5B954C01F +##### bandwidth and accounting (monitoring only) +Nickname ${TOR_SERVER_NICK_NAME:-$RANDOM_NICK} +ContactInfo ${TOR_SERVER_ADMIN:-tor-admin@$HOSTNAME} +AccountingMax ${TOR_SERVER_ACCOUNT_MAX:-250 GBytes} +AccountingStart month 1 00:00 + ##### directiories and files DataDirectory $DATA_DIR ControlSocket $RUN_DIR/server.sock @@ -260,20 +266,27 @@ CookieAuthFile $RUN_DIR/server.authcookie SOCKSPort 0.0.0.0:9050 SafeSocks ${TOR_SOCKS_SAFE:-0} SocksTimeout ${TOR_SOCKS_TIMEOUT:-10} -#SOCKSPolicy accept * -#SOCKSPolicy accept6 * ##### logging LogMessageDomains 1 Log notice file $LOG_DIR/server.log -#Log debug file $LOG_DIR/server.debug ##### port mappings TransPort 0.0.0.0:9040 HTTPTunnelPort 0.0.0.0:9080 +##### hidden services +HiddenServiceDir ${TOR_HIDDEN_SERVICE_DIR:-$DATA_DIR/hidden_service} +HiddenServicePort ${TOR_HIDDEN_SERVICE_PORT:-80 127.0.0.1:80} + +##### security +SafeLogging 1 +UseEntryGuards 1 +NumEntryGuards 3 +DisableAllSwap 1 + ##### exit relay -ExcludeNodes {ru} +ExcludeNodes {ru},{cn},{ir},{kp},{sy} EOF # define actions