From 0fd0a45c36df8911076699590256e1cd2fe016a3 Mon Sep 17 00:00:00 2001 From: casjay Date: Mon, 6 Jan 2025 15:17:34 -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/tmp/etc/tor/bridge.conf rootfs/tmp/etc/tor/hidden.conf rootfs/tmp/etc/tor/relay.conf rootfs/tmp/etc/tor/server.conf rootfs/tmp/etc/tor/torrc 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/04-tor-hidden.sh --- rootfs/tmp/etc/tor/bridge.conf | 0 rootfs/tmp/etc/tor/hidden.conf | 0 rootfs/tmp/etc/tor/relay.conf | 0 rootfs/tmp/etc/tor/server.conf | 20 --------------- rootfs/tmp/etc/tor/torrc | 4 +++ .../local/etc/docker/init.d/01-tor-server.sh | 25 ++++++++++++++++--- .../local/etc/docker/init.d/02-tor-relay.sh | 6 ++--- .../local/etc/docker/init.d/03-tor-bridge.sh | 6 ++--- .../local/etc/docker/init.d/04-tor-hidden.sh | 6 ++--- 9 files changed, 35 insertions(+), 32 deletions(-) delete mode 100644 rootfs/tmp/etc/tor/bridge.conf delete mode 100644 rootfs/tmp/etc/tor/hidden.conf delete mode 100644 rootfs/tmp/etc/tor/relay.conf delete mode 100644 rootfs/tmp/etc/tor/server.conf diff --git a/rootfs/tmp/etc/tor/bridge.conf b/rootfs/tmp/etc/tor/bridge.conf deleted file mode 100644 index e69de29..0000000 diff --git a/rootfs/tmp/etc/tor/hidden.conf b/rootfs/tmp/etc/tor/hidden.conf deleted file mode 100644 index e69de29..0000000 diff --git a/rootfs/tmp/etc/tor/relay.conf b/rootfs/tmp/etc/tor/relay.conf deleted file mode 100644 index e69de29..0000000 diff --git a/rootfs/tmp/etc/tor/server.conf b/rootfs/tmp/etc/tor/server.conf deleted file mode 100644 index 8111f15..0000000 --- a/rootfs/tmp/etc/tor/server.conf +++ /dev/null @@ -1,20 +0,0 @@ -##### default rc -%include /config/tor/torrc - -##### logging -LogMessageDomains 1 -Log notice file /data/logs/tor/server.log - -##### Server -TransPort 9040 -SOCKSPort 9050 -ControlPort 9051 -HTTPTunnelPort 9080 -AddressDisableIPv6 0 - -##### socks option -SafeSocks 0 -SocksTimeout 10 - -##### include configurations -%include /config/tor/conf.d/*.conf diff --git a/rootfs/tmp/etc/tor/torrc b/rootfs/tmp/etc/tor/torrc index 5322ec9..b8a4b25 100644 --- a/rootfs/tmp/etc/tor/torrc +++ b/rootfs/tmp/etc/tor/torrc @@ -9,3 +9,7 @@ HashedControlPassword 16:C30604D1D90F341360A14D9A1048C1DF4A3CA2411444E52EE5B954C DataDirectory /data/tor ControlSocket /run/tor/control.sock CookieAuthFile /run/tor/control.authcookie + +##### socks option +SafeSocks 0 +SocksTimeout 10 diff --git a/rootfs/usr/local/etc/docker/init.d/01-tor-server.sh b/rootfs/usr/local/etc/docker/init.d/01-tor-server.sh index 692d4d3..f6d694b 100755 --- a/rootfs/usr/local/etc/docker/init.d/01-tor-server.sh +++ b/rootfs/usr/local/etc/docker/init.d/01-tor-server.sh @@ -234,13 +234,32 @@ __update_conf_files() { chown -Rf ${SERVICE_USER:-$RUNAS_USER}:${SERVICE_GROUP:-$RUNAS_USER} /run/tor # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # replace variables - [ -n "$TOR_SOCKS_SAFE" ] && sed -i 's|SafeSocks .*|SafeSocks '$TOR_SOCKS_SAFE'|g' "$CONF_DIR/torrc" - [ -n "$TOR_SOCKS_TIMEOUT" ] && sed -i 's|SocksTimeout .*|SocksTimeout '$TOR_SOCKS_TIMEOUT'|g' "$CONF_DIR/torrc" + [ -n "$TOR_SOCKS_SAFE" ] && sed -i 's|SafeSocks .*|SafeSocks '$TOR_SOCKS_SAFE'|g' "/etc/tor/torrc" + [ -n "$TOR_SOCKS_TIMEOUT" ] && sed -i 's|SocksTimeout .*|SocksTimeout '$TOR_SOCKS_TIMEOUT'|g' "/etc/tor/torrc" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + cat <"$CONF_DIR/server.conf" +##### default rc +%include /etc/tor/torrc + +##### logging +LogMessageDomains 1 +Log notice file $LOG_DIR/server.log + +##### Server +TransPort 9040 +SOCKSPort 9050 +ControlPort 9051 +HTTPTunnelPort 9080 +AddressDisableIPv6 0 + +##### include configurations +%include $CONF_DIR/conf.d/*.conf + +EOF # define actions if [ "$TOR_DNS_ENABLED" = "yes" ]; then mkdir -p "$CONF_DIR/conf.d" - cat <"$CONF_DIR/conf.d/dns.conf" + cat <"/$CONF_DIR/conf.d/dns.conf" #### dns forwarder LogMessageDomains 1 Log notice file $LOG_DIR/dns.log 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 3c1c977..d717634 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 @@ -238,7 +238,7 @@ __update_conf_files() { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # define actions if [ "$TOR_RELAY_ENABLED" = "yes" ]; then - mkdir -p "$CONF_DIR/relay.d" + mkdir -p "$CONF_DIR/conf.d" cat <"$CONF_DIR/relay.conf" ##### default rc %include /config/tor/torrc @@ -250,13 +250,13 @@ Log notice file $LOG_DIR/relay.log SOCKSPort 10051 BridgeRelay 1 PublishServerDescriptor 1 -%include $CONF_DIR/relay.d/*.conf +%include $CONF_DIR/conf.d/*.conf EOF else exit 1 fi - [ -f "$CONF_DIR/relay.d/default.conf" ] || touch "$CONF_DIR/relay.d/default.conf" + [ -f "$CONF_DIR/conf.d/default.conf" ] || touch "$CONF_DIR/conf.d/default.conf" # allow custom functions if builtin type -t __update_conf_files_local | grep -q 'function'; then __update_conf_files_local; fi diff --git a/rootfs/usr/local/etc/docker/init.d/03-tor-bridge.sh b/rootfs/usr/local/etc/docker/init.d/03-tor-bridge.sh index c4ac2f5..c44ab69 100755 --- a/rootfs/usr/local/etc/docker/init.d/03-tor-bridge.sh +++ b/rootfs/usr/local/etc/docker/init.d/03-tor-bridge.sh @@ -238,7 +238,7 @@ __update_conf_files() { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # define actions if [ "$TOR_BRIDGE_ENABLED" = "yes" ]; then - mkdir -p "$CONF_DIR/bridge.d" + mkdir -p "$CONF_DIR/conf.d" cat <"$CONF_DIR/bridge.conf" ##### default rc %include /config/tor/torrc @@ -260,13 +260,13 @@ AccountingMax ${TOR_ACCOUNT_MAX:-1000} GBytes AccountingStart month 1 00:00 DirPort ${TOR_DIR_PORT:-8080} DirPortFrontPage /usr/share/tor/html/exit.html -%include $CONF_DIR/bridge.d/*.conf +%include $CONF_DIR/conf.d/*.conf EOF else exit 1 fi - [ -f "$CONF_DIR/bridge.d/default.conf" ] || touch "$CONF_DIR/bridge.d/default.conf" + [ -f "$CONF_DIR/conf.d/default.conf" ] || touch "$CONF_DIR/conf.d/default.conf" # allow custom functions if builtin type -t __update_conf_files_local | grep -q 'function'; then __update_conf_files_local; fi diff --git a/rootfs/usr/local/etc/docker/init.d/04-tor-hidden.sh b/rootfs/usr/local/etc/docker/init.d/04-tor-hidden.sh index 6248169..ecb9565 100755 --- a/rootfs/usr/local/etc/docker/init.d/04-tor-hidden.sh +++ b/rootfs/usr/local/etc/docker/init.d/04-tor-hidden.sh @@ -238,7 +238,7 @@ __update_conf_files() { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # define actions if [ "$TOR_HIDDEN_ENABLED" = "yes" ]; then - mkdir -p "$CONF_DIR/hidden.d" + mkdir -p "$CONF_DIR/conf.d" mkdir -p "$DATA_DIR/hidden_service" chmod 700 "$DATA_DIR/hidden_service" cat <"$CONF_DIR/hidden.conf" @@ -252,13 +252,13 @@ Log notice file $LOG_DIR/hidden.log SOCKSPort 10053 HiddenServiceDir $DATA_DIR/hidden_service/default HiddenServicePort 80 127.0.0.1:80 -%include $CONF_DIR/hidden.d/*.conf +%include $CONF_DIR/conf.d/*.conf EOF else exit 1 fi - [ -f "$CONF_DIR/hidden.d/default.conf" ] || touch "$CONF_DIR/hidden.d/default.conf" + [ -f "$CONF_DIR/conf.d/default.conf" ] || touch "$CONF_DIR/conf.d/default.conf" # allow custom functions if builtin type -t __update_conf_files_local | grep -q 'function'; then __update_conf_files_local; fi