From 2142a2990ba1c39035158bebd6663f7c5efbdf7f Mon Sep 17 00:00:00 2001 From: casjay Date: Thu, 9 Jan 2025 00:42:55 -0500 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/01-tor-server.sh rootfs/usr/local/etc/docker/init.d/02-tor-relay.sh rootfs/usr/local/etc/docker/init.d/03-tor-bridge.sh rootfs/usr/local/etc/docker/init.d/03-tor-server.sh rootfs/usr/local/etc/docker/init.d/98-php.sh rootfs/usr/local/etc/docker/init.d/98-privoxy.sh rootfs/usr/local/etc/docker/init.d/99-php.sh rootfs/usr/local/etc/docker/init.d/99-privoxy.sh --- .../{03-tor-bridge.sh => 01-tor-bridge.sh} | 2 +- .../local/etc/docker/init.d/02-tor-relay.sh | 2 +- .../{01-tor-server.sh => 03-tor-server.sh} | 34 ++++++++++++++----- .../init.d/{99-privoxy.sh => 98-privoxy.sh} | 0 .../docker/init.d/{98-php.sh => 99-php.sh} | 0 5 files changed, 27 insertions(+), 11 deletions(-) rename rootfs/usr/local/etc/docker/init.d/{03-tor-bridge.sh => 01-tor-bridge.sh} (99%) rename rootfs/usr/local/etc/docker/init.d/{01-tor-server.sh => 03-tor-server.sh} (98%) rename rootfs/usr/local/etc/docker/init.d/{99-privoxy.sh => 98-privoxy.sh} (100%) rename rootfs/usr/local/etc/docker/init.d/{98-php.sh => 99-php.sh} (100%) diff --git a/rootfs/usr/local/etc/docker/init.d/03-tor-bridge.sh b/rootfs/usr/local/etc/docker/init.d/01-tor-bridge.sh similarity index 99% rename from rootfs/usr/local/etc/docker/init.d/03-tor-bridge.sh rename to rootfs/usr/local/etc/docker/init.d/01-tor-bridge.sh index a296281..3e38264 100755 --- a/rootfs/usr/local/etc/docker/init.d/03-tor-bridge.sh +++ b/rootfs/usr/local/etc/docker/init.d/01-tor-bridge.sh @@ -260,7 +260,7 @@ SocksTimeout ${TOR_SOCKS_TIMEOUT:-10} LogMessageDomains 1 Log notice file $LOG_DIR/tor-bridge.log -SOCKSPort 10052 +SOCKSPort 0 ServerTransportPlugin obfs4 exec /usr/bin/lyrebird ServerTransportListenAddr obfs4 0.0.0.0:${TOR_BRIDGE_PT_PORT:-57003} 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 0124e89..8ebc258 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 @@ -260,7 +260,7 @@ SocksTimeout ${TOR_SOCKS_TIMEOUT:-10} LogMessageDomains 1 Log notice file $LOG_DIR/tor-relay.log -SOCKSPort 10051 +SOCKSPort 0 ServerTransportPlugin obfs4 exec /usr/bin/lyrebird ServerTransportListenAddr obfs4 0.0.0.0:${TOR_RELAY_PORT:-57000} diff --git a/rootfs/usr/local/etc/docker/init.d/01-tor-server.sh b/rootfs/usr/local/etc/docker/init.d/03-tor-server.sh similarity index 98% rename from rootfs/usr/local/etc/docker/init.d/01-tor-server.sh rename to rootfs/usr/local/etc/docker/init.d/03-tor-server.sh index 491dfd0..65b14ac 100755 --- a/rootfs/usr/local/etc/docker/init.d/01-tor-server.sh +++ b/rootfs/usr/local/etc/docker/init.d/03-tor-server.sh @@ -149,7 +149,7 @@ user_pass="${TOR_USER_PASS_WORD:-}" # normal user password # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Additional variables - +TOR_HIDDEN_SERVERS="${TOR_HIDDEN_SERVERS//,/ }" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Specifiy custom directories to be created ADD_APPLICATION_FILES="" @@ -189,7 +189,7 @@ __execute_prerun() { # Define environment local hostname=${HOSTNAME} # Define actions/commands - + sleep 30 # allow custom functions if builtin type -t __execute_prerun_local | grep -q 'function'; then __execute_prerun_local; fi } @@ -237,8 +237,14 @@ __update_conf_files() { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - cat <>"$CONF_DIR/server.conf" +##### Server RunAsDaemon 0 HardwareAccel 1 +AddressDisableIPv6 0 +VirtualAddrNetwork 10.0.0.0/12 + +#### control settings +ControlPort 0.0.0.0:9051 ControlSocketsGroupWritable 1 CookieAuthentication 1 CookieAuthFileGroupReadable 1 @@ -252,17 +258,17 @@ CookieAuthFile $RUN_DIR/server.authcookie ##### socks option SafeSocks ${TOR_SOCKS_SAFE:-0} SocksTimeout ${TOR_SOCKS_TIMEOUT:-10} +SOCKSPolicy accept * +SOCKSPolicy accept6 * +SOCKSPort 0.0.0.0:9050 ##### logging LogMessageDomains 1 Log notice file $LOG_DIR/tor-server.log -##### Server -TransPort 9040 -SOCKSPort 9050 -ControlPort 9051 -HTTPTunnelPort 9080 -AddressDisableIPv6 0 +##### port mappings +TransPort 0.0.0.0:9040 +HTTPTunnelPort 0.0.0.0:9080 EOF # define actions @@ -293,7 +299,14 @@ HiddenServicePort 80 127.0.0.1:80 EOF fi - + if [ -n "$TOR_HIDDEN_SERVERS" ]; then + for hidden_server in $TOR_HIDDEN_SERVERS: do + name="$(echo "$hidden_server"|awk -F: '{print $1}')" + port="$(echo "$hidden_server"|awk -F: '{print $2}')" + host="$(echo "$hidden_server"|awk -F: '{print $3":"$4}')" + echo "" + done + fi cat <>"$CONF_DIR/server.conf" ##### include configurations %include $CONF_DIR/conf.d/*.conf @@ -341,6 +354,9 @@ __post_execute() { # show message __banner "$postMessageST" # commands to execute + while :; do + pgrep unbound && break || sleep 30 + done if [ -d "$DATA_DIR/services" ]; then for d in "$DATA_DIR/services"/*;do for host in "$d"/hostname; do diff --git a/rootfs/usr/local/etc/docker/init.d/99-privoxy.sh b/rootfs/usr/local/etc/docker/init.d/98-privoxy.sh similarity index 100% rename from rootfs/usr/local/etc/docker/init.d/99-privoxy.sh rename to rootfs/usr/local/etc/docker/init.d/98-privoxy.sh diff --git a/rootfs/usr/local/etc/docker/init.d/98-php.sh b/rootfs/usr/local/etc/docker/init.d/99-php.sh similarity index 100% rename from rootfs/usr/local/etc/docker/init.d/98-php.sh rename to rootfs/usr/local/etc/docker/init.d/99-php.sh