From fa08171943fa751af628d6e3178008ff33c422b2 Mon Sep 17 00:00:00 2001 From: Fabian Franz Date: Fri, 22 Dec 2017 17:34:10 +0100 Subject: [PATCH] security/tor: fix a bug in tor model; Add ContactInfo to tor relay; closes #385 --- security/tor/Makefile | 2 +- .../mvc/app/controllers/OPNsense/Tor/forms/relay.xml | 6 ++++++ .../tor/src/opnsense/mvc/app/models/OPNsense/Tor/Relay.xml | 5 ++++- .../tor/src/opnsense/service/templates/OPNsense/Tor/torrc | 4 ++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/security/tor/Makefile b/security/tor/Makefile index 4cde9ce9d..7081489c8 100644 --- a/security/tor/Makefile +++ b/security/tor/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= tor -PLUGIN_VERSION= 1.3 +PLUGIN_VERSION= 1.4 PLUGIN_COMMENT= The Onion Router PLUGIN_DEPENDS= tor ruby PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/security/tor/src/opnsense/mvc/app/controllers/OPNsense/Tor/forms/relay.xml b/security/tor/src/opnsense/mvc/app/controllers/OPNsense/Tor/forms/relay.xml index 7f9fba698..b115bb583 100644 --- a/security/tor/src/opnsense/mvc/app/controllers/OPNsense/Tor/forms/relay.xml +++ b/security/tor/src/opnsense/mvc/app/controllers/OPNsense/Tor/forms/relay.xml @@ -28,6 +28,12 @@ text This may only consist of characters and numbers and is used to identifiy your host. + + relay.contact_info + + text + You can enter a publicly visible (obfuscated) email address into this field to allow other users to notify you if there are issues with your relay. + relay.bandwithrate diff --git a/security/tor/src/opnsense/mvc/app/models/OPNsense/Tor/Relay.xml b/security/tor/src/opnsense/mvc/app/models/OPNsense/Tor/Relay.xml index fc371da09..74d98c54c 100644 --- a/security/tor/src/opnsense/mvc/app/models/OPNsense/Tor/Relay.xml +++ b/security/tor/src/opnsense/mvc/app/models/OPNsense/Tor/Relay.xml @@ -29,11 +29,14 @@ /^[a-z0-9.-]+$/i - /^.+$/ N /^[a-zA-Z0-9]+$/ + + N + ]+$/]]> + N diff --git a/security/tor/src/opnsense/service/templates/OPNsense/Tor/torrc b/security/tor/src/opnsense/service/templates/OPNsense/Tor/torrc index ede05720f..2bf64d473 100644 --- a/security/tor/src/opnsense/service/templates/OPNsense/Tor/torrc +++ b/security/tor/src/opnsense/service/templates/OPNsense/Tor/torrc @@ -145,6 +145,10 @@ Address {{ OPNsense.tor.relay.address }} Nickname {{ OPNsense.tor.relay.nick }} {% endif %} +{% if helpers.exists('OPNsense.tor.relay.contact_info') and OPNsense.tor.relay.contact_info != '' %} +ContactInfo {{ OPNsense.tor.relay.contact_info }} +{% endif %} + {% if helpers.exists('OPNsense.tor.relay.bandwithrate') and OPNsense.tor.relay.bandwithrate != '' %} RelayBandwidthRate {{ OPNsense.tor.relay.bandwithrate }} KBytes {% endif %}