diff --git a/Dockerfile b/Dockerfile index acd8bc2..4b88f41 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,7 @@ ENV RELAY_DIRPORT 9030 ENV RELAY_CTRLPORT 9051 ENV RELAY_ACCOUNTING_MAX 1 GBytes ENV RELAY_ACCOUNTING_START day 00:00 +ENV RELAY_MAX_MEM 512 MB # add group/user tor with ID RUN addgroup -g 1000 -S tor && \ diff --git a/README.md b/README.md index d947af1..e7a692e 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Docker image to setup a Tor relay with [nyx](https://nyx.torproject.org/) monito ```bash docker run -d \ --restart always \ - -v tor-relay-data:/var/lib/tor:rw + -v tor-relay-data:/home/tor/data:rw -v /etc/localtime:/etc/localtime:ro \ -p 9001:9001 \ -e RELAY_NICKNAME='ChangeMe' \ @@ -23,7 +23,7 @@ docker run -d \ ```bash docker run -d \ --restart always \ - -v tor-relay-data:/var/lib/tor:rw + -v tor-relay-data:/home/tor/data:rw -v /etc/localtime:/etc/localtime:ro \ -p 9001:9001 \ -e RELAY_TYPE='bridge' \ @@ -38,7 +38,7 @@ docker run -d \ ```bash docker run -d \ --restart always \ - -v tor-relay-data:/var/lib/tor:rw + -v tor-relay-data:/home/tor/data:rw -v /etc/localtime:/etc/localtime:ro \ -p 9001:9001 \ -e RELAY_TYPE='exit' \ @@ -64,9 +64,10 @@ docker run -d \ | **RELAY_CTRLPORT** | Default port used for control interface (ControlPort) | 9051 | | **RELAY_ACCOUNTING_MAX** | Default threshold for sent and recieve (AccountingMax) | 1 GBytes | | **RELAY_ACCOUNTING_START** | threshold rest (AccountingStart) | day 00:00 | +| **RELAY_MAX_MEM** | threshold above which Tor will stop queueing data (MaxMemInQueues) | 512 MB | ### Open nyx ```bash docker exec -it tor-relay nyx -``` +``` \ No newline at end of file diff --git a/run.sh b/run.sh index 2160f26..bb522a1 100644 --- a/run.sh +++ b/run.sh @@ -16,6 +16,7 @@ for relaytype in bridge middle exit; do sed -i "s/RELAY_CTRLPORT/${RELAY_CTRLPORT}/g" "$file" sed -i "s/RELAY_ACCOUNTING_MAX/${RELAY_ACCOUNTING_MAX}/g" "$file" sed -i "s/RELAY_ACCOUNTING_START/${RELAY_ACCOUNTING_START}/g" "$file" + sed -i "s/RELAY_MAX_MEM/${RELAY_MAX_MEM}/g" "$file" done exec tor -f "/etc/tor/torrc.${RELAY_TYPE}" \ No newline at end of file diff --git a/torrc.bridge b/torrc.bridge index ef52238..b873f07 100644 --- a/torrc.bridge +++ b/torrc.bridge @@ -191,4 +191,6 @@ BridgeRelay 1 ## mechanisms like https://bridges.torproject.org/. If you want to run ## a private bridge, for example because you'll give out your bridge ## address manually to your friends, uncomment this line: -#PublishServerDescriptor 0 \ No newline at end of file +#PublishServerDescriptor 0 + +MaxMemInQueues RELAY_MAX_MEM \ No newline at end of file diff --git a/torrc.exit b/torrc.exit index 07a14cc..7f797f3 100644 --- a/torrc.exit +++ b/torrc.exit @@ -263,4 +263,6 @@ ExitPolicy reject *:* ## mechanisms like https://bridges.torproject.org/. If you want to run ## a private bridge, for example because you'll give out your bridge ## address manually to your friends, uncomment this line: -#PublishServerDescriptor 0 \ No newline at end of file +#PublishServerDescriptor 0 + +MaxMemInQueues RELAY_MAX_MEM \ No newline at end of file diff --git a/torrc.middle b/torrc.middle index e35423a..44e5058 100644 --- a/torrc.middle +++ b/torrc.middle @@ -191,4 +191,6 @@ ExitPolicy reject *:* # no exits allowed ## mechanisms like https://bridges.torproject.org/. If you want to run ## a private bridge, for example because you'll give out your bridge ## address manually to your friends, uncomment this line: -#PublishServerDescriptor 0 \ No newline at end of file +#PublishServerDescriptor 0 + +MaxMemInQueues RELAY_MAX_MEM \ No newline at end of file