From f9d4e19828b33ba01ffcfb345195407edcb53324 Mon Sep 17 00:00:00 2001 From: Aaron Ten Clay Date: Sun, 17 Jun 2018 10:23:31 -0700 Subject: [PATCH] Make tor-relay run.sh executable by all users (#387) * Make tor-relay run.sh executable by all users * Add configuration for tor-relay --- tor-relay/Dockerfile | 3 ++- tor-relay/run.sh | 1 + tor-relay/torrc.bridge | 2 +- tor-relay/torrc.exit | 2 +- tor-relay/torrc.middle | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tor-relay/Dockerfile b/tor-relay/Dockerfile index a28125b..e55a25e 100644 --- a/tor-relay/Dockerfile +++ b/tor-relay/Dockerfile @@ -34,13 +34,14 @@ COPY torrc.exit /etc/tor/torrc.exit # copy the run script COPY run.sh /run.sh -RUN chmod u+rwx /run.sh +RUN chmod ugo+rx /run.sh # default environment variables ENV RELAY_NICKNAME hacktheplanet ENV RELAY_TYPE middle ENV RELAY_BANDWIDTH_RATE 100 KBytes ENV RELAY_BANDWIDTH_BURST 200 KBytes +ENV RELAY_PORT 9001 # make sure files are owned by tor user RUN chown -R tor /etc/tor diff --git a/tor-relay/run.sh b/tor-relay/run.sh index f0b8efb..08a3a9d 100644 --- a/tor-relay/run.sh +++ b/tor-relay/run.sh @@ -9,6 +9,7 @@ for relaytype in bridge middle exit; do sed -i 's/${CONTACT_EMAIL}/'"$CONTACT_EMAIL"'/g' "/etc/tor/torrc.$relaytype" sed -i 's/${RELAY_BANDWIDTH_RATE}/'"$RELAY_BANDWIDTH_RATE"'/g' "/etc/tor/torrc.$relaytype" sed -i 's/${RELAY_BANDWIDTH_BURST}/'"$RELAY_BANDWIDTH_BURST"'/g' "/etc/tor/torrc.$relaytype" + sed -i 's/${RELAY_PORT}/'"$RELAY_PORT"'/g' "/etc/tor/torrc.$relaytype" done exec tor -f /etc/tor/torrc.${RELAY_TYPE} diff --git a/tor-relay/torrc.bridge b/tor-relay/torrc.bridge index 9361842..6d85d2d 100644 --- a/tor-relay/torrc.bridge +++ b/tor-relay/torrc.bridge @@ -80,7 +80,7 @@ ## See https://www.torproject.org/docs/tor-doc-relay for details. ## Required: what port to advertise for incoming Tor connections. -ORPort 9001 +ORPort ${RELAY_PORT} ## If you want to listen on a port other than the one advertised in ## ORPort (e.g. to advertise 443 but bind to 9090), you can do it as ## follows. You'll need to do ipchains or other port forwarding diff --git a/tor-relay/torrc.exit b/tor-relay/torrc.exit index 3f5e8ac..bab1bbf 100644 --- a/tor-relay/torrc.exit +++ b/tor-relay/torrc.exit @@ -80,7 +80,7 @@ ## See https://www.torproject.org/docs/tor-doc-relay for details. ## Required: what port to advertise for incoming Tor connections. -ORPort 9001 +ORPort ${RELAY_PORT} ## If you want to listen on a port other than the one advertised in ## ORPort (e.g. to advertise 443 but bind to 9090), you can do it as ## follows. You'll need to do ipchains or other port forwarding diff --git a/tor-relay/torrc.middle b/tor-relay/torrc.middle index 528d4c3..4c2fe19 100644 --- a/tor-relay/torrc.middle +++ b/tor-relay/torrc.middle @@ -80,7 +80,7 @@ ## See https://www.torproject.org/docs/tor-doc-relay for details. ## Required: what port to advertise for incoming Tor connections. -ORPort 9001 +ORPort ${RELAY_PORT} ## If you want to listen on a port other than the one advertised in ## ORPort (e.g. to advertise 443 but bind to 9090), you can do it as ## follows. You'll need to do ipchains or other port forwarding