From 32e478ff45ec3448fe960bdfb6ab6e4416eca535 Mon Sep 17 00:00:00 2001 From: David Harrigan Date: Mon, 25 Sep 2017 14:31:52 +0100 Subject: [PATCH] net/zerotier: allow for local.conf settings According to the Zerotier documentation: https://www.zerotier.com/manual.shtml#4_2 - Local Configuration Options Zerotier will honour specific settings contained within a local.conf file in the Zerotier home directory. Having the ability to write out this file will allow for flexibility for users to fine-tune their Zerotier installation according to their specific needs. Fixes #284 -=david=- --- net/zerotier/Makefile | 2 +- .../app/controllers/OPNsense/Zerotier/forms/global.xml | 8 ++++++++ .../mvc/app/models/OPNsense/Zerotier/Zerotier.xml | 5 ++++- .../opnsense/service/templates/OPNsense/zerotier/+TARGETS | 1 + .../service/templates/OPNsense/zerotier/local.conf | 3 +++ .../opnsense/service/templates/OPNsense/zerotier/zerotier | 3 +++ 6 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 net/zerotier/src/opnsense/service/templates/OPNsense/zerotier/local.conf diff --git a/net/zerotier/Makefile b/net/zerotier/Makefile index 5c55b3919..1aa41e2be 100644 --- a/net/zerotier/Makefile +++ b/net/zerotier/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= zerotier -PLUGIN_VERSION= 1.1.0 +PLUGIN_VERSION= 1.2.0 PLUGIN_COMMENT= Virtual Networks That Just Work PLUGIN_DEPENDS= zerotier PLUGIN_MAINTAINER= dharrigan@gmail.com diff --git a/net/zerotier/src/opnsense/mvc/app/controllers/OPNsense/Zerotier/forms/global.xml b/net/zerotier/src/opnsense/mvc/app/controllers/OPNsense/Zerotier/forms/global.xml index afe265783..3ab096cc8 100644 --- a/net/zerotier/src/opnsense/mvc/app/controllers/OPNsense/Zerotier/forms/global.xml +++ b/net/zerotier/src/opnsense/mvc/app/controllers/OPNsense/Zerotier/forms/global.xml @@ -5,4 +5,12 @@ checkbox This will activate the Zerotier service + + zerotier.localconf + + textbox + 10 + Contains configuration options that apply to the local node + + diff --git a/net/zerotier/src/opnsense/mvc/app/models/OPNsense/Zerotier/Zerotier.xml b/net/zerotier/src/opnsense/mvc/app/models/OPNsense/Zerotier/Zerotier.xml index 3b801f502..a4487fa67 100644 --- a/net/zerotier/src/opnsense/mvc/app/models/OPNsense/Zerotier/Zerotier.xml +++ b/net/zerotier/src/opnsense/mvc/app/models/OPNsense/Zerotier/Zerotier.xml @@ -3,12 +3,15 @@ Zerotier - Virtual Networks That Just Work. - 1.1.0 + 1.2.0 0 Y + + N + diff --git a/net/zerotier/src/opnsense/service/templates/OPNsense/zerotier/+TARGETS b/net/zerotier/src/opnsense/service/templates/OPNsense/zerotier/+TARGETS index 7eb39ec11..2e49b1251 100644 --- a/net/zerotier/src/opnsense/service/templates/OPNsense/zerotier/+TARGETS +++ b/net/zerotier/src/opnsense/service/templates/OPNsense/zerotier/+TARGETS @@ -1 +1,2 @@ zerotier:/etc/rc.conf.d/zerotier +local.conf:/var/db/zerotier-one/local.conf diff --git a/net/zerotier/src/opnsense/service/templates/OPNsense/zerotier/local.conf b/net/zerotier/src/opnsense/service/templates/OPNsense/zerotier/local.conf new file mode 100644 index 000000000..f64cb264c --- /dev/null +++ b/net/zerotier/src/opnsense/service/templates/OPNsense/zerotier/local.conf @@ -0,0 +1,3 @@ +{% if helpers.exists('OPNsense.zerotier.localconf') and OPNsense.zerotier.localconf|default("") != "" %} +{{ OPNsense.zerotier.localconf }} +{% endif %} diff --git a/net/zerotier/src/opnsense/service/templates/OPNsense/zerotier/zerotier b/net/zerotier/src/opnsense/service/templates/OPNsense/zerotier/zerotier index ba2aee487..b7faa4105 100644 --- a/net/zerotier/src/opnsense/service/templates/OPNsense/zerotier/zerotier +++ b/net/zerotier/src/opnsense/service/templates/OPNsense/zerotier/zerotier @@ -1,3 +1,6 @@ +# +# This file is automatically generated. Do not manually edit this file - changes *will* be lost! +# {% if helpers.exists('OPNsense.zerotier.enabled') and OPNsense.zerotier.enabled == '1' %} zerotier_enable="YES" {% else %}