From 9c65411bb584b93bcd4b88fd33c68c9b99f370a2 Mon Sep 17 00:00:00 2001 From: blade Date: Sun, 1 Mar 2026 21:38:14 -0500 Subject: [PATCH] fix: update tor/yggdrasil runtime configuration --- Dockerfile | 11 +++++++++-- docker-compose.yml | 6 ++---- entrypoint.sh | 2 +- tor | 2 +- torrc | 4 +++- yggdrasil.conf | 4 ++-- 6 files changed, 18 insertions(+), 11 deletions(-) mode change 100755 => 100644 torrc diff --git a/Dockerfile b/Dockerfile index 807b63d..9c30974 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,11 @@ ARG UBUNTU_VERSION=24.04 # === STAGE 1: Build Yggdrasil from source === -FROM ubuntu:${UBUNTU_VERSION} as builder_yggdrasil +FROM --platform=$BUILDPLATFORM ubuntu:${UBUNTU_VERSION} as builder_yggdrasil ARG YGGDRASIL_VERSION=v0.5.12 +ARG BUILDPLATFORM +ARG TARGETPLATFORM +ARG TARGETARCH # Install build dependencies RUN DEBIAN_FRONTEND=noninteractive \ @@ -27,6 +30,8 @@ RUN ./build # === STAGE 2: Runtime environment === FROM ubuntu:${UBUNTU_VERSION} +ARG TARGETARCH + # Install runtime dependencies RUN DEBIAN_FRONTEND=noninteractive \ apt-get update && \ @@ -74,6 +79,8 @@ COPY --from=builder_yggdrasil /BUILD_YGGDRASIL/yggdrasil-go/genkeys . COPY ./yggdrasil.conf . # === TOR PROXY SETUP === +# DNSPort +EXPOSE 9053 # SOCKS5 proxy port EXPOSE 9050 EXPOSE 8118 @@ -86,4 +93,4 @@ COPY ./entrypoint.sh /entrypoint.sh # Make entrypoint executable RUN chmod +x /entrypoint.sh # Default container command -ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file +ENTRYPOINT ["/entrypoint.sh"] diff --git a/docker-compose.yml b/docker-compose.yml index ea4dd20..3a71c44 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: "3.8" - services: tor_yggdrasil: image: tor_yggdrasil:latest @@ -12,7 +10,7 @@ services: - /dev/net/tun:/dev/net/tun # TUN device for Yggdrasil network interface ports: - "127.0.0.1:9050:9050/tcp" # SOCKS5 proxy port (Tor) for application-level traffic - - "10654:10654/tcp" # Yggdrasil peer connections + - "10655:10655/tcp" # Yggdrasil peer connections environment: - YGGDRASIL_GENERATE_KEYS=true # Generate new Yggdrasil keys on startup - restart: unless-stopped # Auto-restart unless manually stopped \ No newline at end of file + restart: unless-stopped # Auto-restart unless manually stopped diff --git a/entrypoint.sh b/entrypoint.sh index 21c3780..1c6ac64 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -70,4 +70,4 @@ log "One of the services has stopped. Initiating shutdown sequence..." # Graceful termination kill $YGG_PID $TOR_PID 2>/dev/null || true # Return the exit code of the failed process -exit $? \ No newline at end of file +exit $? diff --git a/tor b/tor index 192b289..f45d53a 100644 --- a/tor +++ b/tor @@ -3,4 +3,4 @@ CLEANUP_OLD_COREFILES=y if [ -e /etc/default/tor.vidalia ] && [ -x /usr/bin/vidalia ]; then . /etc/default/tor.vidalia -fi \ No newline at end of file +fi diff --git a/torrc b/torrc old mode 100755 new mode 100644 index 78c87ab..092885b --- a/torrc +++ b/torrc @@ -1,3 +1,5 @@ +# Listen on all interfaces so other containers can reach us +DNSPort 0.0.0.0:9053 SocksPort 0.0.0.0:9050 ClientTransportPlugin obfs4 exec /usr/bin/obfs4proxy @@ -7,4 +9,4 @@ Bridge [21f:5234:5548:31e5:a334:854b:5752:f4fc]:9770 6C4C89ABE4D06987AB1F51C0693 Bridge [224:6723:7ae0:5655:e600:51c9:4300:a2fb]:9001 F873E91048B40656694BE94ACAB6F0D32CAF8E17 Bridge obfs4 [218:4feb:a509:9db2:2b34:6e7e:e071:5dee]:1992 F805F6B4E5E203EFE2A7FFB1E5042AFE8BD986B4 cert=0GcjnEnZ0rJ8/nfxo4ZSkjMZ0fqHSrvj/MdwEtbbuzx8qgqFTaqHTuWelGw2MxJ5wW2QaQ iat-mode=0 -UseBridges 1 \ No newline at end of file +UseBridges 1 diff --git a/yggdrasil.conf b/yggdrasil.conf index db45fc3..36d95d7 100644 --- a/yggdrasil.conf +++ b/yggdrasil.conf @@ -17,7 +17,7 @@ # here. Each listener should be specified in URI format as above, e.g. # tls://0.0.0.0:0 or tls://[::]:0 to listen on all interfaces. Listen: [ - tls://[::]:10654 + tls://[::]:10655 ] # Listen address for admin connections. Default is to listen for local @@ -79,4 +79,4 @@ # or set as null. This is entirely optional but, if set, is visible # to the whole network on request. NodeInfo: {} -} \ No newline at end of file +}