diff --git a/tor-relay/run.sh b/tor-relay/run.sh index 01caa0b..7bca985 100644 --- a/tor-relay/run.sh +++ b/tor-relay/run.sh @@ -3,13 +3,15 @@ set -e set -o pipefail for relaytype in bridge middle exit; do - sed -i 's/${RELAY_NICKNAME}/'"$RELAY_NICKNAME"'/g' "/etc/tor/torrc.$relaytype" - sed -i 's/${CONTACT_GPG_FINGERPRINT}/'"$CONTACT_GPG_FINGERPRINT"'/g' "/etc/tor/torrc.$relaytype" - sed -i 's/${CONTACT_NAME}/'"$CONTACT_NAME"'/g' "/etc/tor/torrc.$relaytype" - 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" + file="/etc/tor/torrc.${relaytype}" + + sed -i "s/RELAY_NICKNAME/${RELAY_NICKNAME}/g" "$file" + sed -i "s/CONTACT_GPG_FINGERPRINT/${CONTACT_GPG_FINGERPRINT}/g" "$file" + sed -i "s/CONTACT_NAME/${CONTACT_NAME}/g" "$file" + sed -i "s/CONTACT_EMAIL/${CONTACT_EMAIL}/g" "$file" + sed -i "s/RELAY_BANDWIDTH_RATE/${RELAY_BANDWIDTH_RATE}/g" "$file" + sed -i "s/RELAY_BANDWIDTH_BURST/${RELAY_BANDWIDTH_BURST}/g" "$file" + sed -i "s/RELAY_PORT/${RELAY_PORT}/g" "$file" done exec tor -f "/etc/tor/torrc.${RELAY_TYPE}" diff --git a/tor-relay/torrc.bridge b/tor-relay/torrc.bridge index a77ef0d..80ede79 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 ${RELAY_PORT} +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 @@ -97,7 +97,7 @@ ORPort ${RELAY_PORT} # OutboundBindAddress 10.0.0.5 ## A handle for your relay, so people don't have to refer to it by key. -Nickname ${RELAY_NICKNAME} +Nickname RELAY_NICKNAME ## Define these to limit how much relayed traffic you will allow. Your ## own traffic is still unthrottled. Note that RelayBandwidthRate must @@ -107,8 +107,8 @@ Nickname ${RELAY_NICKNAME} ## 2^20, etc. #RelayBandwidthRate 100 KBytes # Throttle traffic to 100KB/s (800Kbps) #RelayBandwidthBurst 200 KBytes # But allow bursts up to 200KB (1600Kb) -RelayBandwidthRate ${RELAY_BANDWIDTH_RATE} -RelayBandwidthBurst ${RELAY_BANDWIDTH_BURST} +RelayBandwidthRate RELAY_BANDWIDTH_RATE +RelayBandwidthBurst RELAY_BANDWIDTH_BURST ## Use these to restrict the maximum traffic per day, week, or month. ## Note that this threshold applies separately to sent and received bytes, @@ -131,7 +131,7 @@ RelayBandwidthBurst ${RELAY_BANDWIDTH_BURST} ## it's an email address and/or generate a new address for this purpose. #ContactInfo Random Person ## You might also include your PGP or GPG fingerprint if you have one: -ContactInfo ${CONTACT_GPG_FINGERPRINT} ${CONTACT_NAME} ${CONTACT_EMAIL} +ContactInfo CONTACT_GPG_FINGERPRINT CONTACT_NAME CONTACT_EMAIL ## Uncomment this to mirror directory information for others. Please do ## if you have enough bandwidth. diff --git a/tor-relay/torrc.exit b/tor-relay/torrc.exit index bab1bbf..2a41d20 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 ${RELAY_PORT} +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 @@ -97,7 +97,7 @@ ORPort ${RELAY_PORT} # OutboundBindAddress 10.0.0.5 ## A handle for your relay, so people don't have to refer to it by key. -Nickname ${RELAY_NICKNAME} +Nickname RELAY_NICKNAME ## Define these to limit how much relayed traffic you will allow. Your ## own traffic is still unthrottled. Note that RelayBandwidthRate must @@ -107,8 +107,8 @@ Nickname ${RELAY_NICKNAME} ## 2^20, etc. #RelayBandwidthRate 100 KBytes # Throttle traffic to 100KB/s (800Kbps) #RelayBandwidthBurst 200 KBytes # But allow bursts up to 200KB (1600Kb) -RelayBandwidthRate ${RELAY_BANDWIDTH_RATE} -RelayBandwidthBurst ${RELAY_BANDWIDTH_BURST} +RelayBandwidthRate RELAY_BANDWIDTH_RATE +RelayBandwidthBurst RELAY_BANDWIDTH_BURST ## Use these to restrict the maximum traffic per day, week, or month. ## Note that this threshold applies separately to sent and received bytes, @@ -131,7 +131,7 @@ RelayBandwidthBurst ${RELAY_BANDWIDTH_BURST} ## it's an email address and/or generate a new address for this purpose. #ContactInfo Random Person ## You might also include your PGP or GPG fingerprint if you have one: -ContactInfo ${CONTACT_GPG_FINGERPRINT} ${CONTACT_NAME} ${CONTACT_EMAIL} +ContactInfo CONTACT_GPG_FINGERPRINT CONTACT_NAME CONTACT_EMAIL ## Uncomment this to mirror directory information for others. Please do ## if you have enough bandwidth. diff --git a/tor-relay/torrc.middle b/tor-relay/torrc.middle index 4c2fe19..27583ae 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 ${RELAY_PORT} +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 @@ -97,7 +97,7 @@ ORPort ${RELAY_PORT} # OutboundBindAddress 10.0.0.5 ## A handle for your relay, so people don't have to refer to it by key. -Nickname ${RELAY_NICKNAME} +Nickname RELAY_NICKNAME ## Define these to limit how much relayed traffic you will allow. Your ## own traffic is still unthrottled. Note that RelayBandwidthRate must @@ -107,8 +107,8 @@ Nickname ${RELAY_NICKNAME} ## 2^20, etc. #RelayBandwidthRate 100 KBytes # Throttle traffic to 100KB/s (800Kbps) #RelayBandwidthBurst 200 KBytes # But allow bursts up to 200KB (1600Kb) -RelayBandwidthRate ${RELAY_BANDWIDTH_RATE} -RelayBandwidthBurst ${RELAY_BANDWIDTH_BURST} +RelayBandwidthRate RELAY_BANDWIDTH_RATE +RelayBandwidthBurst RELAY_BANDWIDTH_BURST ## Use these to restrict the maximum traffic per day, week, or month. ## Note that this threshold applies separately to sent and received bytes, @@ -131,7 +131,7 @@ RelayBandwidthBurst ${RELAY_BANDWIDTH_BURST} ## it's an email address and/or generate a new address for this purpose. #ContactInfo Random Person ## You might also include your PGP or GPG fingerprint if you have one: -ContactInfo ${CONTACT_GPG_FINGERPRINT} ${CONTACT_NAME} ${CONTACT_EMAIL} +ContactInfo CONTACT_GPG_FINGERPRINT CONTACT_NAME CONTACT_EMAIL ## Uncomment this to mirror directory information for others. Please do ## if you have enough bandwidth.