-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for AccountingMax and AccountingStart
- Loading branch information
Showing
17 changed files
with
63 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
*~ | ||
tor-data/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# Tor relay image builder | ||
# Copyright (C) 2017 Rodrigo Martínez <[email protected]> | ||
# Copyright (C) 2017-2018 Rodrigo Martínez <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# Dockerfile generator for a Tor relay image | ||
# Copyright (C) 2017 Rodrigo Martínez <[email protected]> | ||
# Copyright (C) 2017-2018 Rodrigo Martínez <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
@@ -26,7 +26,7 @@ TOR_VERSION=$(cat TOR_VERSION) | |
if [ "$2" == "tor-relay" ]; then | ||
cat <<EOF | ||
# Tor relay from source | ||
# Copyright (C) 2017 Rodrigo Martínez <[email protected]> | ||
# Copyright (C) 2017-2018 Rodrigo Martínez <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
@@ -96,7 +96,7 @@ fi | |
if [ "$2" == "tor-relay-arm" ]; then | ||
cat <<EOF | ||
# Tor relay from source with ARM (Anonymizing Relay Monitor) | ||
# Copyright (C) 2017 Rodrigo Martínez <[email protected]> | ||
# Copyright (C) 2017-2018 Rodrigo Martínez <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# Tor relay entrypoint | ||
# Copyright (C) 2017 Rodrigo Martínez <[email protected]> | ||
# Copyright (C) 2017-2018 Rodrigo Martínez <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
@@ -16,7 +16,7 @@ | |
|
||
if [ "$(whoami)" == "root" ]; then | ||
useradd -s /bin/bash -u $HOST_UID tor 2> /dev/null | ||
|
||
if [ $? -eq 0 ]; then | ||
echo -e "export NICKNAME='${NICKNAME:-NotProvided}'\n\ | ||
export CONTACT_INFO='${CONTACT_INFO:-NotProvided}'\n\ | ||
|
@@ -25,10 +25,12 @@ export DIR_PORT='${DIR_PORT:-9030}'\n\ | |
export CONTROL_PORT='${CONTROL_PORT:-9051}'\n\ | ||
export BANDWIDTH_RATE='${BANDWIDTH_RATE:-1 MBits}'\n\ | ||
export BANDWIDTH_BURST='${BANDWIDTH_BURST:-2 MBits}'\n\ | ||
export MAX_MEM='${MAX_MEM:-512 MB}'" > /home/tor/env.sh \ | ||
export MAX_MEM='${MAX_MEM:-512 MB}'\n\ | ||
export ACCOUNTING_MAX='${ACCOUNTING_MAX:-0}'\n\ | ||
export ACCOUNTING_START='${ACCOUNTING_START:-month 1 00:00}'" > /home/tor/env.sh \ | ||
&& chown -R tor:tor /home/tor | ||
fi | ||
|
||
su -c "/entrypoint.sh $1" - tor | ||
exit | ||
fi | ||
|
@@ -45,7 +47,9 @@ Nickname $NICKNAME\n\ | |
ContactInfo $CONTACT_INFO\n\ | ||
RelayBandwidthRate $BANDWIDTH_RATE\n\ | ||
RelayBandwidthBurst $BANDWIDTH_BURST\n\ | ||
MaxMemInQueues $MAX_MEM" > $CONF_FILE | ||
MaxMemInQueues $MAX_MEM\n\ | ||
AccountingMax $ACCOUNTING_MAX\n\ | ||
AccountingStart $ACCOUNTING_START" > $CONF_FILE | ||
|
||
if [ "$1" == "middle" ]; then | ||
echo -e "ExitRelay 0\n\ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# Tor relay Dockerfile generator | ||
# Copyright (C) 2017 Rodrigo Martínez <[email protected]> | ||
# Copyright (C) 2017-2018 Rodrigo Martínez <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# Tor relay launcher | ||
# Copyright (C) 2017 Rodrigo Martínez <[email protected]> | ||
# Copyright (C) 2017-2018 Rodrigo Martínez <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
@@ -28,8 +28,10 @@ [email protected] | |
BANDWIDTH_RATE="250 KBytes" | ||
BANDWIDTH_BURST="500 KBytes" | ||
MAX_MEM="512 MB" | ||
ACCOUNTING_MAX="0" | ||
ACCOUNTING_START="month 1 00:00" | ||
|
||
docker run -d \ | ||
docker run -id \ | ||
-p $OR_PORT:$OR_PORT \ | ||
-p $DIR_PORT:$DIR_PORT \ | ||
-e "OR_PORT=$OR_PORT" \ | ||
|
@@ -39,6 +41,8 @@ docker run -d \ | |
-e "BANDWIDTH_RATE=$BANDWIDTH_RATE" \ | ||
-e "BANDWIDTH_BURST=$BANDWIDTH_BURST" \ | ||
-e "MAX_MEM=$MAX_MEM" \ | ||
-e "ACCOUNTING_MAX=$ACCOUNTING_MAX" \ | ||
-e "ACCOUNTING_START=$ACCOUNTING_START" \ | ||
-e "HOST_UID=$UID" \ | ||
-v $(pwd)/tor-data:/home/tor/data:Z \ | ||
--name tor-$2-relay $1 $2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Tor relay from source with ARM (Anonymizing Relay Monitor) | ||
# Copyright (C) 2017 Rodrigo Martínez <[email protected]> | ||
# Copyright (C) 2017-2018 Rodrigo Martínez <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Tor relay from source with ARM (Anonymizing Relay Monitor) | ||
# Copyright (C) 2017 Rodrigo Martínez <[email protected]> | ||
# Copyright (C) 2017-2018 Rodrigo Martínez <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Tor relay from source with ARM (Anonymizing Relay Monitor) | ||
# Copyright (C) 2017 Rodrigo Martínez <[email protected]> | ||
# Copyright (C) 2017-2018 Rodrigo Martínez <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Tor relay from source | ||
# Copyright (C) 2017 Rodrigo Martínez <[email protected]> | ||
# Copyright (C) 2017-2018 Rodrigo Martínez <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# Tor relay entrypoint | ||
# Copyright (C) 2017 Rodrigo Martínez <[email protected]> | ||
# Copyright (C) 2017-2018 Rodrigo Martínez <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
@@ -16,7 +16,7 @@ | |
|
||
if [ "$(whoami)" == "root" ]; then | ||
useradd -s /bin/bash -u $HOST_UID tor 2> /dev/null | ||
|
||
if [ $? -eq 0 ]; then | ||
echo -e "export NICKNAME='${NICKNAME:-NotProvided}'\n\ | ||
export CONTACT_INFO='${CONTACT_INFO:-NotProvided}'\n\ | ||
|
@@ -25,10 +25,12 @@ export DIR_PORT='${DIR_PORT:-9030}'\n\ | |
export CONTROL_PORT='${CONTROL_PORT:-9051}'\n\ | ||
export BANDWIDTH_RATE='${BANDWIDTH_RATE:-1 MBits}'\n\ | ||
export BANDWIDTH_BURST='${BANDWIDTH_BURST:-2 MBits}'\n\ | ||
export MAX_MEM='${MAX_MEM:-512 MB}'" > /home/tor/env.sh \ | ||
export MAX_MEM='${MAX_MEM:-512 MB}'\n\ | ||
export ACCOUNTING_MAX='${ACCOUNTING_MAX:-0}'\n\ | ||
export ACCOUNTING_START='${ACCOUNTING_START:-month 1 00:00}'" > /home/tor/env.sh \ | ||
&& chown -R tor:tor /home/tor | ||
fi | ||
|
||
su -c "/entrypoint.sh $1" - tor | ||
exit | ||
fi | ||
|
@@ -45,7 +47,9 @@ Nickname $NICKNAME\n\ | |
ContactInfo $CONTACT_INFO\n\ | ||
RelayBandwidthRate $BANDWIDTH_RATE\n\ | ||
RelayBandwidthBurst $BANDWIDTH_BURST\n\ | ||
MaxMemInQueues $MAX_MEM" > $CONF_FILE | ||
MaxMemInQueues $MAX_MEM\n\ | ||
AccountingMax $ACCOUNTING_MAX\n\ | ||
AccountingStart $ACCOUNTING_START" > $CONF_FILE | ||
|
||
if [ "$1" == "middle" ]; then | ||
echo -e "ExitRelay 0\n\ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Tor relay from source | ||
# Copyright (C) 2017 Rodrigo Martínez <[email protected]> | ||
# Copyright (C) 2017-2018 Rodrigo Martínez <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# Tor relay entrypoint | ||
# Copyright (C) 2017 Rodrigo Martínez <[email protected]> | ||
# Copyright (C) 2017-2018 Rodrigo Martínez <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
@@ -16,7 +16,7 @@ | |
|
||
if [ "$(whoami)" == "root" ]; then | ||
useradd -s /bin/bash -u $HOST_UID tor 2> /dev/null | ||
|
||
if [ $? -eq 0 ]; then | ||
echo -e "export NICKNAME='${NICKNAME:-NotProvided}'\n\ | ||
export CONTACT_INFO='${CONTACT_INFO:-NotProvided}'\n\ | ||
|
@@ -25,10 +25,12 @@ export DIR_PORT='${DIR_PORT:-9030}'\n\ | |
export CONTROL_PORT='${CONTROL_PORT:-9051}'\n\ | ||
export BANDWIDTH_RATE='${BANDWIDTH_RATE:-1 MBits}'\n\ | ||
export BANDWIDTH_BURST='${BANDWIDTH_BURST:-2 MBits}'\n\ | ||
export MAX_MEM='${MAX_MEM:-512 MB}'" > /home/tor/env.sh \ | ||
export MAX_MEM='${MAX_MEM:-512 MB}'\n\ | ||
export ACCOUNTING_MAX='${ACCOUNTING_MAX:-0}'\n\ | ||
export ACCOUNTING_START='${ACCOUNTING_START:-month 1 00:00}'" > /home/tor/env.sh \ | ||
&& chown -R tor:tor /home/tor | ||
fi | ||
|
||
su -c "/entrypoint.sh $1" - tor | ||
exit | ||
fi | ||
|
@@ -45,7 +47,9 @@ Nickname $NICKNAME\n\ | |
ContactInfo $CONTACT_INFO\n\ | ||
RelayBandwidthRate $BANDWIDTH_RATE\n\ | ||
RelayBandwidthBurst $BANDWIDTH_BURST\n\ | ||
MaxMemInQueues $MAX_MEM" > $CONF_FILE | ||
MaxMemInQueues $MAX_MEM\n\ | ||
AccountingMax $ACCOUNTING_MAX\n\ | ||
AccountingStart $ACCOUNTING_START" > $CONF_FILE | ||
|
||
if [ "$1" == "middle" ]; then | ||
echo -e "ExitRelay 0\n\ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Tor relay from source | ||
# Copyright (C) 2017 Rodrigo Martínez <[email protected]> | ||
# Copyright (C) 2017-2018 Rodrigo Martínez <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# Tor relay entrypoint | ||
# Copyright (C) 2017 Rodrigo Martínez <[email protected]> | ||
# Copyright (C) 2017-2018 Rodrigo Martínez <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
@@ -16,7 +16,7 @@ | |
|
||
if [ "$(whoami)" == "root" ]; then | ||
useradd -s /bin/bash -u $HOST_UID tor 2> /dev/null | ||
|
||
if [ $? -eq 0 ]; then | ||
echo -e "export NICKNAME='${NICKNAME:-NotProvided}'\n\ | ||
export CONTACT_INFO='${CONTACT_INFO:-NotProvided}'\n\ | ||
|
@@ -25,10 +25,12 @@ export DIR_PORT='${DIR_PORT:-9030}'\n\ | |
export CONTROL_PORT='${CONTROL_PORT:-9051}'\n\ | ||
export BANDWIDTH_RATE='${BANDWIDTH_RATE:-1 MBits}'\n\ | ||
export BANDWIDTH_BURST='${BANDWIDTH_BURST:-2 MBits}'\n\ | ||
export MAX_MEM='${MAX_MEM:-512 MB}'" > /home/tor/env.sh \ | ||
export MAX_MEM='${MAX_MEM:-512 MB}'\n\ | ||
export ACCOUNTING_MAX='${ACCOUNTING_MAX:-0}'\n\ | ||
export ACCOUNTING_START='${ACCOUNTING_START:-month 1 00:00}'" > /home/tor/env.sh \ | ||
&& chown -R tor:tor /home/tor | ||
fi | ||
|
||
su -c "/entrypoint.sh $1" - tor | ||
exit | ||
fi | ||
|
@@ -45,7 +47,9 @@ Nickname $NICKNAME\n\ | |
ContactInfo $CONTACT_INFO\n\ | ||
RelayBandwidthRate $BANDWIDTH_RATE\n\ | ||
RelayBandwidthBurst $BANDWIDTH_BURST\n\ | ||
MaxMemInQueues $MAX_MEM" > $CONF_FILE | ||
MaxMemInQueues $MAX_MEM\n\ | ||
AccountingMax $ACCOUNTING_MAX\n\ | ||
AccountingStart $ACCOUNTING_START" > $CONF_FILE | ||
|
||
if [ "$1" == "middle" ]; then | ||
echo -e "ExitRelay 0\n\ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# Tor relay updater | ||
# Copyright (C) 2017 Rodrigo Martínez <[email protected]> | ||
# Copyright (C) 2017-2018 Rodrigo Martínez <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|