security/tor: allow to enable directory page (#858)

This commit is contained in:
Fabian Franz BSc 2018-09-19 16:58:59 +02:00 committed by GitHub
parent 3b40fe3aaf
commit eef4adc554
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 3 deletions

View file

@ -1,5 +1,5 @@
PLUGIN_NAME= tor
PLUGIN_VERSION= 1.6
PLUGIN_VERSION= 1.7
PLUGIN_COMMENT= The Onion Router
PLUGIN_DEPENDS= tor ruby
PLUGIN_MAINTAINER= franz.fabian.94@gmail.com

View file

@ -69,6 +69,12 @@
<label>Directory Port</label>
<type>text</type>
</field>
<field>
<id>relay.dir_frontpage</id>
<label>Show Directory Frontpage</label>
<type>checkbox</type>
<help>Upload a HTML file to /usr/local/etc/tor/exit-notice.html before enabling this to serve a directory frontpage.</help>
</field>
<field>
<id>relay.relay</id>
<label>Bridge</label>

View file

@ -1,11 +1,16 @@
<model>
<mount>//OPNsense/tor/relay</mount>
<version>1.0.0</version>
<description>Tor Relay configuration</description>
<items>
<enabled type="BooleanField">
<default>0</default>
<Required>Y</Required>
</enabled>
<dir_frontpage type="BooleanField">
<default>0</default>
<Required>Y</Required>
</dir_frontpage>
<host type="TextField">
<Required>N</Required>
<mask>/^([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])\.([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])\.([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])\.([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])$/</mask>

View file

@ -196,11 +196,15 @@ RelayBandwidthBurst {{ OPNsense.tor.relay.bandwithburst }} KBytes
DirPort {% if helpers.exists('OPNsense.tor.relay.host') and OPNsense.tor.relay.host != '' %}{{ OPNsense.tor.relay.host }}:{% endif%}{{ OPNsense.tor.relay.directory_port }}
{% endif %}
## Uncomment to return an arbitrary blob of html on your DirPort. Now you
## Return an arbitrary blob of html on your DirPort. Now you
## can explain what Tor is if anybody wonders why your IP address is
## contacting them. See contrib/tor-exit-notice.html in Tor's source
## distribution for a sample.
#DirPortFrontPage /usr/local/etc/tor/tor-exit-notice.html
{% if helpers.exists('OPNsense.tor.relay.dir_frontpage') and OPNsense.tor.relay.dir_frontpage == '1' %}
DirPortFrontPage /usr/local/etc/tor/exit-notice.html
{% endif %}
{% if helpers.exists('OPNsense.tor.relay.exitenabled') %}
ExitRelay {{ OPNsense.tor.relay.exitenabled }}