From daf36c026f0057438fd6bbea2034b9dac42390e7 Mon Sep 17 00:00:00 2001 From: casjay Date: Mon, 6 Jan 2025 13:58:01 -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/torrc rootfs/usr/local/etc/docker/init.d/01-tor-bridge.sh rootfs/usr/local/etc/docker/init.d/01-tor-hidden.sh rootfs/usr/local/etc/docker/init.d/01-tor-relay.sh rootfs/usr/local/etc/docker/init.d/01-tor-server.sh --- rootfs/tmp/etc/tor/torrc | 4 ++-- rootfs/usr/local/etc/docker/init.d/01-tor-bridge.sh | 5 ++++- rootfs/usr/local/etc/docker/init.d/01-tor-hidden.sh | 10 +++++++--- rootfs/usr/local/etc/docker/init.d/01-tor-relay.sh | 6 ++++-- rootfs/usr/local/etc/docker/init.d/01-tor-server.sh | 3 ++- 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/rootfs/tmp/etc/tor/torrc b/rootfs/tmp/etc/tor/torrc index b75d968..1b1a076 100644 --- a/rootfs/tmp/etc/tor/torrc +++ b/rootfs/tmp/etc/tor/torrc @@ -26,5 +26,5 @@ AddressDisableIPv6 0 SafeSocks 0 SocksTimeout 10 -##### dns forwarder -%include /config/tor/conf.d/dns.conf +##### include configurations +%include /config/tor/conf.d/*.conf 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 d7a338d..de96632 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 @@ -242,7 +242,7 @@ __update_conf_files() { cat <"$CONF_DIR/bridge.conf" #### bridge LogMessageDomains 1 -Log notice file /data/logs/tor/bridge.log +Log notice file /$LOG_DIR/bridge.log ServerTransportPlugin obfs4 exec /usr/bin/lyrebird ServerTransportListenAddr obfs4 0.0.0.0:${TOR_PT_PORT:-8445} @@ -256,11 +256,14 @@ 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/*.conf EOF else exit 1 fi + [ -f "$CONF_DIR/bridge/default.conf" ] || touch "$CONF_DIR/bridge/default.conf" + # allow custom functions if builtin type -t __update_conf_files_local | grep -q 'function'; then __update_conf_files_local; fi # exit function diff --git a/rootfs/usr/local/etc/docker/init.d/01-tor-hidden.sh b/rootfs/usr/local/etc/docker/init.d/01-tor-hidden.sh index bd2e74d..8196178 100755 --- a/rootfs/usr/local/etc/docker/init.d/01-tor-hidden.sh +++ b/rootfs/usr/local/etc/docker/init.d/01-tor-hidden.sh @@ -239,19 +239,23 @@ __update_conf_files() { # define actions if [ "$TOR_HIDDEN_ENABLED" = "yes" ]; then mkdir -p "$CONF_DIR/hidden" + mkdir -p "$DATA_DIR/hidden_service" + chmod 700 "$DATA_DIR/hidden_service" cat <"$CONF_DIR/hidden.conf" #### Default hidden dir LogMessageDomains 1 -Log notice file /data/logs/tor/hidden.log +Log notice file $LOG_DIR/hidden.log -HiddenServiceDir /data/tor/hidden_service/default +HiddenServiceDir $DATA_DIR/hidden_service/default HiddenServicePort 80 127.0.0.1:80 -%include /config/tor/hidden/*.conf +%include $CONF_DIR/hidden/*.conf EOF else exit 1 fi + [ -f "$CONF_DIR/hidden/default.conf" ] || touch "$CONF_DIR/hidden/default.conf" + # allow custom functions if builtin type -t __update_conf_files_local | grep -q 'function'; then __update_conf_files_local; fi # exit function diff --git a/rootfs/usr/local/etc/docker/init.d/01-tor-relay.sh b/rootfs/usr/local/etc/docker/init.d/01-tor-relay.sh index b7e0760..e4fcf64 100755 --- a/rootfs/usr/local/etc/docker/init.d/01-tor-relay.sh +++ b/rootfs/usr/local/etc/docker/init.d/01-tor-relay.sh @@ -242,16 +242,18 @@ __update_conf_files() { cat <"$CONF_DIR/relay.conf" ##### relay LogMessageDomains 1 -Log notice file /data/logs/tor/relay.log +Log notice file $LOG_DIR/relay.log BridgeRelay 1 PublishServerDescriptor 1 -%include /config/tor/relay/*.conf +%include $CONF_DIR/relay/*.conf EOF else exit 1 fi + [ -f "$CONF_DIR/relay/default.conf" ] || touch "$CONF_DIR/relay/default.conf" + # allow custom functions if builtin type -t __update_conf_files_local | grep -q 'function'; then __update_conf_files_local; fi # exit function 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 25f06e9..f13500a 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 @@ -241,8 +241,9 @@ __update_conf_files() { if [ "$TOR_DNS_ENABLED" = "yes" ]; then mkdir -p "$CONF_DIR/conf.d" cat <"$CONF_DIR/conf.d/dns.conf" +#### dns forwarder LogMessageDomains 1 -Log notice file /data/logs/tor/dns.log +Log notice file $LOG_DIR/dns.log DNSPort 9053 AutomapHostsOnResolve 1