Bob Mottram 8 лет назад
Родитель
Сommit
109d6bf848
1 измененных файлов: 7 добавлений и 0 удалений
  1. 7
    0
      src/freedombone-utils-onion

+ 7
- 0
src/freedombone-utils-onion Просмотреть файл

@@ -28,6 +28,9 @@
28 28
 # You should have received a copy of the GNU Affero General Public License
29 29
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
30 30
 
31
+# The maximum amount of traffic per day in gigabytes
32
+TOR_MAX_TRAFFIC_PER_DAY_GB=3
33
+
31 34
 function add_email_hostname {
32 35
     extra_email_hostname="$1"
33 36
     email_hostnames=$(cat /etc/exim4/update-exim4.conf.conf | grep "dc_other_hostnames" | awk -F "'" '{print $2}')
@@ -287,6 +290,10 @@ function install_tor {
287 290
     sed -i 's|#Log notice file.*|Log notice file /dev/null|g' /etc/tor/torrc
288 291
     sed -i 's|Log notice file.*|Log notice file /dev/null|g' /etc/tor/torrc
289 292
 
293
+    # Restrict traffic
294
+    sed -i "s|#AccountingMax.*|AccountingMax $TOR_MAX_TRAFFIC_PER_DAY_GB GBytes|g" /etc/tor/torrc
295
+    sed -i "s|AccountingMax.*|AccountingMax $TOR_MAX_TRAFFIC_PER_DAY_GB GBytes|g" /etc/tor/torrc
296
+
290 297
     mark_completed $FUNCNAME
291 298
 }
292 299