Skip to content

Commit

Permalink
add support for per-instance configuration of RelayBandwidthRate/Rela…
Browse files Browse the repository at this point in the history
…yBandwidthBurst
  • Loading branch information
nusenu committed Feb 17, 2018
1 parent a1e204f commit 1b2f2fa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,28 @@ All variables mentioned here are optional.
- If you want to run a mixed server (exit and non-exit tor instances) use `tor_ExitRelaySetting_file` for per-instance configuration in additon to this var
- default: False

* `tor_ExitRelaySetting_file`
- this is a simple comma separated csv file stored on the ansible control machine defining the `ExitRelay` torrc setting for each instance (instead of server-wide)
* `tor_ExitRelaySetting_file` /path/to/file
- this is a simple comma separated csv file stored on the ansible control machine defining the `ExitRelay` torrc setting for each tor instance (instead of server-wide)
- first column: instance identifier (inventory_hostname-ip_orport)
- second column: "exit" for exit tor instances, any other value (including empty) for non-exit tor instances
- this var is ignored if tor_ExitRelay is False

* `tor_RelayBandwidthRate_file` /path/to/file
- this is a simple comma separated csv file stored on the ansible control machine defining the `RelayBandwidthRate` torrc setting for each tor instance (instead of server-wide)
- first column: instance identifier (inventory_hostname-ip_orport)
- second column: value as accepted by `RelayBandwidthRate` (see tor manpage)

* `tor_RelayBandwidthBurst_file` /path/to/file
- this is a simple comma separated csv file stored on the ansible control machine defining the `RelayBandwidthBurst` torrc setting for each tor instance (instead of server-wide)
- first column: instance identifier (inventory_hostname-ip_orport)
- second column: value as accepted by `RelayBandwidthBurst` (see tor manpage)

* `tor_ExitNoticePage` boolean
- specifies whether we display the default tor exit notice [html page](https://gitweb.torproject.org/tor.git/plain/contrib/operator-tools/tor-exit-notice.html) on the DirPort
- only relevant if we are an exit relay
- default: True

* `tor_exit_notice_file`
* `tor_exit_notice_file` /path/to/file
- path to a HTML file on the control machine that you would like to display (via the DirPort) instead of the default [tor-exit-notice.html](https://gitweb.torproject.org/tor.git/plain/contrib/operator-tools/tor-exit-notice.html) provided by the Tor Project
- only relevant if we are an exit relay and if tor_ExitNoticePage is True

Expand Down
8 changes: 6 additions & 2 deletions templates/torrc
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,14 @@ SafeLogging {{ tor_SafeLogging }}
{% if tor_MaxAdvertisedBandwidth is defined %}
MaxAdvertisedBandwidth {{ tor_MaxAdvertisedBandwidth }}
{% endif %}
{% if tor_RelayBandwidthRate is defined %}
{% if tor_RelayBandwidthRate_file is defined %}
RelayBandwidthRate {{ lookup('csvfile', inventory_hostname~'-'~item.0.ipv4~'_'~item.1.orport~' file='~tor_RelayBandwidthRate_file~' delimiter=,') }}
{% elif tor_RelayBandwidthRate is defined %}
RelayBandwidthRate {{ tor_RelayBandwidthRate }}
{% endif %}
{% if tor_RelayBandwidthBurst is defined %}
{% if tor_RelayBandwidthBurst_file is defined %}
RelayBandwidthBurst {{ lookup('csvfile', inventory_hostname~'-'~item.0.ipv4~'_'~item.1.orport~' file='~tor_RelayBandwidthBurst_file~' delimiter=,') }}
{% elif tor_RelayBandwidthBurst is defined %}
RelayBandwidthBurst {{ tor_RelayBandwidthBurst }}
{% endif %}
{% if tor_PerConnBWRate is defined %}
Expand Down

0 comments on commit 1b2f2fa

Please sign in to comment.