From abc0734fa2d3b3d5ee1da6b699fe40fba5b9f86a Mon Sep 17 00:00:00 2001 From: panda Date: Wed, 22 Aug 2018 00:28:47 +0200 Subject: [PATCH] first commit --- Dockerfile | 26 ++++++++++++++++++++++++++ README.md | 12 +++++++++++- notes.txt | 3 +++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 notes.txt diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8d6fa7d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM debian:stretch + +ARG HiddenServiceDir="/var/lib/tor/hidden-service" +ARG HiddenServicePort="80 172.17.0.1:8000" + +RUN apt-get update && \ + apt-get install -y gpg apt-transport-https + +RUN echo "deb http://deb.torproject.org/torproject.org stretch main" > /etc/apt/sources.list.d/tor.list && \ + echo "deb-src http://deb.torproject.org/torproject.org stretch main" >> /etc/apt/sources.list.d/tor.list && \ + cd /tmp && \ + gpg --recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 && \ + gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add - + +RUN apt-get update && \ + apt-get install -y tor deb.torproject.org-keyring + +RUN echo "Log notice file /var/log/tor/notices.log" > /etc/tor/torrc && \ + echo "HiddenServiceDir ${HiddenServiceDir}" >> /etc/tor/torrc && \ + echo "HiddenServicePort ${HiddenServicePort}" >> /etc/tor/torrc && \ + mkdir ${HiddenServiceDir} && \ + chmod 700 ${HiddenServiceDir} && \ + chown debian-tor:debian-tor ${HiddenServiceDir} && \ + service tor restart + +ENTRYPOINT service tor restart && ping localhost && /bin/bash diff --git a/README.md b/README.md index 8ff4aac..a5f964f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ # Docker_Tor_HiddenService -Dockerized tor hidden service \ No newline at end of file +Dockerized tor hidden service + +##Build the image: + docker build -t torhs_dockerized . + + +##Run the image: + docker run -d --name torhs_dockerized torhs_dockerized + +##Retrieve the idden service name: + docker exec torhs_dockerized cat /var/lib/tor/hidden-service/hostname diff --git a/notes.txt b/notes.txt new file mode 100644 index 0000000..f19c0ef --- /dev/null +++ b/notes.txt @@ -0,0 +1,3 @@ +docker build -t torhs_dockerized . +docker run -d --name torhs_dockerized torhs_dockerized +docker exec torhs_dockerized cat /var/lib/tor/hidden-service/hostname