From a93126ad5f521d57abb5ccd3984753a1de667fd7 Mon Sep 17 00:00:00 2001 From: lance Date: Mon, 23 Mar 2020 00:11:25 -0700 Subject: [PATCH] setup simple tor bridge, document in readme --- README.md | 12 ++++++++++++ torsocks/Dockerfile | 15 +++++++++++++++ torsocks/torrc | 14 ++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 torsocks/Dockerfile create mode 100644 torsocks/torrc diff --git a/README.md b/README.md index bee7517..3491a3d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,15 @@ # bones Simple IRC bot written in Rust as a learning exercise. Uses the [irc](https://docs.rs/irc) crate. + + +## Notes + +``` +docker build -t torsocks torsocks +docker run --name torsocks --rm -d -p 9050:9050 torsocks +mkdir -p certs +openssl req -nodes -newkey rsa:2048 -keyout certs/lza_rustbot.pem -x509 -days 3650 -out certs/lza_rustbot.crt -subj "/CN=lza_rustbot" +openssl x509 -sha1 -noout -fingerprint -in certs/lza_rustbot.crt | sed -e 's/^.*=//;s/://g' +docker-compose up -d +``` diff --git a/torsocks/Dockerfile b/torsocks/Dockerfile new file mode 100644 index 0000000..d6df836 --- /dev/null +++ b/torsocks/Dockerfile @@ -0,0 +1,15 @@ +FROM ubuntu:19.10 + +RUN apt update && apt install tor -y + +RUN mkdir -p /run/tor \ + && chown -R debian-tor:debian-tor /run/tor \ + && chmod 700 -R /run/tor + +COPY torrc /etc/tor/torrc + +USER debian-tor + +EXPOSE 9050 + +ENTRYPOINT ["tor"] diff --git a/torsocks/torrc b/torsocks/torrc new file mode 100644 index 0000000..5e8f91b --- /dev/null +++ b/torsocks/torrc @@ -0,0 +1,14 @@ +BridgeRelay 1 +ControlSocket /run/tor/control +ControlSocketsGroupWritable 1 +CookieAuthentication 1 +CookieAuthFileGroupReadable 1 +CookieAuthFile /run/tor/control.authcookie +DataDirectory /var/lib/tor +ExitPolicy reject6 *:*, reject *:* +ExitRelay 0 +IPv6Exit 0 +Log notice stdout +ORPort 9001 +PublishServerDescriptor 0 +SOCKSPort 0.0.0.0:9050