security/tor: version 1.1 adds VIPs and fixes setup.sh usage

PR: https://forum.opnsense.org/index.php?topic=6207.0
PR: https://forum.opnsense.org/index.php?topic=6208.0

(cherry picked from commit 463dd0b21a)
(cherry picked from commit 19043bb281)
(cherry picked from commit e8d46fa119)
This commit is contained in:
Franco Fichtner 2017-10-20 19:04:08 +00:00
parent a6abecc7ee
commit b82e907a82
9 changed files with 19 additions and 6 deletions

View file

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

View file

@ -12,8 +12,8 @@ chown _tor:_tor /var/log/tor.log
chown _tor:_tor /var/run/tor
# create hidden service dirs:
/usr/local/opnsense/service/scripts/tor/make_hidden_service_dirs.php
# create Onion service dirs:
/usr/local/opnsense/scripts/tor/make_hidden_service_dirs.php
# required to access the pf device for nat
/usr/sbin/pw groupmod proxy -m _tor

View file

@ -23,13 +23,13 @@ type:script_output
message:request tor status
[genkey]
command:/usr/local/opnsense/service/scripts/tor/gen_key
command:/usr/local/opnsense/scripts/tor/gen_key
parameters:
type:script_output
message:generate Tor control key
[gethostnames]
command:/usr/local/opnsense/service/scripts/tor/get_hostnames
command:/usr/local/opnsense/scripts/tor/get_hostnames
parameters:
type:script_output
message:query hostnames of hidden services

View file

@ -1,6 +1,6 @@
{% if helpers.exists('OPNsense.tor.general.enabled') and OPNsense.tor.general.enabled == '1' %}
tor_enable="YES"
tor_opnsense_bootup_run="/usr/local/opnsense/service/scripts/tor/setup.sh"
tor_opnsense_bootup_run="/usr/local/opnsense/scripts/tor/setup.sh"
{% else %}
tor_enable="NO"
{% endif %}

View file

@ -25,6 +25,19 @@ SOCKSPort {{ interface_ip }}:{{ OPNsense.tor.general.socks_listen_port|default('
SOCKSPort [{{ interface_ip }}]:{{ OPNsense.tor.general.socks_listen_port|default('9050') }}
{% endif %}
{% endif %}
{% if helpers.exists('virtualip') %}
{% for intf_item in helpers.toList('virtualip.vip') %}
{% if intf_item.interface == listen_interface and intf_item.type == 'single' %}
{% if intf_item.subnet.find(':') > -1 %}
# {{ listen_interface }}: IPv6 VIP
SOCKSPort [{{ intf_item.subnet }}]:{{ OPNsense.tor.general.socks_listen_port|default('9050') }}
{% else %}
# {{ listen_interface }}: IPv4 VIP
SOCKSPort {{ intf_item.subnet }}:{{ OPNsense.tor.general.socks_listen_port|default('9050') }}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}