From bc6280efda8740c34f3bc0cb77382fc7a9183045 Mon Sep 17 00:00:00 2001 From: NotII <46204250+NotII@users.noreply.github.com> Date: Mon, 10 Mar 2025 18:30:55 +0000 Subject: [PATCH] rawr --- .env.tor | 12 ++++++++---- Dockerfile | 15 +++++++++------ 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.env.tor b/.env.tor index df5d15d..eb29c48 100644 --- a/.env.tor +++ b/.env.tor @@ -3,7 +3,11 @@ NEXT_PUBLIC_API_URL=/api # Flag to indicate we're running in Tor mode NEXT_PUBLIC_TOR_MODE=true -# Force relative URLs for internal API communication -SERVER_API_URL=http://localhost:3000/api -# Disable HTTPS for internal container communication -USE_HTTPS=false \ No newline at end of file +# Use relative URLs for all API communications - critical for Tor +SERVER_API_URL=/api +# Disable HTTPS for Tor communication (onion services already provide encryption) +USE_HTTPS=false +# Tor uses the same port for both internal and external communications +INTERNAL_API_PORT=3000 +# Tell the app to check for onion addresses +CHECK_ONION_ADDRESS=true \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 3173c91..1674017 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,14 +36,17 @@ COPY --from=builder /app/backend ./backend EXPOSE 3000 -# Set runtime environment variables +# Set runtime environment variables - these will be overridden by .env.tor when running in Tor mode ENV NODE_ENV=production +# Use relative URLs for maximum Tor compatibility ENV NEXT_PUBLIC_API_URL=/api -# Force server to use internal URLs (no localhost references) -ENV SERVER_API_URL=http://localhost:3000/api -# Disable HTTPS for internal container communication -ENV USE_HTTPS=false -# Ensure internal API calls for server components go to the right port +# Running in Tor mode +ENV NEXT_PUBLIC_TOR_MODE=true +# Use relative URLs for server components - critical for Tor +ENV SERVER_API_URL=/api +# Disable HTTPS for onion services (they're already encrypted) +ENV USE_HTTPS=false +# Set port for internal API calls ENV INTERNAL_API_PORT=3000 # Disable telemetry ENV NEXT_TELEMETRY_DISABLED=1