Skip to content

Add support for custom torrc configurations#9

Open
pluja wants to merge 1 commit into
hundehausen:mainfrom
pluja:main
Open

Add support for custom torrc configurations#9
pluja wants to merge 1 commit into
hundehausen:mainfrom
pluja:main

Conversation

@pluja
Copy link
Copy Markdown

@pluja pluja commented Aug 8, 2025

Hi, first off, thank you for maintaining this great project!

I needed to use some custom configurations in the torrc, and I thought it would be nice to have an option to directly configure it via environment variables, so I made a few changes to the entrypoint script to implement that. I also made a few other small changes to the script (added functions, etc), please do check it and test it (I have tested it myself, and it works fine for me).

Basically, new env variables are accepted with the format TORRC_[CONFIG] (for globally applied torrc options) or TORRC_[SERVICE_NAME]_[CONFIG] for service-specific configurations. Here's an example:

docker run -d --name tor-hidden-service \
  -e HS_WEB=web-container:80:80 \
  -e HS_API=api-container:8080:80 \
  -e TORRC_MaxCircuitDirtiness=600 \
  -e TORRC_NewCircuitPeriod=30 \
  -e TORRC_WEB_HiddenServiceMaxStreams=10 \
  -e TORRC_API_HiddenServiceMaxStreams=5 \
  ghcr.io/hundehausen/tor-hidden-service:latest

This would apply the first two configurations globally, and the last two to their respective services.

Tell me if you want me to change anything or any question. Feel free to close the PR if it's out of the scope of the project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant