From 20d02fd326b7c10b8d8dd7eff5df9f1873903ba8 Mon Sep 17 00:00:00 2001 From: AntiTree Date: Thu, 28 Jul 2016 21:33:01 -0400 Subject: [PATCH] Finished support for hidden services and demo web app --- docker-compose.yml | 12 +++++++++++- scripts/docker-entrypoint | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 50126ac..5fb2161 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -78,12 +78,22 @@ services: - "80" environment: ROLE: HS + # This will create a hidden service that points to + # the service "web" which is runing nginx. You can + # change this to whatever ip or hostname you want TOR_HS_PORT: "80" - TOR_HS_ADDR: "127.0.0.1" + TOR_HS_ADDR: "web" volumes: - ./tor:/tor depends_on: - da1 - da2 - da3 + links: + - web + web: + image: nginx + expose: + - "80" + diff --git a/scripts/docker-entrypoint b/scripts/docker-entrypoint index d11b077..52af8b7 100755 --- a/scripts/docker-entrypoint +++ b/scripts/docker-entrypoint @@ -68,6 +68,10 @@ if [ ! -e /tor-config-done ]; then echo -e "SOCKSPort 0.0.0.0:9050" >> /etc/tor/torrc ;; HS) + # NOTE By default the HS role will point to a service running on port 80 + # but there is no service running on port 80. You can either attach to + # the container and start one, or better yet, point to another docker + # container on the network by setting the TOR_HS_ADDR to its IP echo "Setting role to HIDDENSERVICE" echo -e "HiddenServiceDir ${TOR_DIR}/${TOR_NICKNAME}/hs" >> /etc/tor/torrc if [ -z "${TOR_HS_PORT}" ]; then